System Design Roadmap 04 - Databases and Storage Models
0.0(0)
Studied by 0 people
Call Kai
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Knowt Play
Card Sorting
1/17
There's no tags or description
Looks like no tags are added yet.
Last updated 1:33 AM on 7/23/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat
No analytics yet
Send a link to your students to track their progress
18 Terms
1
New cards
Database design choice
Choose storage based on access patterns, consistency needs, query shape, data size, write/read ratio, transactions, and operational maturity.
2
New cards
SQL vs NoSQL
SQL favors structured schema, joins, transactions, and rich queries. NoSQL favors flexible schema, horizontal scaling, and specialized access patterns.
3
New cards
Database replication
Copies data across nodes for availability, read scaling, and disaster recovery. Common issues are replication lag, failover correctness, and split brain.
4
New cards
Leader-follower replication
Writes go to a leader and replicate to followers. Reads can scale on followers but may be stale; leader failover must be carefully handled.
5
New cards
Multi-leader replication
Multiple nodes accept writes and replicate to each other. It improves regional availability but needs conflict detection and resolution.
6
New cards
Sharding
Split data across partitions by key or range so storage and traffic scale horizontally. The shard key determines load balance and query efficiency.
7
New cards
Bad shard key symptom
Hot shards, cross-shard queries, uneven storage, or difficult rebalancing. Pick keys using real access patterns, not just uniqueness.
8
New cards
Federation
Split databases by function or domain, such as users, orders, and catalog. It reduces blast radius but complicates cross-domain queries and transactions.
9
New cards
Denormalization
Duplicate or precompute data to make reads faster. It improves read performance at the cost of write complexity and consistency maintenance.
10
New cards
SQL tuning
Use indexes, query plans, batching, pagination, connection pooling, avoiding N+1 queries, and schema changes to reduce database load.
11
New cards
Key-value store
Stores values by key with very fast lookups. Good for sessions, cache, preferences, counters, and feature flags; weak for ad hoc querying.
12
New cards
Document store
Stores JSON-like documents. Good for flexible records and nested data; beware unbounded documents and difficult cross-document transactions.
13
New cards
Wide-column store
Stores rows with many sparse columns across distributed partitions. Good for huge write-heavy/time-series-like workloads. Model queries first.
14
New cards
Graph database
Optimized for relationships and traversals such as social graphs, fraud rings, recommendations, and dependency maps.
15
New cards
Index table pattern
Maintain a separate table optimized for a specific query path. Speeds reads but must be kept in sync with source data.
16
New cards
Materialized view
Persist a precomputed query result for fast reads. Refresh strategy determines staleness and write overhead.
17
New cards
CQRS
Separate command/write models from query/read models. Useful when reads and writes have very different shapes, scale, or consistency needs.
18
New cards
Event sourcing
Store every state change as an immutable event and rebuild current state from the log. Great auditability, but schema evolution and replay need care.