What is Redis? The In-Memory Data Store That Makes Your App Faster
Sub-millisecond response times and millions of operations per second

๐ฌ This article is a companion to my YouTube video. Watch it here:
https://www.youtube.com/watch?v=e3KNJr1ATv8
Introduction
In this video we are going to talk about Redis โ what it is, what it does, and why it is an important part of my back-end stack.
What is Redis?
Redis is a free, open-source, in-memory data store. Unlike PostgreSQL which stores data on disk, Redis stores data entirely in memory โ in RAM. This makes it extremely fast. Redis can handle millions of operations per second with sub-millisecond response times.
Redis is most commonly used as a cache, a session store, a message broker, and a real-time data store.
What is Caching?
When your application queries a database, that query takes time โ it reads from disk, processes the query, and returns the result. If the same query is made thousands of times per second, you are hitting the database thousands of times unnecessarily.
Caching solves this by storing the result of a query in memory. The first request hits the database and the result is stored in Redis. Every subsequent request gets the result from Redis โ which is in memory and therefore much faster โ instead of hitting the database again.
Think of it like a shortcut. Instead of driving the long route to the database every time, you take the shortcut through Redis.
What Does Redis Do?
Caching
Store frequently accessed data in memory for fast retrieval. Database query results, API responses, computed values โ anything that is expensive to compute and accessed frequently is a good candidate for caching.
Session storage
Store user session data in Redis instead of the database. Since sessions are read on every request, having them in memory is significantly faster than a database lookup.
Rate limiting
Track how many requests a user or IP address has made in a given time window. Redis's atomic increment operations make it perfect for implementing rate limiting.
Message queues and pub/sub
Redis supports publish/subscribe messaging and message queues. Applications can publish messages to a channel and subscribers receive them in real time.
Leader boards and counters
Redis sorted sets make it trivial to implement leader boards, counters, and real-time analytics.
Why Directus Uses Redis
Directus uses Redis for two primary purposes.
First, as a cache layer. Directus caches API responses, schema information, and permission look-ups in Redis. This dramatically reduces database load and speeds up API response times.
Second, for synchronization across multiple Directus instances. If you run multiple instances of Directus for high availability or horizontal scaling, Redis acts as the shared cache and message bus that keeps them in sync.
For a single Directus instance Redis is optional but recommended. For multiple instances it is required.
Why I Chose Redis
Redis is the industry standard for caching and session storage. It is fast, reliable, widely supported, and Directus has first-class support for it. Adding Redis to the stack costs very little in terms of resources but provides significant performance benefits as the application scales.
Conclusion
Redis is a powerful in-memory data store that makes your application faster and more scalable by caching frequently accessed data and handling real-time workloads. It is a small but important piece of a production-ready back-end stack.
In an upcoming video we will deploy Redis alongside Directus and PostgreSQL on our VPS using Coolify.
References
๐ Subscribe to my YouTube channel for the full series on building a modern web app back end from scratch.




