Courses / Professional engineering / Redis & Caching

₹69Self-paced

Redis & Caching

Add Redis caching to a service with sensible keys and expiry, invalidation, atomic guards, rate limits and safe fallbacks.

  • Who it's for. Developers who know REST APIs and SQL and want to make reads faster without serving wrong data.
  • Before you start. Courses: REST API Design, SQL and Database Foundations.
  • 27 to 45 hours of study with practice
  • 8 modules, 48 lessons
  • 3 guided projects and a final project

What you'll learn

  • Estimate, measure and honestly report what a cache saves (latency and origin load) and what it costs (staleness, memory, extra failure modes).
  • Design key names, value encodings and expiry policy so cached entries are findable, versioned and bounded in time.
  • Implement cache-aside reads including negative caching, TTL jitter and single-flight protection against stampedes.
  • Invalidate cached data on writes, reason about read/write races that resurrect stale values, and test staleness bounds.
  • Use Redis single-command atomicity, SET NX, MULTI/EXEC with WATCH, and Lua scripts to remove check-then-act races.

Skills you'll gain

  • Cache purpose
  • costs
  • Keys types
  • expiry
  • Cache-aside behavior
  • Invalidation
  • consistency
  • Atomic operations
  • Rate limiting boundaries
  • Failure
  • fallback
  • Cache integration project

Tools you'll use

  • Redis Open Source
  • redis-cli
  • Docker
  • Python
  • redis-py
  • pytest
  • sqlite3

Details to know

  • Certificate on completionIssued after your final project is reviewed
  • 8 module checkpointsA quiz and a practical task close each module
  • Self-pacedStudy any time; your progress is saved

How every lesson works

Each lesson follows the same four steps, so you always know what comes next.

  1. 01

    Watch & Learn

    A short animated video explains one idea at a time.

  2. 02

    Guided Practice

    Work through an example step by step and check the result.

  3. 03

    Quiz & Challenge

    Short questions check the idea has landed before you move on.

  4. 04

    Mini Project

    Build something useful from a project brief.

Learn at your own pace

This is a self-paced course. There are no live classes and no fixed timetable.

  • Start any timeStudy when it suits you. Lessons are short, so they fit around work or college.
  • Pick up where you left offYour progress is saved to your account.
  • Ask when you're stuckUse Ask Mentor inside the learning platform.

Your path in 4 phases

Each phase ends with something you have built and checked.

  1. 01

    Modules 1 to 2

    Cache economics and key design workbook

    Covers Cache purpose and costs and Keys types and expiry.

    You build: Guided project: Loopback-only lab setup note with version and licence statement, latency model, hit-ratio probe, staleness register, memory-pressure test and cold/warm benchmark.

  2. 02

    Modules 3 to 4

    Cache-aside read path with invalidation tests

    Covers Cache-aside behavior and Invalidation and consistency.

    You build: Guided project: Cache-aside read layer with negative caching, canonical list keys, jittered TTLs, single-flight loader and a written write-strategy decision.

  3. 03

    Modules 5 to 6

    Atomic guards and rate limiters

    Covers Atomic operations and Rate limiting boundaries.

    You build: Guided project: Race demonstrations and fixes: INCR sequence numbers, SET NX idempotency guard, MULTI/EXEC transcripts, WATCH and Lua reservations under 20 threads, fenced lock.

  4. 04

    Modules 7 to 8

    Final project and assessment

    Covers Failure and fallback and Cache integration project, then the final project: Cache-enabled service with measured correctness and invalidation tests.

    You build: Final project, one of: Equipment-loan desk service: catalogue reads, loan creation with idempotency and per-user limiting / Event-listing service: listings, ticket-count reads, booking with idempotency and per-IP limiting / Timetable-and-alerts service: route reads.

Full curriculum

8 modules and 48 lessons, 27 to 45 hours of study

01Cache purpose and costs6 lessons, 3 to 4 hours

Lessons

  • Starting a throwaway Redis and reading its version and licence
  • Expected latency as a function of hit ratio
  • Measuring hit ratio from INFO keyspace counters
  • Staleness budgets and what is safe to cache
  • Memory limits and eviction policy choice
  • Benchmarking a cache without fooling yourself

After this module you can

  • Start a local Redis container bound to 127.0.0.1, confirm it answers PING, read redis_version from INFO server, and state which licence options apply to Redis 8 and to 7.4.
  • Compute mean request latency from hit time, origin time and hit ratio, and solve for the hit ratio needed to meet a latency target.
  • Run a skewed read workload against an origin with and without a cache and report cold-start, warm p50 and p95 latency together with the measured hit ratio.
02Keys types and expiry7 lessons, 3 to 5 hours

Lessons

  • Namespaced, versioned key names and SCAN instead of KEYS
  • Strings as serialized cache values with a schema version
  • Hashes for cached records read and updated by field
  • Sorted sets for cached top-N lists and atomic snapshot swaps
  • TTL values, -1 and -2, and what overwrites an expiry
  • EXPIRE conditions NX, XX, GT and LT and sliding expiry
  • How Redis really removes expired keys

After this module you can

  • Design a key scheme app:version:entity:id, explain why a value-format change bumps the version segment, and count keys in one namespace using a SCAN loop with MATCH and COUNT.
  • Store a record as a JSON string with an embedded schema version, read many entries with MGET preserving order and nil for misses, and treat unreadable or old-version payloads as cache misses.
  • Explain passive and active expiry, why a key may linger in memory past its TTL while being unreadable, and why expiry deadlines are absolute timestamps.
03Cache-aside behavior6 lessons, 3 to 4 hours

Lessons

  • The cache-aside read path step by step
  • Negative caching of not-found results
  • Cache keys for parameterised queries
  • TTL jitter to avoid synchronised expiry
  • Stampede protection with a single-flight lock
  • Choosing write strategies: cache-aside, write-through, write-around and write-behind

After this module you can

  • Implement get_item(id) that checks Redis first, loads from the origin on a miss, writes the result with a TTL, and returns the same value on both paths.
  • Cache a not-found answer with a short TTL using a sentinel the codec can distinguish from a real value, and show repeated requests for a missing id stop reaching the origin.
  • Compare four write strategies by the failure each introduces and pick one for a described workload, justifying the choice with the staleness budget and failure behaviour.
04Invalidation and consistency6 lessons, 3 to 4 hours

Lessons

  • Delete on write instead of updating the cached copy
  • The read/write race that resurrects stale data
  • Generation counters for invalidating a group of keys
  • Tracking dependent keys with index sets
  • Propagating invalidation to other processes with Pub/Sub and tracking
  • Testing the staleness bound with a stale-read detector

After this module you can

  • Implement an update path that commits the origin change first and then deletes the cache key, and explain why deleting is safer than writing a recomputed value into the cache.
  • Reproduce, with a deterministic interleaving, how a slow reader can write an old value into the cache after a writer deleted it, and apply a mitigation that bounds the damage.
  • Write a test harness that stamps values with versions, runs reads and writes concurrently, and reports the maximum observed staleness and any read older than the allowed bound.
05Atomic operations6 lessons, 3 to 4 hours

Lessons

  • Single-command atomicity and the lost-update race
  • SET with NX for create-if-absent and idempotency keys
  • MULTI and EXEC: what a transaction guarantees and what it does not
  • WATCH and optimistic locking with a retry loop
  • Lua scripts for compare-and-act in one step
  • Lock limits: leases, expiry during work, and fencing tokens

After this module you can

  • Show that GET then SET loses updates under concurrency while INCR does not, and explain why a single Redis command is not interleaved with another client's command.
  • Use SET key value NX EX to claim an operation exactly once, interpret OK versus nil, and make a retried request return the original result instead of repeating the effect.
  • Explain when a SET NX PX lock fails to give mutual exclusion, and design a fencing check that rejects a write from a holder whose lease expired.
06Rate limiting boundaries6 lessons, 3 to 4 hours

Lessons

  • Fixed-window counter with INCR and EXPIRE
  • The window-edge burst problem
  • Atomic window setup: avoiding a counter that never expires
  • Sliding-window log with a sorted set
  • Token bucket with server-side time
  • Limiter keys, 429 responses and Retry-After

After this module you can

  • Implement allow(client, limit, window_seconds) with a per-window key, INCR and an expiry, and return allowed or denied together with the remaining count.
  • Show with injected time that a fixed-window limiter admits up to twice its limit in a short interval straddling a window boundary, and compute that worst case.
  • Choose the identity a limiter counts (user, API key, IP, route), return HTTP 429 with a Retry-After header derived from the limiter, and avoid trusting a spoofable client address.
07Failure and fallback6 lessons, 3 to 4 hours

Lessons

  • Timeouts: treating Redis errors as cache misses
  • Circuit breaker and origin protection when Redis fails
  • Restarts, empty caches and warm-up
  • Memory pressure: noeviction errors and eviction side effects
  • Observability: the numbers that tell you a cache is healthy
  • Fail-open or fail-closed: choosing per feature

After this module you can

  • Configure connect and read timeouts on the client, catch connection and timeout errors around cache calls, and fall back to the origin so the request still succeeds within a time bound.
  • Stop calling an unhealthy Redis after repeated failures, probe it periodically, and cap concurrent origin calls so a Redis outage does not turn into an origin outage.
  • Decide and test the behaviour of a rate limiter, an idempotency guard, a cache read and a lock when Redis is unavailable, and justify each as fail-open or fail-closed.
08Cache integration project5 lessons, 2 to 4 hours

Lessons

  • Project contract, data model and baseline measurement
  • Cache-aside reads with measured hit behaviour
  • Invalidation on writes with a stale-read test
  • Rate limits and failure behaviour wired into the service
  • Evidence pack, runbook and trainer-reviewed demonstration

After this module you can

  • Write the service contract (endpoints, status codes, staleness budgets, targets) and measure the uncached baseline latency and origin load before any cache code exists.
  • Add cache-aside reads, negative caching, canonical list keys, jittered TTLs and single-flight to the read endpoints, with tests that count origin calls.
  • Assemble the measured evidence (before and after numbers, staleness table, failure matrix), write a short runbook, and prepare a scripted demonstration that a trainer can run from a clean checkout.

What you'll build

3 guided projects along the way, then a final project.

  • Cache economics and key design workbook

    after module 2
  • Cache-aside read path with invalidation tests

    after module 4
  • Atomic guards and rate limiters

    after module 6

Final project

Cache-enabled service with measured correctness and invalidation tests.

What you submit

Source submission: complete code for a small HTTP service backed by a SQL database (sqlite3 is acceptable) plus Redis, with tests, in a repository the trainer can clone.

How it's reviewed

Trainer-reviewed demonstration, scored on: Measured benefit: Baseline and cached results under the same seed with honest limitations Correctness under change: Invalidation tests and detector results, mutations caught.

Where you'll use it

  • Cache a slow catalogue read and invalidate it when the item changes.
  • Limit requests per user and keep the service working when Redis is down.

Roles that use these skills

  • Backend Developer
  • Software Engineer
  • Site Reliability Engineer

Earn the certificate by building, not watching

  1. Complete the lessons and pass each module checkpoint.
  2. Build your final project and demonstrate it.
  3. OUTLEARN reviews your project and issues your certificate. It is not issued automatically.

Frequently asked questions

What do I need before starting?

Prerequisite courses: REST API Design (HTTP verbs, status codes, resource representations) and SQL and Database Foundations (reading and writing rows through SQL, transactions, persistence). Diagnostic check before module 1: (1) given a GET /items/7 endpoint, state which status code a missing item returns and which header could carry a retry delay; (2) write a SELECT that fetches one row by primary key and say what an index on that column changes.

When do I get a certificate?

We do not issue certificates until you successfully build and demonstrate your live project. Staff issue certificates after review; nothing is issued automatically.

Be first in when Redis & Caching opens

Email us and we will tell you as soon as enrolment opens.

Notify me when it opens
₹69Opens soon
Notify me