# Redis

> A store that keeps data in memory, under keys. That makes it very fast.

**Field:** Software Development  
**Category:** Databases  
**Also known as:** Redis Database

## Think of it like

Think of it like a sticky note on your desk, not a file down in the cellar. It is right there when you need it.

## Definition

Redis is a key-value store that keeps data in memory. That makes it very fast. It can hold plain text, lists, sets and counters under each key. Keys can be told to expire after a set time. Most apps use it as a cache or a session store in front of a main database. Its server listens on port 6379 by default.

## Example

Jack's shop caches its home page product list in Redis for 60 seconds. The main database gets one query a minute instead of thousands.

## Example code

```console
$ redis-cli SET greeting "Hi Emma"
OK
$ redis-cli GET greeting
"Hi Emma"
```

Save a value under a key, then read it back.

## Why it matters

Reading from memory is far faster than from disk. Redis takes load off the main database.

## Common mistake

Treating it as the only copy of important data. If it is set up as a cache, a restart can lose what it holds.

## Three principles

- **In memory.** Extremely fast reads and writes.
- **Keys can expire.** Old data clears itself.
- **In front of the database.** A cache, not the main store.

## Related terms

- [Key-Value Store](https://learn.benibix.com/term/development/key-value-store)
- [NoSQL Database](https://learn.benibix.com/term/development/nosql-database)
- [MongoDB](https://learn.benibix.com/term/development/mongodb)
- [Database](https://learn.benibix.com/term/development/database)

---

Source: https://learn.benibix.com/term/development/redis
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
