memcache: A memcached client library.

[ bsd3, database, library ] [ Propose Tags ]

A client library for a memcached cluster. It is aimed at full binary protocol support, ease of use and speed.

[Skip to Readme]
Versions [RSS] [faq] 0.0.0, 0.0.1,,,,,,
Dependencies base (<5), binary (>=, blaze-builder (>=, bytestring (>=, hashable (>=, network (>=2.4), resource-pool (>=, time (>=1.4), vector (>=0.7), vector-algorithms (>=0.5) [details]
License BSD-3-Clause
Copyright 2015 David Terei.
Author David Terei <>
Maintainer David Terei <>
Category Database
Home page
Bug tracker
Source repo head: git clone
Uploaded by DavidTerei at 2015-05-05T22:46:08Z
Distributions NixOS:
Downloads 3917 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2015-05-05 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees


Readme for memcache-0.0.1

[back to package description]

memcache: Haskell Memcache Client

Hackage version Build Status

This library provides a client interface to a Memcache cluster. It is aimed at full binary protocol support, ease of use and speed.


This library is BSD-licensed.


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 memcache 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.



  • Connection error handling
  • SASL -- tie in with cluster management
  • Timeouts
  • Pull cluster and server creation into client


  • Multi-get
  • Generic multi operation support
  • Customizable server sharding -- mod & virtual servers


  • Asynchronous support
  • Customizable -- timeout, max connection retries, hash algorithm
  • Max value validation
  • Optimizations --
  • UDP
  • Server error handling mode where we return misses and ignore sets


  • Typeclass for serialization
  • Monad / Typeclass for memcache

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 git://


This library is written and maintained by David Terei,