Selecting an Engine: Memcached, Redis (cluster mode disabled), or Redis (cluster mode enabled)
On the surface, the engines look similar. Each of them is an in-memory key/value store. However, in practice there are significant differences.
Select Memcached if the following apply to your situation:
You need the simplest model possible.
You need to run large nodes with multiple cores or threads.
You need the ability to scale out/in, adding and removing nodes as demand on your system increases and decreases.
You need to partition your data across multiple shards.
You need to cache objects, such as a database.
Select Redis 2.8.x or Redis 3.2 (non-clustered mode) if the following apply to your situation:
You need complex data types, such as strings, hashes, lists, sets, sorted sets, and bitmaps.
You need to sort or rank in-memory data-sets.
You need persistence of your key store.
You need to replicate your data from the primary to one or more read replicas for read intensive applications.
You need automatic failover if your primary node fails.
You need publish and subscribe (pub/sub) capabilities—to inform clients about events on the server.
You need backup and restore capabilities.
You need to support multiple databases.
Select Redis 3.2 (clustered mode) if you require all the functionality of Redis 2.8.x with the following differences:
You need to partition your data across 2 to 15 node groups (cluster mode only).
You need geospatial indexing (clustered mode or non-clustered mode).
You do not need to support multiple databases.
Redis (cluster mode enabled) cluster mode has the following limitations:
No scale up to larger node types.
No changing the number of node groups (partitions).
No changing the number of replicas in a node group (partition).
Comparison summary of Memcached, Redis (cluster mode disabled), and Redis (cluster mode enabled)
|Memcached||Redis (cluster mode disabled)||Redis (cluster mode enabled)|
|Engine versions||1.4.x||2.8.x & 3.2.x||3.2.x|
|Data types||Simple ‡||Redis 2.8.x - Complex *||Complex †|
|Redis 3.2.x - Complex †|
|Cluster is modifiable||Yes||Yes||No|
|Node type upgrade||No||Yes||No|
|Persistence of key store||No||Yes||Yes|
|High availability (Replication)||No||Yes||Yes|
|Automatic Failover of Primary||No||Optional||Required|
|Counters & hashes||No||Yes||Yes|
|Geospatial indexing||No||Redis 2.8.x - No||Yes|
|Redis 3.2.x - Yes|
|‡ string, objects (like databases)|
|* string, sets, sorted sets, lists, hashes, bitmaps, hyperloglog|
|† string, sets, sorted sets, lists, hashes, bitmaps, hyperloglog, geospacial indexes|