Master the fundamental concepts of build a simple key-value store through this focused micro-challenge.
When the memtable fills, flush it to an SSTable file: sorted key-value pairs, often with a block index and bloom filter footer. LevelDB's format is the reference students copy. Immutability makes concurrent reads safe without locks.
Data blocks, index block mapping key ranges to offsets, magic footer.
cLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will flush a sorted memtable array to a simple SSTable file format on disk. This exercise asks you to write length-prefixed records and an index entry per block.
Document one invariant you will assert in tests and how you would detect its violation from observable symptoms.
Write a C program that flushes a sorted memtable to a simple SSTable format.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github