Redis

In-memory data structures for caching and queues.

Redis is taught here in 14 lessons, running from Data types and the commands that matter through to Next steps: Redis Stack, modules and choosing a store. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackDatabases
Lessons14
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: MongoDB

Lessons

  1. Data types and the commands that matterStrings, lists, hashes, sets and sorted sets — what each one is for, and why the O(N) commands are a production hazard.
  2. Expiry and caching patternsTTL mechanics, eviction policies, cache-aside in practice, and how to stop a cold cache from taking down the database behind it.
  3. Pub/sub, queues and persistenceFire-and-forget messaging versus durable streams, reliable queue patterns with lists, and the real durability guarantees of RDB and AOF.
  4. Installing Redis, redis-cli and RESP basicsServer and Redis Stack options, the redis-cli commands worth memorising, the RESP protocol, SCAN instead of KEYS, and reading INFO.
  5. Key design, memory and evictionNaming conventions that scale, per-key memory accounting, finding big keys, and choosing a maxmemory policy that will not surprise you.
  6. Transactions, Lua scripting and atomicityMULTI and EXEC, WATCH for optimistic locking, EVAL with correct KEYS usage, Redis Functions, and the patterns that need real atomicity.
  7. Streams and reliable queue processingXADD and XREADGROUP, consumer groups, pending entries, XAUTOCLAIM for stalled messages, trimming and choosing between lists and streams.
  8. Distributed locks and rate limitingCorrect SET NX PX locks, the token that makes release safe, the real caveats of Redlock, and token bucket and sliding-window limiters.
  9. Everyday patterns: sessions, leaderboards and countersSession storage with sliding expiry, sorted-set leaderboards with ties and time decay, atomic counters, HyperLogLog cardinality and set membership.
  10. Security: ACLs, TLS and hardeningACL users with key and command patterns, TLS configuration, disabling dangerous commands, protected mode, and network isolation.
  11. Performance, pipelining and monitoringPipelining and batching, latency diagnosis, SLOWLOG, client-side caching, hot keys, fork stalls and the metrics worth alerting on.
  12. Replication, Sentinel and high availabilitySetting up replicas, measuring replication lag, Sentinel quorum and failover, persistence trade-offs and an executable upgrade plan.
  13. Clustering and client libraries in applicationsHash slots, slot-aware clients, multi-key limits and hash tags, resharding, connection pooling, retries and idempotency.
  14. Next steps: Redis Stack, modules and choosing a storeJSON documents, search, time series and probabilistic types, plus an honest test for when Redis is the wrong tool and where to read next.

More in Databases

SQL MySQL PostgreSQL MongoDB SQLite

FAQ

How long does the Redis course take?
It has 14 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for Redis?
Not strictly. It helps to have read MongoDB first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after Redis?
Continue with SQLite (14 lessons), the next course in Databases.