AWS ElasticCache Redis - keshavbaweja-git/guides GitHub Wiki
Cluster Modes
Endpoints
Type | Endpoint |
---|---|
Single Node Redis (cluster mode disabled) | One endpoint for both reads and writes |
Multi-Node Redis (cluster mode disabled) | Primary Endpoint always connects to primary node, use this for all writes Node endpoint points to a specific node, use only for reads |
Multi-Node Redis (cluster mode enabled) | Configuration Endpoint provides information on Primary and Read/Node endpoints for each shard |
Caching Strategies
Lazy Loading
Advantages
- Only requested data is loaded in Cache, no superfluous data
- Node failure is not fatal, although with increased latency and load on back end data store
Disadvantages
- Cache miss penalty
- Stale Data, if data only loaded in cache with the initial look up it will turn stale on next update to its values in back end data store
Write Through
Adds or updates data in cache with every update to back end data store.
Advantages
- Data is never stale
- Read latency is minimized at the cost of an increase in Write Latency
Disadvantages
- Missing Data if not combined with Lazy Loading
- Superfluous data, can be addressed with TTL
TTL
An integer value that specifies the number of seconds/milliseconds until key expires
Background Write Process and Memory Usage
Set reserved-memory-percent
to 25
for Redis version 2.8.22 and later