Code Room
System designMediumsd-g034
Subject Storage enginesLevel Mid–Senior~40 minCommon in Databases & SQL · Storage & CDN interviewsIndustries Technology, Software development

Question

Your team is choosing the storage engine for a new service and the platform offers both an LSM-tree engine and a B+tree engine under the same API (think MongoDB WiredTiger vs MyRocks, or RocksDB vs an in-place B-tree). The workload: write-heavy (10:1 write:read), keys are random UUIDs, values ~1KB, data grows ~1TB/month, reads are mostly point lookups of recently written keys, on commodity SSDs where write endurance and disk cost matter. Pick an engine, justify it on first principles, and state the conditions under which you'd switch to the other.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.