System Design
Beginner
Data Modeling for System Design
Choose data shapes for writes, reads, history, privacy, and operational recovery.
30 min
3 sections
data-modeling
schema
indexes
1
2
3
01. Separate write models from read models
Section 1 of 3
The normalized write model protects correctness. The read model serves common queries quickly. Mature systems often use both, connected by events or change data capture.
sql
Order write model:
- orders(id, user_id, status, total, created_at)
- order_items(order_id, sku, quantity, price_snapshot)
- payment_attempts(order_id, provider, status, idempotency_key)
Order history read model:
- user_order_timeline(user_id, order_id, status, summary, updated_at)
Support read model:
- order_audit_events(order_id, actor_id, event_type, payload, created_at)Back to Course