CH 02 / Architecture Designing for document-shape data
04 / 12
Four principles

How a cluster stays calm under load.

  1. Document shape follows access pattern.

    Model what you query together, not what you store separately — a single orders document beats four joins.

  2. Shard on the key reads love.

    Pick a shard key that fans writes wide and keeps a single user's reads on a single shard, every time.

  3. Replicate for survival, not speed.

    Three-node replica sets give automatic failover in under ten seconds without a pager firing for any of us.

  4. Indexes earn their footprint.

    Keep the working set in memory; every index that doesn't serve a hot query gets dropped at the next review.