Amazon ElastiCache
Amazon ElastiCache is a web service on Amazon Web Services used to deploy and run in-memory data stores — Valkey, Redis OSS, and Memcached — in the cloud, providing sub-millisecond latency for read-heavy application workloads.
AI Practitioner focus
- ElastiCache provides low-latency in-memory caching for repeated retrieval results, session data, rate limits, and application state around AI inference.
- A cache reduces latency and cost but is not the durable source of truth, the model itself, or a substitute for access-controlled RAG data.
Key points
- Best suited for caching frequently accessed data behind read-heavy, transactional workloads and for storing session states — not a data warehouse or analytics service; that role belongs to Amazon Redshift.
- In-memory caching features provide sub-millisecond latency for read-heavy application workloads.
- Distinct from Amazon CloudFront, which caches static content at edge locations close to end users; ElastiCache caches application and database data within a region.
- Two engine families since 2024: ElastiCache for Valkey and ElastiCache for Redis OSS. Valkey is the open-source, Linux Foundation-governed fork of Redis created after Redis Inc. changed its licensing; AWS now recommends Valkey as the default engine for new caches — it is drop-in compatible with Redis OSS APIs, typically cheaper, and receives AWS’s primary investment going forward. ElastiCache for Redis OSS remains available for existing Redis-compatible workloads. Both share the same feature set described below (persistence, Multi-AZ, replication).
- Amazon ElastiCache for Valkey / Redis OSS:
- Useful for gaming applications, geospatial services, caching, session stores, and replication.
- Data is persistent.
- It is not multi-threaded.
- Supports Multi-AZ using read replicas.
- Amazon ElastiCache for Memcached:
- Useful for building applications that require caching layers.
- Data is not persistent.
- Supports multi-threading.
- Does not support Multi-AZ failover.
- Does not support snapshots.
- Example architecture: client traffic through Elastic Load Balancing (ELB) to an Amazon EC2 Auto Scaling group — fast reads/writes go to ElastiCache, while slower reads/writes fall through to Amazon RDS.