Skip to main content
Cachingchapter 6 of 8 · 4 lessons

Redis Deep Dive

In-memory data structure store powering caches, queues, leaderboards, and pub/sub.

You have been saying Redis for four chapters without looking inside it. It has been the box in the diagram that holds the copy.

Open it, because the answers to several interview questions are in there. Why a single-threaded program is faster than one using all your cores. What happens to your data when the process restarts, and why most caches deliberately choose to lose it. And what you do on the day one Redis is no longer enough, which is a different question from what you do when one database is no longer enough.

Lessons

4 in this chapter
  1. Why Redis Is FastMemory-only data, one thread, no locks, and an event loop that never waits.3 min
  2. Data Structures Beyond StringsLists, sets, hashes, and sorted sets replace application code with one server-side command.3 min
  3. Persistence: RDB and AOFSnapshots are compact but lossy, the append-only file is durable but heavier, and many caches rightly use neither.3 min
  4. Replication, Sentinel, and ClusterReplicas add read capacity and failover; Cluster shards the keyspace when one box is not enough.3 min