What Is Redis?
Redis is the tool most systems reach for the moment a database query becomes too slow to run on every request.
What Is Redis?
Redis is an in-memory key-value data store. Because data lives in RAM rather than on disk, reads and writes are extremely fast -- typically sub-millisecond. It supports more than simple string values too: lists, sets, sorted sets, hashes, and streams, each with their own operations, which is why it's often described as a "data structure server" rather than just a cache.
Common Use Cases
- Caching -- storing the result of an expensive database query so repeat requests are instant
- Session storage -- holding logged-in user session data that needs fast, shared access across servers
- Rate limiting -- counting requests per user/IP in a tight time window
- Leaderboards -- sorted sets are a natural fit for real-time rankings
- Pub/sub messaging -- lightweight real-time notifications between services
Redis vs. a Regular Database
Redis isn't a replacement for a relational or document database -- it's usually used alongside one. A typical pattern: the source of truth (e.g. SQL Server, MySQL, MongoDB) holds the real data, and Redis holds a fast, disposable copy of the parts that are read often and change rarely. Redis can persist data to disk, but it's built around speed, not the durability and query guarantees a primary database provides.