Skip to content
System Designintermediate · 60 min

Database Design

Prerequisites: System Design Basics

Model data well: normalization vs denormalization, indexing, transactions and ACID, and choosing SQL vs NoSQL. Good schema decisions prevent the worst production scaling pain.

Normalization & when to denormalize

Normalization removes redundancy (each fact stored once), preventing update anomalies and saving space. Denormalization deliberately duplicates data to avoid expensive joins on read-heavy paths. Start normalized; denormalize with evidence.

Indexes

An index (usually a B-tree) speeds reads on indexed columns from O(n) to O(log n) but slows writes and costs space. Index the columns you filter/join/sort on; composite index order matters (leftmost-prefix rule). Too many indexes hurt write throughput.

SQL vs NoSQL

Relational DBs give strong consistency, joins, and ACID transactions — ideal for structured, related data. NoSQL (document, key-value, wide-column, graph) trades some of that for flexible schemas and horizontal scale. Choose by access patterns, not hype.

Resources

Practice & test yourself

Take the quiz →