Grokking Redis
Learn how Redis works and how to use it in system design: data structures, caching, locks, rate limits, streams, scaling, and AI workloads, on Redis 8.

Course Overview
Redis appears in most large system designs: as a cache in front of a database, a counter for rate limits, a lock between servers, a queue between services, or a leaderboard that ranks millions of players. Writing "add Redis" on a whiteboard is easy. Explaining which data structure holds the data, how much memory it needs, and what happens when a node fails is what this course teaches. You start with how Redis works: data in memory, one thread that executes commands, and an event loop that serves many connections. You then learn each data structure, from strings and hashes to sorted sets, bitmaps, HyperLogLog, and streams. The middle of the course applies them to patterns: cache-aside and its relatives, TTL design and invalidation, cache stampedes, rate limiting, distributed locks with fencing tokens, job queues, idempotency keys, leaderboards, Pub/Sub, consumer groups, geospatial search, and news feed fan-out. Later chapters cover persistence, replication, Sentinel, Cluster, memory estimation, and failure scenarios, then compare Redis with Memcached, Kafka, SQS, and ZooKeeper. Complete designs, from a rate limiter to a chat system and a URL shortener, put the pieces together, and a final chapter covers semantic caching, vector search, and token quotas for AI systems. The core commands were run on Redis 8.10 during the review, so the replies you read are the replies Redis printed.
What you'll learn in Grokking Redis
- Explain why Redis is fast: data in memory, one command thread, an event loop, and I/O threads.
- Name keys, set TTLs, and predict how expiration and eviction free memory.
- Prevent cache stampedes, handle hot keys and cold starts, and use Bloom filters for negative caching.
- Design leaderboards, Pub/Sub notifications, stream consumers, geospatial search, and news feed fan-out.
- Run replication, Sentinel, and Redis Cluster, and find and fix hot keys and big keys.
- Decide between Redis and Memcached, Kafka, SQS, database locks, or ZooKeeper, and know when not to use Redis.
- Use Redis in AI systems for semantic caching, vector search, conversation memory, and token quotas.
- Choose between strings, hashes, lists, sets, sorted sets, bitmaps, HyperLogLog, streams, and geo indexes.
- Apply cache-aside, read-through, write-through, and write-behind caching, and invalidate entries safely.
- Build rate limiters, distributed locks with fencing tokens, job queues, delayed jobs, and idempotency keys.
- Configure RDB and AOF persistence, and state how much data each setting can lose.
- Estimate memory per key and per structure, and size an instance with room to grow.
- Work through complete designs, from capacity numbers to failure handling.
Course Content
Chapter 2: The Data Structures Tour
2.1 Strings
2.2 String Counters, Objects, and Locks
2.3 Hashes
2.4 Hash Memory Encoding and Patterns
2.5 Lists
2.6 Sets
2.7 Sorted Sets
2.8 Rankings and Time Indexed Data
2.9 Bitmaps and Daily Active Users
2.10 Feature Flags and Bitfield Counters
2.11 HyperLogLog
2.12 Streams and Geospatial Indexes
2.13 Probabilistic Filters
Chapter 3: Caching Patterns
Chapter 4: Coordination & Traffic Patterns
Chapter 5: Real-Time & Analytics Patterns
5.1 Leaderboards with Sorted Sets
5.2 Leaderboard Features and Sharding
5.3 Pub/Sub for Real-Time Notifications
5.4 Redis Streams and Consumer Groups
5.5 Stream Operations and Messaging Choices
5.6 Geospatial Queries
5.7 Unique Counts and Daily Activity
5.8 Retention Cohorts and Streaks
5.9 News Feed Fan-Out
Chapter 6: Operating Redis at Scale
6.1 RDB Snapshots and the AOF Log
6.2 Loss Windows and Choosing Persistence
6.3 Replication and Read Replicas
6.4 Redis Sentinel and Redis Cluster
6.5 Hash Tags, Resharding, and Choosing a Setup
6.6 Finding Hot Keys and Big Keys
6.7 Fixing Hot Keys and Big Keys
6.8 Memory Estimation
6.9 Failure Scenarios by Pattern
6.10 Failure Stances and Shared Defenses
Chapter 8: Capstone Case Studies
8.1 Design a Rate Limiter
8.2 Rate Limiter Failures and Multiple Regions
8.3 Design a Gaming Leaderboard
8.4 Leaderboard Sharding and Reliability
8.5 Design a News Feed
8.6 Design a Chat System
8.7 Chat Presence, Offline Delivery, and Ordering
8.8 Design Uber Driver Matching
8.9 Matching Flow and Driver Reservations
8.10 Design Flash-Sale Inventory
8.11 Design a URL Shortener at Scale
Chapter 9: Redis for AI Systems
What people say about our courses






About the Author

Arslan Ahmad
Industry Expertise & Leadership
Arslan Ahmad is the lead author of Grokking Redis. As the founder of Design Gurus and a former FAANG hiring manager, he has worked at industry giants like Facebook (now Meta) and Microsoft.
He has conducted hundreds of system design interviews, giving him unique insight into what top tech companies look for in candidates.
The course also incorporates expertise from senior engineers at Google, Meta, Amazon, Microsoft, and Uber, ensuring you learn system design best practices from professionals who have built and scaled real-world systems.
500+
Interviews Conducted
10k+
Students Taught
Related Courses
$197
$48
$48
FAQs
What is Grokking Redis for System Design Interviews?
It is a course on how Redis works and how to use it as a building block in large systems. It starts with why Redis is fast and how each data structure works, then covers caching, coordination, real-time and analytics patterns, persistence, replication, Sentinel and Cluster, decision frameworks, complete designs, and Redis in AI systems.
Who is this course for?
It is for software engineers who know what a database and a cache are but have not studied how Redis works inside. It suits engineers preparing for system design interviews, backend engineers who use Redis mostly as a simple cache, engineers who run Redis in production, and engineers building AI applications.
Do I need experience with Redis?
No. The first chapter explains how Redis stores data and why it is fast, and every later lesson builds on it. You should know basic data structures, Big-O notation, and how a web application uses a database and a cache.
Which version of Redis does the course use?
The course describes Redis Open Source 8, and the core commands in the lessons were run on Redis 8.10 during the review. Where a command or option arrived in a recent version, the lesson names that version, and the lessons point out where Valkey, the open source fork of Redis, behaves differently.
Is the course only about interviews?
No. The body of each lesson teaches Redis itself: the mechanism, the commands, the memory cost, and the ways it fails. Each lesson ends with a short section on how to use the topic in a system design interview, with two likely follow-up questions and their answers.
Do I need to install Redis to follow along?
No, but it helps. The course has no coding environment in the browser. Commands are shown as you would type them in redis-cli, with the reply Redis returns, so you can run them on any Redis 8 server you install or rent.
Which complete designs does the course walk through?
Seven: a rate limiter, a gaming leaderboard, a news feed, a chat system, driver matching for a ride-hailing service, flash-sale inventory, and a URL shortener at scale. Each one starts from requirements and capacity numbers and ends with failure handling.
Does the course cover scaling and failures?
Yes. You learn RDB and AOF persistence and what each setting can lose, replication and replica lag, Sentinel failover, Redis Cluster with hash slots and resharding, hot keys and big keys, memory estimation, and the common failure scenarios with their defenses.
Does the course cover Redis for AI applications?
Yes. The last chapter covers semantic caching of model responses, Redis as a vector store with HNSW and hybrid queries, conversation memory for chat applications, and rate limits and quotas measured in tokens.
How is this different from Grokking the System Design Interview?
Grokking the System Design Interview covers the whole interview and many building blocks. This course goes deep on one building block, Redis, so that you can explain the exact data structure, commands, memory cost, and failure behavior behind each part of a design that uses it.
What does the course not cover?
It is not a reference for every Redis command, and it does not teach the client library of any one programming language. For every option of a command, use the official Redis documentation.
