DB Control Plane Cheat Sheet
Key concepts, trade-offs, and quick-reference notes for your interview prep.
Range Metadata Fits in Memory: 1M Ranges x 200B = 200 MB
#1💡 1M ranges x 200B = 200 MB. Fits in memory. No disk I/O for routing.
Range Splits at 512 MB by Data Volume Median Key
#2💡 Split at 512 MB. Median by data volume, not key-space midpoint. ~100 splits/hour.
Lease-Based Failure Detection: 9-Second Leases Not Gossip
#3💡 9s lease + 2s election + 1s propagation = 12s total. Deterministic fencing.
Raft for Metadata: 5-Node Group Tolerates 2 Failures
#4💡 5-node Raft, F=2 tolerance, embedded (not external). 200 KB/sec steady Raft log.
Epoch Versioning: Monotonic Counter Prevents Stale Routes
#5💡 Monotonic epoch. Routers refresh on mismatch. 10-second convergence target.
Two-Phase Range Transfer: Source Serves Until Target Catches Up
#6💡 Target catches up via log replay. Source serves throughout. Atomic swap at the end.
Ghost Table Schema Change: Shadow, Backfill, Swap
#7💡 Shadow + backfill + swap. 100 workers = 30 seconds for 1M ranges. No table lock.
Rebalancer Targets 20% Load Variance Threshold
#8💡 20% trigger, 15% stop (hysteresis). ~100 moves/hour. Lower thresholds cause churn.
Heartbeat Carries Load Metrics, Not Just Liveness
#9💡 Heartbeats carry CPU, disk, range count. 1K/sec at 200 KB/sec. Dual-purpose signal.
Placement Constraints: Spread Across Racks, Zones, Regions
#10💡 Distinct racks minimum, distinct zones ideal. Cross-region adds 50-100ms write latency.