Module 17: Beyond one database

What changes at scale: replication, partitioning and sharding, CAP, and when to pick NoSQL over SQL.

  1. Replication and backups: Replicas keep you running when a server dies; backups with point-in-time recovery save you from bad queries. RPO = data you can lose, RTO = time you can be down.
  2. Partitioning and sharding: Partitioning splits a table on one server (RANGE, LIST, HASH; TO is exclusive); sharding splits rows across servers by a shard key.
  3. SQL vs NoSQL, CAP and JSONB: Relational for related data and transactions, NoSQL families for one job at scale; CAP is C or A during a partition; JSONB gives Postgres documents (- JSON, - text, @ contains).

Ends with a 12-question checkpoint (80% passes) and a project: Partition the orders table.