Reflection — An Honest Take 8 min

Honest Take — Before You Begin

Hot take: most Rails apps do not need MongoDB. They do not need DynamoDB either. PostgreSQL with JSONB covers ninety-five percent of "flexible schema" use cases that people reach for document databases to solve. I have seen teams introduce MongoDB because they had one model with variable attributes, when a JSONB column with a GIN index would have solved it in an afternoon. Adding a second database to your stack is not a technical decision -- it is an operational burden. You now have two things to back up, monitor, tune, and debug at 3 AM.

That said, Redis is essential, and you already know this because you use it every day. Sidekiq queues, fragment caching, session storage, rate limiting -- Redis is everywhere in Rails. But using Redis and understanding Redis are different things. This module teaches you why it is fast (single-threaded event loop, in-memory, optimized data structures), when it breaks (memory exhaustion, persistence tradeoffs between RDB and AOF), and what happens when your Redis goes down (your Sidekiq queues vanish if you chose the wrong persistence mode). Understanding your dependencies means understanding their failure modes.

NoSQL Distilled by Sadalage and Fowler is the right book for this topic. It is short, opinionated, and -- critically -- it tells you when NOT to use NoSQL. Most NoSQL books are thinly disguised advocacy written by people who work at NoSQL companies. Sadalage and Fowler have no horse in the race. They explain aggregate-oriented databases, graph databases, column-family stores, and then honestly assess when a relational database is still the right choice. It usually is. That honesty is rare and valuable.

The real lesson of this module is not "learn five databases." It is "learn to choose." Polyglot persistence means using the right tool for each data pattern, not using every tool because you can.

Learning resources 3

That's the free preview. Sign in to continue this course.

Sign in to continue

New here? Make a desk →