Book 4 · Lesson 4.8
Redis cache warm-up
- Run warm_redis after Postgres insert
- Explain HSET, INCR, PUBLISH keys
- Connect to metrics summary latest_by_source
Prerequisites: 4.7 · 2.6
Postgres is durable; Redis is fast + live.
After persist_event, analyzer calls warm_redis:
| Key | Purpose |
|---|---|
team_radar:latest_by_source | Hash — latest event id per source |
team_radar:count:{source} | Counter |
team_radar:events | Pub/sub channel for SSE |
RedisCacheWarmup — click Warm on each key.
Teach-back prompt
Why warm Redis if Postgres already has the row?
Redis warm after insert
Lab complete — nice work.