Skip to content

Part V — NoSQL and Caching ​

One chapter on two stores, chosen for how often they appear. Many product codebases have MongoDB. Almost every production service has Redis somewhere.

The chapter compares throughout. A document store is worth knowing for itself. Explaining what it gives up is also how you show that you understand the relational model.

Chapters ​

#ChapterWhat it answers
01Choosing a Non-Relational Store: Documents and RedisWhat does the document model buy, which Redis structure fits, and when is Postgres still the answer?

Aggregation pipelines and shard-key mechanics are left out on purpose. The first is a MongoDB specialist's skill. The second belongs one level up, to Choosing a Datastore and Replicating It and Sharding and Transactions at Scale, where they are decisions rather than commands.

What Interviewers Probe For ​

  • Embed or reference. The answer must come from the access pattern and the growth bound, not from an entity diagram. The 16 MB document limit turns "unbounded" into a hard constraint.
  • What is atomic. A single document, always. Anything wider needs an explicit transaction, and needing them routinely is a modelling signal.
  • Pub/Sub against Streams. One loses messages by design. The other does not. Choosing the wrong one for a job queue is a common mistake.
  • Whether Redis is a system of record. It is not, and being clear about that matters more than knowing its commands.

Reading Order ​

One chapter, and it is in the interview sprint. The embed-or-reference judgement and the choice of Redis structure are the two that come up most.

The whole book, free to read. Generated from the manuscript on every change.

Your progress

Tick each chapter in the sidebar once you have read and understood it. Your name and email keep the ticks on any device.

Your name and email are stored to save your progress. Nothing else is done with them.