System design

Stage 2 · Lesson 2 of 10

Data modelling from access patterns

Data storage, partitioning and replication

means deciding your entities (users, posts, orders), their fields and how they relate. Shape it around how the application reads and writes data. Start by listing the main queries: "show a user's 20 latest posts", "count likes on a post", "find orders by status".

In a , normalise first, so each fact is stored in exactly one place. Then check that every main query can be answered with a few indexed lookups. NoSQL stores such as key-value or databases work the other way round: you design one table per query.

You choose the partition key (which decides where a row lives) and the sort order so that each query reads just one partition.

Common trapmodelling the domain beautifully and discovering later that the home page needs a six-table join on every request.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

Also worth your time

Mark this stage as not done?