← All components
Caching
In-memory cache
Sub-millisecond key-value store for hot data, counters, sessions, locks and geo indexes.
When to use
- Cache-aside in front of databases
- Rate-limit counters, leaderboards, seat holds
Pitfalls
- Stampedes on expiry
- Treat it as lossy unless persistence is configured
Options by provider
The first option is what diagrams show for that provider.
Amazon Web Services
- Amazon ElastiCacheManaged
- Amazon MemoryDB — durableManaged
Google Cloud
- MemorystoreManaged
Microsoft Azure
- Azure Managed RedisManaged
Open source / self-hosted
- RedisSelf-hosted
- ValkeySelf-hosted
- MemcachedSelf-hosted
Related concepts
Used in
- YouTube
- Hot metadata cache — Popular video metadata and view/like counters
- Netflix
- EVCache — Distributed cache for metadata, rows and sessions
- Instagram
- Feed cache — A list of recent post IDs per user
- Twitter / X
- Home timelines — Recent tweet IDs per user
- WhatsApp / Messenger
- Session registry — userId → chat server, plus presence
- Uber
- Geo index — Driver positions bucketed by S2 cell; also holds assignment locks
- Amazon
- Product cache — Hot product pages and prices
- Payment gateway
- Idempotency store — Remembers each request key and its response
- URL shortener
- Hot links cache — key → URL for popular links
- API rate limiter
- Counter store — Shared counters and token buckets, updated atomically with Lua scripts
- Search autocomplete
- Hot prefix cache — In-memory top-k for the most typed prefixes
- Web crawler
- DNS & robots cache — Resolved IPs, robots.txt rules and per-host rate limits
- Seen-URL Bloom filter — Fast 'have we queued this before?' check
- Pastebin
- Cache — Hot paste metadata and small contents
- Dropbox
- Metadata cache — Hot folder listings and block-exists checks
- Google Maps
- Live speeds — Current speed per road segment
- WebSockets at scale
- Connection registry — userId → pod, rooms and presence
- Video calling (WebRTC)
- Room state — Participants and assigned media server
- BookMyShow
- Seat holds — Short-lived locks per seat (TTL)
- MakeMyTrip
- Fare & rate cache — Recent supplier answers with short TTLs
- Meeting scheduler
- Free/busy cache — Busy intervals per user per day
- Car rental
- Availability cache — Remaining capacity per branch, class and day
- Zomato / food delivery
- Menu cache — Menus and item availability
- Rider geo index — Free riders by map cell
- Urban Company
- Slot capacity & holds — Capacity per zone and short-lived holds
- Professional locations — Home bases and live positions by cell
- Porter / goods delivery
- Driver geo index — Free drivers by vehicle type and cell
- Driver booking & fleet management
- Driver geo index — Online drivers by cell and skill
- Practo / teleconsultation
- Slot holds — Short-lived holds during payment
- AstroTalk
- Presence — Online/busy status
- Quora
- Counters & feeds — Vote counts and pre-built feeds
- LinkedIn
- Feed cache — Recent post IDs per member
- Stock brokerage
- Quote cache — Latest quote per symbol
- Live sports scores
- Match state — Latest score per match
- Redis Cluster
- Cluster endpoint / smart client — Maps each key to its slot and the node that owns it
- Failure detection (cluster bus) — Nodes gossip health; a majority of primaries vote to promote a replica
- Primary A (slots 0–5460) — Owns a third of the slots; handles writes
- Replica A — Copy of A; can serve reads and take over
- Primary B (slots 5461–10922) — Owns a third of the slots; handles writes
- Replica B — Copy of B
- Primary C (slots 10923–16383) — Owns a third of the slots; handles writes
- Replica C — Copy of C