▲ 13 ▼ Groupcache - memcached in Go
groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases, for API docs and examples, see http://godoc.org/github.com/golang/groupcache
Comparison to memcached
Like memcached, groupcache:
- shards by key to select which peer is responsible for that key
Unlike memcached, groupcache:
- does not require running a separate set of servers, thus massively reducing deployment/configuration pain. groupcache is a client library as well as a server. It connects to its own peers.
- comes with a cache filling mechanism. Whereas memcached just says "Sorry, cache miss", often resulting in a thundering herd of database (or whatever) loads from an unbounded number of clients (which has resulted in several fun outages), groupcache coordinates cache fills such that only one load in one process of an entire replicated set of processes populates the cache, then multiplexes the loaded value to all callers.
- does not support versioned values. If key "foo" is value "bar", key "foo" must always be "bar". There are neither cache expiration times, nor explicit cache evictions. Thus there is also no CAS, nor Increment/Decrement. This also means that groupcache....
- ... supports automatic mirroring of super-hot items to multiple processes. This prevents memcached hot spotting where a machine's CPU and/or NIC are overloaded by very popular keys/values.
Register to comment or vote on this story