← thecodex.expert · The Codex Family of Knowledge
Databases

Redis

Blazing-fast in-memory store. Caching, sessions, queues, real-time — when speed is everything.

What is Redis?

Redis is an in-memory data store — it keeps data in RAM, which makes it extraordinarily fast. It is most often used not as a primary database but as a layer in front of one: a cache that remembers recent answers, a place to store user sessions, or a queue passing jobs between services.

When should you use it?

Add Redis when something is too slow and you are computing or fetching the same thing repeatedly (cache it), when you need to share session data across servers, or when you need a fast queue or real-time features (live counters, leaderboards, pub/sub messaging).

How to set it up

Run with Docker: docker run -p 6379:6379 redis. Managed options include AWS ElastiCache and Upstash.

How it connects to your code

From Python use redis-py; from Node.js use ioredis. The commands are simple: SET key value to store, GET key to retrieve, with optional expiry times for caching.

Redis Reference Topics 10 planned

These are the topics planned for this reference. They are not written yet — the list is published so you can see what is coming. Everything already complete on this site is linked from the Languages section.

What is Redis Coming soon

Origin (Salvatore Sanfilippo, 2009), the 2024 license change, and Valkey.

Guide in progress
Installing Redis Coming soon

Local install, Docker, or managed services (including Valkey-based ones).

Guide in progress
Data Structures in Redis Coming soon

Strings, lists, sets, hashes, and sorted sets — not just key-value.

Guide in progress
Key Expiration and TTL Coming soon

Automatic expiry — core to Redis's caching use case.

Guide in progress
Caching Patterns Coming soon

Cache-aside, write-through, and cache invalidation strategies.

Guide in progress
Pub/Sub in Redis Coming soon

Lightweight publish-subscribe messaging built into the same server.

Guide in progress
Redis as a Queue Coming soon

Lists and streams as the basis for job queues.

Guide in progress
Persistence: RDB vs. AOF Coming soon

How an in-memory store survives a restart.

Guide in progress
Redis Cluster and Replication Coming soon

Scaling beyond a single instance.

Guide in progress
Connecting from Application Code Coming soon

Clients like ioredis, redis-py, and Jedis.

Guide in progress