# Redis (Remote Dictionary Server)

URL: https://softwaredictionary.org/terms/redis
Category: Databases
Last updated: 2026-10-03
Pronunciation: RED-iss

In short: Redis is an in-memory key-value store that reads and writes in well under a millisecond, which makes it a popular cache, session store and message broker.

## What is Redis?

Redis, short for Remote Dictionary Server, was created by Salvatore Sanfilippo in 2009. It stores data as keys and values, like a giant dictionary, but the values can be rich data structures: strings, lists, sets, sorted sets, hashes, streams and more. Because everything lives in memory instead of on disk, most operations finish in microseconds.

Applications talk to Redis with simple commands such as `SET`, `GET`, `INCR` or `EXPIRE`. A key can be given a time to live, after which Redis deletes it on its own, which is exactly what a cache or a login session needs. Redis can also save snapshots or an append-only log to disk, so data survives a restart, and it can replicate to other servers for high availability.

Typical uses are caching database results, storing user sessions, counting things such as page views or rate-limit hits, leaderboards built on sorted sets, and lightweight queues or pub/sub messaging between services. In many systems it sits next to a main database like PostgreSQL, holding the hot data that is read again and again.

A common misconception is that Redis is only a cache. It is a full data store, but its data must fit in memory, which is more expensive than disk, so it is rarely the only database an application has. Since 2024 its license has changed more than once, and the Linux Foundation maintains an open-source fork called Valkey that works with the same commands.

## Key takeaways

- Redis is an in-memory key-value store, so reads and writes are extremely fast.
- Values can be strings, lists, sets, sorted sets, hashes and streams.
- Keys can expire automatically, which suits caches and sessions.
- Data can be saved to disk and replicated to other servers.
- It usually works next to a main database rather than replacing it.

## Example: Caching a value for one minute (Node.js)

```javascript
import { createClient } from "redis";

const redis = createClient();
await redis.connect();

// Store a value that Redis deletes after 60 seconds
await redis.set("user:42:name", "Ada", { EX: 60 });

const name = await redis.get("user:42:name"); // "Ada"
await redis.incr("page:home:views"); // atomic counter
```

## Frequently asked questions

**Is Redis a database or a cache?**

Both. Redis is a data store that can keep data permanently, but because its data lives in memory it is most often used as a cache or for short-lived data next to a main database.

**What happens to Redis data when the server restarts?**

Without persistence it is lost. With snapshots (RDB) or an append-only file (AOF) turned on, Redis reloads the data from disk when it starts again.

**What is Valkey?**

Valkey is an open-source fork of Redis maintained under the Linux Foundation, started in 2024 after Redis changed its license. It works with the same commands and client libraries.

## Sources

- [Redis documentation](https://redis.io/docs/latest/)

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
