02 · Data Layer

Data is the core of every system. Before any component, you must decide: where does data live, how is it structured, and how does it survive growth? Every wrong data decision is expensive to fix later.

Pattern to build: Ask these in order — (1) What is the access pattern? (2) Read-heavy or write-heavy? (3) Do I need transactions? (4) How much data? (5) How flexible is the schema? The answers select your storage type.

Start with these lessons

From first principles, with a short quiz at the end of each.

  1. L1SQL vs NoSQLLesson · 3 short sections and a 4-question quiz
  2. L2Indexing & ReplicationLesson · 3 short sections and a 4-question quiz
  3. L3Sharding & CAP TheoremLesson · 3 short sections and a 4-question quiz

Topics

  1. 02.1SQL vs NoSQL — the real decision frameworkJunior
  2. 02.2Indexing — why queries are fast or slowJunior
  3. 02.3Database replicationJunior
  4. 02.4Database sharding (horizontal partitioning)Mid-level
  5. 02.5Consistent hashingMid-level