Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Medium · Free

How is Redis used as a cache in front of a database?

FresherFundamentalsDatabase Fundamentals
Model answer

Redis cache-aside

For How is Redis used as a cache in front of a database, interviewers listen for a crisp definition, how the pieces interact in a real system, and one trade-off or failure mode you have seen or would guard against.

diagram
read: app → Redis hit? return : DB → populate Redis
write: update DB → invalidate cache key
TTL prevents stale forever; watch cache stampede on hot keys.