Redis Course
Redis Mastery: from in-memory data structures to high-performance distributed systems — caching, clustering, Spring Boot & staff-level architecture.
Enterprise learning path
Phase 1 · Redis Fundamentals
- 1Redis HomeNext up
Welcome to Redis Mastery — a practical course for backend engineers who need Redis in production, not just for local caching demos.
- 2What is Redis?
Redis (Remote Dictionary Server) is an open-source, in-memory data structure store.
- 3Why Redis is Fast
Redis routinely handles 100K–1M+ operations per second on modest hardware.
- 4Redis Architecture
Redis is not a black box that magically returns strings.
- 5Installing Redis
You can run Redis in Docker for local dev, Homebrew on macOS, or managed services (ElastiCache, Azure Cache, Redis Cloud) in production.
- 6Redis CLI
redis-cli is the first tool on every production incident.
- 7Redis Data Types Overview
Redis is not a dumb string cache.
Phase 2 · Core Data Structures
- 8Strings
Strings are Redis's simplest and most-used type — binary-safe blobs up to 512MB.
- 9Lists
Redis lists are doubly-linked lists of strings — ideal for queues, recent-activity feeds, and lightweight job buffers when you do not need Kafka's durability guarantees.
- 10Sets
Sets store unique unordered strings — O(1) SADD and SISMEMBER make them perfect for tags, unique visitors, permission roles, and graph adjacency lists.
- 11Sorted Sets
Sorted sets (ZSET) combine a unique member with a double score — Redis maintains skip-list + hash index for O(log N) rank, range, and score queries.
- 12Hashes
Hashes map field names to string values under one key — the natural fit for session objects, user profiles, and shopping cart lines where you update individual fields without re…
- 13Bitmaps
Redis bitmaps are bit arrays implemented on string values — SETBIT and GETBIT treat a string as 2^32 bits.
- 14HyperLogLog
HyperLogLog (HLL) estimates unique cardinality in fixed ~12KB with ~0.81% standard error — PFADD and PFCOUNT replace SET-based UV tracking that would consume gigabytes.
- 15Geospatial Data
Redis geospatial commands (GEOADD, GEORADIUS, GEOSEARCH) store lat/lon as sorted-set members scored by geohash — Uber-style driver dispatch queries nearby entities in millisecon…
Phase 3 · Advanced Redis
- 16Expiration & TTL
TTL (time-to-live) is non-negotiable for cache keys — without EX/PX every SET lives forever until manual DELETE or OOM.
- 17Transactions
Redis transactions batch commands with MULTI/EXEC — all queued commands run sequentially without interleaving from other clients.
- 18Lua Scripting
Lua scripts run atomically on the Redis server — read, branch, and write in one execution without other commands interleaving.
- 19Pub/Sub
Redis Pub/Sub is fire-and-forget messaging — PUBLISH delivers to all subscribers currently connected; no persistence, no ack, no replay.
- 20Streams
Streams are append-only logs with auto IDs — XADD appends events; consumer groups (XREADGROUP) track progress like lightweight Kafka inside Redis.
- 21Pipelines
Pipelining sends multiple commands without waiting for each reply — one round trip for hundreds of GETs instead of hundreds of RTTs.
- 22Optimistic Locking
Optimistic locking with WATCH detects concurrent modifications before MULTI/EXEC commits — read version, queue updates, abort if another client changed the key.
- 23Distributed Locks
Distributed locks coordinate cron jobs, inventory holds, and idempotent workers across pods — SET key unique-token NX EX ttl is the foundation.
Phase 4 · Persistence & HA
- 24RDB Snapshots
RDB persistence writes a compact binary point-in-time snapshot (dump.rdb) — fast restarts and efficient backups at the cost of losing writes since last snapshot.
- 25AOF Persistence
Append-Only File (AOF) logs every write command — on restart Redis replays the log to rebuild state.
- 26Replication
Replication streams writes from master to one or more replicas — read scaling and failover candidates.
- 27Sentinel
Redis Sentinel monitors masters and replicas, performs automatic failover, and publishes new master address to clients — manual promotion takes minutes; Sentinel targets sub-min…
- 28Redis Cluster
Redis Cluster shards data across masters using 16384 hash slots — CRC16(key) mod 16384 assigns each key to a slot owned by one master.
- 29Sharding
Sharding splits data across Redis instances when one server is insufficient — options include Redis Cluster (native slots), client-side consistent hashing (Jedis/Lettuce legacy)…
- 30Backup & Recovery
Untested backups are Schrödinger's disaster recovery — RDB snapshots, AOF files, and managed cloud snapshots each need quarterly restore drills verifying key counts and applicat…
Phase 5 · Spring Boot Integration
- 31Spring Data Redis
Spring Boot 3 auto-configures Lettuce connection factory, RedisTemplate, and cache abstraction when spring.data.redis.* properties are set — standardizing serialization, pooling…
- 32RedisTemplate
RedisTemplate is the central Spring API — opsForValue, opsForHash, opsForZSet wrap Redis commands with serialization hooks.
- 33Caching with @Cacheable
@Cacheable moves cache-aside boilerplate into declarative annotations — Spring Cache abstraction backed by RedisCacheManager stores method results keyed by SpEL expression.
- 34Session Management
Spring Session with Redis stores HTTP sessions in hashes — pods stay stateless behind load balancers without sticky sessions.
- 35Rate Limiting
Shared Redis counters enforce API rate limits across all pods — without central store each instance allows full quota and attackers multiply allowance by replica count.
- 36Distributed Cache Architecture
Production caching is L1 (Caffeine in-process) + L2 (Redis cluster) with explicit invalidation, TTL jitter, and stampede protection — Amazon catalog pattern.
Phase 6 · Production Engineering
- 37Performance Tuning
Redis performance tuning starts with pipelining, connection pooling, right-sized values, and eliminating slow commands — not buying bigger hardware first.
- 38Memory Optimization
Redis memory is your primary bill and failure mode — maxmemory triggers eviction or OOM.
- 39Monitoring Redis
Redis exposes 100+ INFO fields — focus on used_memory, evicted_keys, instantaneous_ops_per_sec, connected_clients, master_repl_offset lag, and latest_fork_usec.
- 40Troubleshooting Redis
Ninety percent of Redis incidents fall into eight buckets: OOM/eviction, hot keys, slow commands, replication lag, stampede, penetration, avalanche, and fragmentation.
- 41Redis System Design
System design interviews and real ADRs map requirements to Redis structures and topology — URL shortener (INCR + string), rate limiter (Lua/ZSET), cart (hash), leaderboard (ZSET…
- 42Redis Interview Masterclass
Interactive Redis interview masterclass with 500+ searchable questions, model answers, follow-ups, and Staff Engineer scenarios.