📦

NoSQL & Document Modelling

Designing schemas for systems that were built to bend.

Part 1

Boxes, Not Shelving: An Introduction to Document Modelling

why a moving company packs an irregular household into flexible boxes rather than forcing everything onto rigid, pre-sized shelving units, and how document databases embrace that same flexibility.

Part 2

One Box, Everything It Needs: Documents and Embedding

why a mover packs a lamp together with its shade and cord in one single box rather than scattering the pieces across separate containers, and how embedding keeps related document data together.

Part 3

Taping a Note to the Box Instead: Referencing vs. Embedding

why a mover sometimes tapes a note pointing to a separate box rather than packing everything into one, and how referencing handles the cases where embedding genuinely stops making sense.

Part 4

Packing for How You'll Unpack: Designing for Query Patterns, Not Just Storage

why a smart mover packs boxes based on which room they're headed to, not just what fits together neatly, and why document modeling has to start from real query patterns, not storage convenience.

Part 5

The Truck Doesn't Care What's Inside: Schema Flexibility and Polymorphic Documents

why a moving truck happily carries lamps, bookshelves, and kitchen appliances side by side without needing them to share a common shape, and how polymorphic documents embrace this same variety within one collection.

Part 6

Two Boxes, Same Label, Different Contents: Schema Versioning in a Schemaless World

why a moving company's label conventions inevitably change over years of operation, leaving older and newer boxes labeled differently side by side, and how document databases handle this same schema drift.

Part 7

Not Every Box Fits Under the Bed: Document Size Limits and When to Split

why a mover can't just keep piling items into one box indefinitely and expect it to remain liftable, and why every document database has a genuine, practical limit on how large a single document can grow.

Part 8

The Moving Crew's Manifest: Collections and Indexes

why a moving company organizes boxes into labeled groups and keeps a fast-lookup manifest rather than searching the whole warehouse box by box, and how collections and indexes serve this same purpose.

Part 9

When One Box Needs a Whole Other Truck: Cross-Collection References

why a single household's move sometimes genuinely requires coordinating with an entirely separate storage facility, and how cross-collection references handle relationships that span beyond one group of boxes.

Part 10

A Copy in Every Room: Denormalization as the Default, Not the Exception

why a moving company routinely keeps a duplicate copy of a shared inventory list in every relevant box rather than treating that redundancy as a mistake, and why denormalization is the norm in document design.

Part 11

The Address Label Problem: Choosing a Good Document ID

why a moving company's choice of address labeling scheme quietly shapes how efficiently the whole warehouse actually operates, and how a document's ID choice carries this same outsized, easy-to-overlook impact.

Part 12

When the Move Outgrows One Truck: Sharding and Horizontal Scaling

why a moving company handling a massive relocation eventually needs several trucks running in parallel rather than one impossibly large one, and how sharding scales a document database the same way.

Part 13

The Simplest Box of All: Key-Value Stores

why a moving company sometimes just needs a coat check ticket and a corresponding item, nothing more elaborate, and how key-value stores serve this same stripped-down, extremely fast lookup need.

Part 14

Shelving With Flexible Drawers: Wide-Column Stores

why some moving company storage units use rows of drawers where each row can genuinely have a different number of compartments, and how wide-column stores apply this same flexible-but-structured pattern.

Part 15

Consistency on Moving Day: Eventual Consistency and the CAP Theorem

why a moving company with several regional offices sometimes can't guarantee every office has the exact same up-to-the-second information, and what the CAP theorem says is genuinely unavoidable about that tradeoff.

Part 16

Searching Every Box in the Warehouse: Secondary Indexes and Query Limitations

why a moving company's fast lookup by box number doesn't automatically help find every box containing a specific item, and how secondary indexes and their real limitations shape what a document database can query well.

Part 17

Choosing the Right Mover: Document, Key-Value, Wide-Column, or Graph

why a logistics coordinator matches each genuinely different kind of move to the moving company actually best suited for it, and how to choose deliberately among document, key-value, wide-column, and graph databases.

Part 18

Reading the Boxes Before You Pack Them: AI-Assisted Schema Inference

why a new inventory system can scan a warehouse full of inconsistently packed boxes and propose a sensible, unifying packing standard on its own, and how AI-assisted schema inference works for document collections.

Part 19

When the Crew Takes Requests in Plain English: AI Agents Querying Document Stores

why a moving crew increasingly needs to handle plain-language requests directly rather than only formal, structured work orders, and what this means for how document databases actually need to be organized.

Part 20

One Moving Company, Every Kind of Move

the boxes and the shelving, the manifest and the labels, every article's lesson reassembled into one moving company capable of handling every kind of move the moment genuinely calls for.