Course · 6 lessons ~35 hr Intermediate

NoSQL & Polyglot Persistence

NoSQL & Polyglot Persistence covers: NoSQL Distilled, Redis 4.x Cookbook, MongoDB — The Definitive Guide. Understand when and why to use non-relational databases alongside PostgreSQL. Master Redis (you already use it) and MongoDB (you should understand it), and develop a framework for choosing the right database for each use case. When to use Redis: caching (Rails.cache with redis_cache_store), sessions (session_store :redis_store), background jobs (Sidekiq), real-time features (Action Cable pub/sub), rate limiting. When to stay on PostgreSQL: everything else. Why most Rails apps do not need MongoDB: PostgreSQL's JSONB gives you document-style flexibility with relational guarantees. You can jsonb_path_query, GIN-index JSONB fields, and still JOIN with relational tables. The Turbo/Hotwire stack uses Redis for Action Cable pub/sub. Understanding Redis data structures (not just "it's a cache") lets you build features that would be painful with only PostgreSQL: leaderboards with ZRANGEBYSCORE, rate limiting with INCR + EXPIRE, unique visitor counting with PFADD (HyperLogLog).

reading · we frame, you read MIT or the canonical taught · we author, no canonical fits ↺ spirals back to earlier lessons
Course locked

Complete Database Internals first.

This course unlocks once you've finished its prerequisite. Open prerequisite →

6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.