Redis
- an in-memory (RAM)
- key–value data store
- supports TTL/expiration
Pros and cons
- Pros:
- Extremely fast
- Rich data structure (value)
- String
- ZSet
- Set
- List/Stream
- INCR+
- TTL & eviction built-in
- Atomic operations
- Good for performance layer
- Replication / Cluster options
- Cons
- Memory is expensive
- Not a source of truth by default
- Eviction / TTL can cause cache misses & inconsistency
- Scaling pitfalls
- Limited query capabilities
- Operational complexity / security
Redis Deployment
- Docker (local / dev)
- Fastest way to run Redis for development and testing.
- Pros: consistent env, easy reset, works great with CI.
- Typical:
docker run redis or Docker Compose with your app.
- Managed Redis (production)
- Use a cloud-managed service (e.g., AWS ElastiCache / GCP Memorystore / Azure Cache).
- Pros: high availability, backups, monitoring, automatic failover, less ops work.
- Best default choice for production if you don’t want to operate Redis yourself
- Kubernetes (platform teams)
- Deploy Redis via Helm/Operator, usually as StatefulSets with persistent volumes.
- Pros: fits K8s-native workflows (GitOps, scaling, unified ops).
- Cons: more complexity for stateful services; needs solid storage + networking setup.