This course is currently under maintenance. We're updating content and labs. Enrollment is paused; check back soon.
AI Instructor Live Labs Included

Caching and Sessions with Redis

Beginner
8h 50m
5 Lessons
SAAS-140

About This Course

Add caching, session storage, rate limiting, and event fan-out to your SaaS backend using Redis a fast in-memory key-value store that sits beside your database and takes the hot read traffic off it. Learn the kv data model from first principles, then apply it to five real SaaS patterns: cache-aside for a slow endpoint, Redis-backed sessions so logins survive a server restart, per-IP and per-user rate limiting, and pub/sub for fire-and-forget events like "user signed up". Every lesson leans on Claude Code you describe what you want, Claude Code writes the code, and the left-hand helper walks you through what came back. By the end of this course you will understand when a SaaS app needs Redis, what each of the five patterns is for, and how to tell Claude Code to add them to your own API.</description><parameter name="shortDescription">Add caching, sessions, rate limiting, and event fan-out to your SaaS backend with Redis five hands-on labs where Claude Code writes the code and you learn when and why each Redis pattern is used.

Course Curriculum

5 Lessons
01
Lab Exercise
Lab Exercise

What Redis is and the kv data model - Lab Exercises

1h 55m 5 Exercises

By the end of this lab you will know what a key-value store is, which Redis data types your SaaS app actually uses (strings, hashes, lists, sets), and how a Node app talks to Redis. You will drive Claude Code to add a /favorites/:userId endpoint that reads a per-user set from Redis, backed by data you seed with redis-cli.

02
Lab Exercise
Lab Exercise

Cache-aside pattern with Redis - Lab Exercises

1h 45m 4 Exercises

By the end of this lab you will understand the cache-aside pattern (read-through cache with explicit writes on miss) and the TTL-based invalidation it depends on. You will direct Claude Code to add caching to Lumen Trail's slow /popular-routes endpoint so repeat callers get sub-millisecond responses while the first caller still pays the real cost, and you will see firsthand what happens when the cache goes cold.

03
Lab Exercise
Lab Exercise

Session storage with Redis - Lab Exercises

1h 40m 4 Exercises

By the end of this lab you will know why in-memory sessions fall apart in production and how to move them to Redis so they survive server restarts and multiple server instances. You will direct Claude Code to migrate Lumen Trail's /login, /me, and /logout endpoints to use Redis-backed sessions with a 7-day TTL, and you will verify the fix by restarting the server mid-session.

04
Lab Exercise
Lab Exercise

Rate limiting with Redis - Lab Exercises

1h 45m 4 Exercises

By the end of this lab you will know how to protect a SaaS API endpoint from abuse using Redis-backed counters. You will implement both the fixed-window and sliding-window patterns, understand the trade-off between them, and return proper 429 Too Many Requests responses with a Retry-After header on the Lumen Trail POST /routes endpoint.

05
Lab Exercise
Lab Exercise

Pub/sub for lightweight events with Redis - Lab Exercises

1h 45m 4 Exercises

By the end of this lab you will know how to decouple slow follow-up work from your HTTP request path using Redis pub/sub. You will refactor Lumen Trail's POST /signup so it publishes a user-signed-up event and returns in under 20 ms, while a separate worker process subscribes to that channel and sends the welcome email and records the analytics asynchronously.

Under Maintenance

This course is currently being updated. Check back soon!

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 5 Hands-on Lessons
Skill Level Beginner
Total Duration 8h 50m