⚡Backend ArchitectureComing Soon
Caching with Redis
Cache-aside pattern with Redis for player data and user profiles.
Video coming soon
Add a YouTube video ID to the topics config
Documentation
Overview
Redis provides a caching layer to reduce database load for frequently accessed data. The app uses a cache-aside (lazy-loading) pattern.
Cached Data
| Key Pattern | Data | TTL | Invalidation |
|---|---|---|---|
players | Full player list | 24 hours | On player create/update/delete |
user:{id} | Profile data | Until update | On profile update |
Cache-Aside Flow
1. Check Redis for cached data
2. If HIT → return cached data
3. If MISS → query MongoDB → store in Redis → return
4. On write → delete cache key (invalidate)
Design Decisions
- Cache-aside chosen over write-through for simplicity
- Manual invalidation ensures freshness on writes
- Full list caching for players — small dataset, read-heavy workload
- No cache warming — lazy population on first request
Technical Details
<!-- Add details about Redis connection pooling, error handling, TTL strategy, etc. -->Content coming soon — add your video and detailed writeup here.