Chapter 33 — Exercises

Mostly judgment/analysis exercises (this is a survey chapter). (answer in Appendix) = worked solution in Answers. ⭐ = stretch.


Group A — The families

33.1 Match each to its family (document/key-value/column-family/graph): MongoDB, Redis, Cassandra, Neo4j. What is each best at? (answer in Appendix)

33.2 Why did NoSQL emerge? Name three things relational databases of the era made hard.

33.3 What trade-offs do NoSQL systems generally make (consistency, queries, schema)? (answer in Appendix)


Group B — When PostgreSQL suffices (theme #4)

33.4 For each "we need NoSQL" claim, say whether PostgreSQL likely covers it and how: (a) flexible product attributes; (b) full-text search; (c) a session cache with sub-ms reads; (d) category hierarchy traversal. (answer in Appendix)

33.5 Why is choosing MongoDB for deeply relational data (e.g., orders↔customers↔products) usually a mistake? (Recall Chapter 1's Lumen.)

33.6 ⭐ When is Redis a good complement to PostgreSQL rather than a replacement?


Group C — When NoSQL wins

33.7 Give a workload where each genuinely wins: a graph database; Cassandra; Redis. (answer in Appendix)

33.8 Why do graph databases beat relational joins for deep multi-hop traversal, while joins handle moderate relationships fine?

33.9 ⭐ "Eventual consistency" — give one application where it's fine and one where it's unacceptable.


Group D — Judgment

33.10 A team wants to add MongoDB "because our data is JSON from an API." Write a short response grounded in this chapter and Chapter 16. (answer in Appendix)

33.11 ⭐ What is "polyglot persistence," and what's the hidden cost of too much of it?


Group E — Progressive project

33.12 Identify any part of your domain that might fit a NoSQL family; decide whether PostgreSQL already covers it, and justify.

33.13 ⭐ Describe one scenario (real or hypothetical) where your domain would genuinely benefit from a specific NoSQL family.


Self-check. If you can name what each family is for, judge when PostgreSQL covers a "NoSQL" need, and recognize the genuine cases for each — you have the judgment this part is about. Next: databases for analytics.