redis

    Redis Course

    Redis Mastery: from in-memory data structures to high-performance distributed systems — caching, clustering, Spring Boot & staff-level architecture.

    42
    Lessons
    6
    Modules
    0/42
    Completed
    Curriculum

    Enterprise learning path

    6 modules · 42 lessons

    Phase 1 · Redis Fundamentals

    0/7 complete
    1. 1
      Redis Home
      Next up

      Welcome to Redis Mastery — a practical course for backend engineers who need Redis in production, not just for local caching demos.

    2. 2
      What is Redis?

      Redis (Remote Dictionary Server) is an open-source, in-memory data structure store.

    3. 3
      Why Redis is Fast

      Redis routinely handles 100K–1M+ operations per second on modest hardware.

    4. 4
      Redis Architecture

      Redis is not a black box that magically returns strings.

    5. 5
      Installing Redis

      You can run Redis in Docker for local dev, Homebrew on macOS, or managed services (ElastiCache, Azure Cache, Redis Cloud) in production.

    6. 6
      Redis CLI

      redis-cli is the first tool on every production incident.

    7. 7
      Redis Data Types Overview

      Redis is not a dumb string cache.

    Phase 2 · Core Data Structures

    0/8 complete
    1. 8
      Strings

      Strings are Redis's simplest and most-used type — binary-safe blobs up to 512MB.

    2. 9
      Lists

      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.

    3. 10
      Sets

      Sets store unique unordered strings — O(1) SADD and SISMEMBER make them perfect for tags, unique visitors, permission roles, and graph adjacency lists.

    4. 11
      Sorted 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.

    5. 12
      Hashes

      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…

    6. 13
      Bitmaps

      Redis bitmaps are bit arrays implemented on string values — SETBIT and GETBIT treat a string as 2^32 bits.

    7. 14
      HyperLogLog

      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.

    8. 15
      Geospatial 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

    0/8 complete
    1. 16
      Expiration & TTL

      TTL (time-to-live) is non-negotiable for cache keys — without EX/PX every SET lives forever until manual DELETE or OOM.

    2. 17
      Transactions

      Redis transactions batch commands with MULTI/EXEC — all queued commands run sequentially without interleaving from other clients.

    3. 18
      Lua Scripting

      Lua scripts run atomically on the Redis server — read, branch, and write in one execution without other commands interleaving.

    4. 19
      Pub/Sub

      Redis Pub/Sub is fire-and-forget messaging — PUBLISH delivers to all subscribers currently connected; no persistence, no ack, no replay.

    5. 20
      Streams

      Streams are append-only logs with auto IDs — XADD appends events; consumer groups (XREADGROUP) track progress like lightweight Kafka inside Redis.

    6. 21
      Pipelines

      Pipelining sends multiple commands without waiting for each reply — one round trip for hundreds of GETs instead of hundreds of RTTs.

    7. 22
      Optimistic Locking

      Optimistic locking with WATCH detects concurrent modifications before MULTI/EXEC commits — read version, queue updates, abort if another client changed the key.

    8. 23
      Distributed 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

    0/7 complete
    1. 24
      RDB 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.

    2. 25
      AOF Persistence

      Append-Only File (AOF) logs every write command — on restart Redis replays the log to rebuild state.

    3. 26
      Replication

      Replication streams writes from master to one or more replicas — read scaling and failover candidates.

    4. 27
      Sentinel

      Redis Sentinel monitors masters and replicas, performs automatic failover, and publishes new master address to clients — manual promotion takes minutes; Sentinel targets sub-min…

    5. 28
      Redis 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.

    6. 29
      Sharding

      Sharding splits data across Redis instances when one server is insufficient — options include Redis Cluster (native slots), client-side consistent hashing (Jedis/Lettuce legacy)…

    7. 30
      Backup & 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

    0/6 complete
    1. 31
      Spring Data Redis

      Spring Boot 3 auto-configures Lettuce connection factory, RedisTemplate, and cache abstraction when spring.data.redis.* properties are set — standardizing serialization, pooling…

    2. 32
      RedisTemplate

      RedisTemplate is the central Spring API — opsForValue, opsForHash, opsForZSet wrap Redis commands with serialization hooks.

    3. 33
      Caching with @Cacheable

      @Cacheable moves cache-aside boilerplate into declarative annotations — Spring Cache abstraction backed by RedisCacheManager stores method results keyed by SpEL expression.

    4. 34
      Session Management

      Spring Session with Redis stores HTTP sessions in hashes — pods stay stateless behind load balancers without sticky sessions.

    5. 35
      Rate 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.

    6. 36
      Distributed 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

    0/6 complete
    1. 37
      Performance Tuning

      Redis performance tuning starts with pipelining, connection pooling, right-sized values, and eliminating slow commands — not buying bigger hardware first.

    2. 38
      Memory Optimization

      Redis memory is your primary bill and failure mode — maxmemory triggers eviction or OOM.

    3. 39
      Monitoring 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.

    4. 40
      Troubleshooting Redis

      Ninety percent of Redis incidents fall into eight buckets: OOM/eviction, hot keys, slow commands, replication lag, stampede, penetration, avalanche, and fragmentation.

    5. 41
      Redis 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…

    6. 42
      Redis Interview Masterclass

      Interactive Redis interview masterclass with 500+ searchable questions, model answers, follow-ups, and Staff Engineer scenarios.