---
title: "Redis"
description: "Redis is a fast in-memory key-value store used for caching, queues, sessions and real-time counters. Learn how it works and when to reach for it."
url: "https://nodea.io/en/glossary/redis"
lang: "en"
updated: "2026-07-13"
---

# Redis

> Redis is an in-memory key-value data store used as a cache, a task-queue broker, a session store and a real-time counter thanks to sub-millisecond latency.

**Redis** (short for *Remote Dictionary Server*) is an in-memory key-value data store prized for extremely low latency — individual operations complete in microseconds. Although it is called a database, in practice it usually acts as a universal layer between your application and a slower persistent store such as [MySQL](https://nodea.io/en/glossary/mysql) or [PostgreSQL](https://nodea.io/en/glossary/postgresql).

## How Redis works

Redis holds all data in RAM, which makes reads and writes orders of magnitude faster than disk-backed storage. It is more than a plain cache, though: Redis understands the structure of the values it stores and ships ready-made operations for several data types:

- **strings** — simple values, counters, flags,
- **lists** — job queues (push and pop from either end),
- **sets** and **sorted sets** — unique collections and weighted leaderboards,
- **hashes** — multi-field objects such as a user session,
- **pub/sub** and streams — real-time event delivery.

So data is not lost on restart, Redis provides durability through RDB snapshots and the AOF log; it also supports master-replica replication and clustering for high availability.

## Redis in practice

The most common role is offloading a relational database by acting as a caching [buffer](https://nodea.io/en/glossary/buffer): query results or whole page fragments live in memory and are served in a fraction of a millisecond. Beyond caching, Redis serves as a web-session store, a broker for background task queues (sending mail, generating reports), a request-limit counter for [rate limiting](https://nodea.io/en/glossary/rate-limiting), and an event bus for real-time features. On hosting platforms and VPS servers Redis is frequently the default cache and session engine for PHP applications, measurably cutting response times under load.

### Does Redis lose data when the server restarts?

Not necessarily. Redis keeps data in RAM but offers two durability options: periodic RDB snapshots written to disk, and an append-only file (AOF) that logs every write. Configured properly, data survives a restart — though Redis is most often used where occasional loss is acceptable.

### How is Redis different from Memcached?

Both are fast in-memory stores, but Redis supports rich data types (lists, sets, hashes, sorted sets), on-disk persistence, replication and pub/sub. Memcached is simpler and holds only plain key-value pairs, which can be enough for pure caching.

## Related

- [Memcached](https://nodea.io/en/glossary/memcached)
- [Database](https://nodea.io/en/glossary/database)
- [NoSQL](https://nodea.io/en/glossary/nosql)
- [Cache and microcaching](https://nodea.io/en/glossary/cache-and-microcaching)
- [Buffer](https://nodea.io/en/glossary/buffer)

---

Languages: [pl](https://nodea.pl/pl/slownik-pojec/redis.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
