CintermediatebackendAI generated

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

  1. 01

    Design the on-disk record format

    ~1.5h

    Define a fixed binary layout for key-value records (lengths + data) appended to a data file.

  2. 02

    Implement the in-memory hash table index

    ~2.5h

    Build a chained hash table mapping keys to byte offsets in the data file.

  3. 03

    Implement set and get operations

    ~2.5h

    Write new records by appending to the file and updating the index; implement get by seeking to the stored offset.

  4. 04

    Implement delete with tombstones

    ~1.5h

    Mark deleted records with a tombstone flag and remove them from the in-memory index.

  5. 05

    Add a compaction routine

    ~2.5h

    Write a compaction pass that rewrites the file skipping tombstoned/overwritten records to reclaim space.

  6. 06

    Build a REPL interface

    ~1.5h

    Wrap the engine in an interactive command loop supporting SET, GET, DEL, and LIST commands.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~12h · 6 steps

Tech stack

stdio.hhash tablebinary file I/O