File-Backed Key-Value Store
A small database engine that stores key-value string pairs in a binary file with an in-memory hash table index for fast lookups, supporting get/set/delete operations via a simple REPL. Learners practice hash table implementation, binary file I/O, and basic persistence/index design in C.
- Estimate
- ~12h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
stdio.h · hash table · binary file I/O
Project roadmap
- 01
Design the on-disk record format
~1.5hDefine a fixed binary layout for key-value records (lengths + data) appended to a data file.
- 02
Implement the in-memory hash table index
~2.5hBuild a chained hash table mapping keys to byte offsets in the data file.
- 03
Implement set and get operations
~2.5hWrite new records by appending to the file and updating the index; implement get by seeking to the stored offset.
- 04
Implement delete with tombstones
~1.5hMark deleted records with a tombstone flag and remove them from the in-memory index.
- 05
Add a compaction routine
~2.5hWrite a compaction pass that rewrites the file skipping tombstoned/overwritten records to reclaim space.
- 06
Build a REPL interface
~1.5hWrap the engine in an interactive command loop supporting SET, GET, DEL, and LIST commands.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack