Amazon ElastiCache is a fully managed in-memory caching service that supports:
-
Redis (most popular)
- Memcached
β
It provides ultra-fast data retrieval, low latency, and high throughput β ideal for real-time applications.
π§ Why Use ElastiCache?
- Reduce latency by caching frequently accessed data
- Improve application performance
- Offload read pressure from databases like RDS, Aurora
- Enable session storage, leaderboards, pub/sub systems, and real-time analytics
π Redis vs Memcached
Feature |
Redis |
Memcached |
Data Types |
Strings, Hashes, Lists, Sets |
Strings only |
Persistence |
β
Yes |
β No |
Pub/Sub |
β
Yes |
β No |
Replication |
β
Yes |
β No |
Clustering |
β
Yes (sharding + HA) |
β
Yes (sharding only) |
Use Case |
Real-time analytics, queues |
Simple cache |
π§ Key Features
Feature |
Description |
Fully Managed |
AWS handles patching, backups, scaling |
Multi-AZ with Failover |
For Redis (with automatic failover) |
Automatic Backups |
For Redis (snapshot-based) |
Scaling |
Cluster mode for horizontal scaling (Redis only) |
Monitoring |
CloudWatch integration |
Security |
VPC, IAM, KMS encryption, SSL |
π§° Common Use Cases
Use Case |
Description |
Caching DB queries |
Cache frequently read data from RDS/Aurora |
Session management |
Store user session data for web apps |
Leaderboard systems |
Use sorted sets in Redis |
Pub/Sub messaging |
Real-time chat, notifications |
Token and auth caching |
Reduce load on authentication systems |
ποΈ Architecture Diagram (Simplified)
π‘οΈ Security & Access
- Deploy in VPC
- Use Security Groups to restrict access
-
Encryption in-transit (TLS) and at-rest (KMS)
- Use AUTH token for Redis authentication
πΈ Pricing Highlights
Cost Factor |
Notes |
Instance Hours |
Based on node type and size (on-demand or reserved) |
Data Transfer |
Free within same AZ |
Backups |
Only for Redis (snapshot storage charged per GB) |
π ElastiCache Pricing
π§ͺ Redis CLI Example
β
Summary
Attribute |
ElastiCache |
Engine Support |
Redis, Memcached |
Management |
Fully managed by AWS |
Scaling |
Vertical + Horizontal (Redis Cluster) |
Use Cases |
Caching, session store, queues, analytics |
Security |
VPC, IAM, encryption, access control |