Ufraan's Notes Digital garden & personal knowledge base
Last modified: Jun 28, 2026Home / 02_cs / Databases / Redis / Redis.Md

cs

Redis is an in-memory data store commonly used as a cache, database, or message broker.
Because it stores data in memory instead of disk, Redis provides extremely fast read and write operations.

Many modern applications place Redis between the application server and the primary database. This allows frequently requested data to be served quickly without repeatedly querying the main database.

working of redis.png

When a request comes from the client:

  1. The API first checks Redis.
  2. If the data exists in Redis (cache hit), it returns immediately.
  3. If the data does not exist (cache miss), the API queries the main database and optionally stores the result in Redis for future requests.

This approach greatly reduces database load and improves response time.

Redis stores data using a key–value model, but unlike simple key–value stores, Redis also supports several specialized data structures.

Redis Data Types

Each data structure has its own commands and use cases.

Redis is commonly used for: