System design

Stage 2 of 7 · 10 lessons · ~2 months

Data storage, partitioning and replication

Where data lives and how it is modelled, indexed, split and copied across machines. Most scaling problems end up here, so give this stage the most care.

Start: SQL vs NoSQL and the NoSQL families

Lessons· one lesson for each topic, in this order

  1. 1SQL vs NoSQL and the NoSQL families
  2. 2Data modelling from access patterns
  3. 3Indexes and query plans
  4. 4ACID transactions and the write-ahead log
  5. 5Isolation levels and concurrency anomalies
  6. 6Replication and read replicas
  7. 7Partitioning and sharding
  8. 8Choosing shard keys, hot spots and resharding
  9. 9Denormalisation for reads
  10. 10Object storage for large files

Start with· follow one of these

Practise

Also worth your time

Before moving on: For a read-heavy app with 10 million users, write a one-page data plan: the schema and indexes for its two main entities, a replication setup, a shard key and its hot-spot risk, what you denormalise, and where images and videos are stored.

Tauseef's advice
Get comfortable with indexes, transactions and isolation levels in one relational database before comparing NoSQL options, because most 'we need NoSQL' decisions are really a missing index. Pick a shard key by asking how the data is read, not how it is written.

Mark this stage as not done?