Skip to content

Redis and Caching Databases

In-memory data stores, caching patterns, session storage, and pub/sub — when Redis is the answer.

15 min readdata-strategy, redis, caching, in-memory, performance

Your database query takes 200ms. That's fine for one user. But when a thousand users hit the same page at the same time, that's 200ms multiplied by a thousand concurrent connections, and your database starts sweating. The query itself hasn't gotten slower — you've just asked it to run a thousand times per second.

The solution isn't to make the query faster. The solution is to stop asking the question so often. Run the query once, store the result somewhere fast, and serve it from there for the next thousand requests. That "somewhere fast" is a cache, and Redis is the most popular in-memory data store for building one.

What Redis Actually Is

Redis (Remote Dictionary Server) is an in-memory data structure store. Unlike traditional databases that store data on disk and occa

This lesson is part of the Guild Member curriculum. Plans start at $29/mo.