Amazon MemoryDB for Redis Specialized2021年〜
A Redis-compatible in-memory database service with built-in durability
What It Does
Amazon MemoryDB for Redis is a fully managed in-memory database with a Redis-compatible API. Unlike ElastiCache for Redis, it provides data durability as standard through a multi-AZ transaction log. It achieves microsecond read latency and single-digit millisecond write latency.
Use Cases
Used for session stores, leaderboards, real-time rankings, shopping carts, and geospatial data processing - workloads that need both fast data access and durability.
Everyday Analogy
Think of it like a notepad with a safe. While ElastiCache is a fast but volatile notepad (cache), MemoryDB maintains the notepad's speed while also saving everything you write to a safe (transaction log), so data is never lost.
What Is MemoryDB?
Amazon MemoryDB for Redis is a service that lets you use Redis as a primary database. Traditionally, Redis was used as a cache with persistent data stored in RDS or DynamoDB. MemoryDB guarantees data durability through a multi-AZ transaction log, so Redis alone can serve as a primary database.
Differences from ElastiCache
ElastiCache for Redis is optimized for caching and does not guarantee data durability (data may be lost on node failure). MemoryDB retains data even during node failures through its multi-AZ transaction log. Write latency is slightly higher with MemoryDB (due to transaction log writes), but read latency is comparable. To deepen your understanding of the differences from ElastiCache, reference books on Amazon are also helpful.
Getting Started
Create a cluster in the MemoryDB console and select a node type and number of shards. You can connect using existing Redis client libraries as-is. Migration from ElastiCache can be done by restoring an RDB snapshot to MemoryDB.
Things to Watch Out For
- Write latency is slightly higher than ElastiCache. ElastiCache is more appropriate for cache-only use cases
- Redis-compatible, but some commands (CLUSTER management commands, etc.) have restrictions