core practice · coding problem
Storage vs retrieval API
Design blob store: PUT by id vs GET by tag. Which needs secondary index? Which is O(1) lookup?
The mechanism
A storage engine is the layer that actually puts bytes on disk and finds them again. The defining choice is the write path: B-trees update pages in place (read-optimized), LSM trees append and merge (write-optimized). Everything else — WAL, indexes, caching — serves durability and lookup speed.
Expected evidence
PUT/GET by id is primary key O(1); tag search needs inverted/secondary index.
Try this drill in the practice workspace →
Hints when you need them
- Object id is content-addressed or assigned.
- Retrieval patterns drive indexes.
Watch for these mistakes
- Picking an engine without knowing the read/write ratio of the workload
- Ignoring write amplification and its effect on SSD lifetime
- Forgetting that every secondary index is extra write cost