Redis caching and invalidation
Choose cache patterns and TTLs, reason about stale results and failure modes.
Model Answer & Explanation
Cache-aside pairs a TTL with explicit delete/invalidate on writes. Protect hot keys from cache stampede using singleflight locks or jittered TTLs, cache negative/empty lookups briefly where needed, and ensure the database survives if Redis restarts cold.
Follow-up Interview Question · Why is deleting a cache key usually safer than updating it concurrently during writes?
Module Context & References
PostgreSQL · 80/20 Core Foundations The core SQL, indexing, transaction and Redis patterns behind 80% of data rounds
Personal Notes · Markdown