Skip to main content

What is Redis?

Redis is an in-memory database used for very fast data storage and access.

Its name stands for REmote DIctionary Server.

The main idea

Redis stores data in RAM, not on disk, so it runs tens of times faster than ordinary databases (e.g. PostgreSQL or MySQL).

Data types

Redis isn't just "key-value". It supports several structures:

  • strings, plain values;
  • lists, ordered collections;
  • sets, unique elements;
  • hashes, fields and values (like a dictionary);
  • sorted sets, with priorities (rankings, leaderboards);
  • streams, bitmaps, geospatial data, and more.

How it works

  • All data is stored in RAM, but Redis can periodically save it to disk (a snapshot) or to a log (AOF), so nothing is lost on a failure.
  • Access follows the key → value principle.

Main uses

  • Caching (speeding up web services).
  • Storing user sessions.
  • Message queues and pub/sub systems.
  • Counters, rankings, timers (thanks to atomic operations).

Characteristics

  • Very high speed (operations take milliseconds).
  • Supports TTL, a key's time to live (it's removed automatically).
  • Can run as a cluster for scaling.

Summary: Redis is an extremely fast in-memory database, a great fit for caches, queues, and real-time systems, where access speed matters more than complex relationships.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.