MyNixOS website logo
Description

A memcached client library.

A client library for a Memcached cluster. Memcached is an in-memory key-value store typically used as a distributed and shared cache. Clients connect to a group of Memcached servers and perform out-of-band caching for things like SQL results, rendered pages, or third-party APIs.

It supports the binary Memcached protocol and SASL authentication. No support for the ASCII protocol is provided. It supports connecting to a single, or a cluster of Memcached servers. When connecting to a cluser, consistent hashing is used for routing requests to the appropriate server. Timeouts, retrying failed operations, and failover to a different server are all supported.

Complete coverage of the Memcached protocol is provided except for multi-get and other pipelined operations.

Basic usage is:

import qualified Database.Memcache.Client as M

mc <- M.newClient [M.ServerSpec "localhost" "11211" M.NoAuth] M.def
M.set mc "key" "value" 0 0
v <- M.get mc "key"

You should only need to import Database.Memcache.Client, but for now other modules are exposed.

memcache: Haskell Memcached Client

Hackage Hackage Dependencies BSD3 License Build Gitter

A client library for a memcached cluster.

It supports the binary memcached protocol and SASL authentication. No support for the ASCII protocol is provided. It supports connecting to a single, or a cluster of memcached servers. When connecting to a cluser, consistent hashing is used for routing requests to the appropriate server.

Complete coverage of the memcached protocol is provided except for multi-get and other pipelined operations.

Licensing

This library is BSD-licensed.

Tools

This library also includes a few tools for manipulating and experimenting with memcached servers.

  • OpGen -- A load generator for memcached. Doesn't collect timing statistics, other tools like mutilate already do that very well. This tool is useful in conjunction with mutilate.
  • Loader -- A tool to load random data of a certain size into a memcached server. Useful for priming a server for testing.

Architecture Notes

We're relying on Data.Pool for thread safety right now, which is fine but is a blocking API in that when we grab a socket (withResource) we are blocking any other requests being sent over that connection until we get a response. That is, we can't pipeline.

Now, use of multiple connections through the pool abstraction is an easy way to solve this and perhaps the right approach. But, could also implement own pool abstraction that allowed pipelining. This wouldn't be a pool abstraction so much as just round-robbining over multiple connections for performance.

Either way, a pool is fine for now.

Other clients

Get involved!

We are happy to receive bug reports, fixes, documentation enhancements, and other improvements.

Please report bugs via the github issue tracker.

Master git repository:

  • git clone https://github.com/dterei/memcache-hs.git

Authors

This library is written and maintained by David Terei ([email protected]).

Contributions have been made by the following great people:

Metadata

Version

0.3.0.2

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows