|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Log-structured hash key-value store on the WAL (PC_ENABLE_DBM, requires PC_ENABLE_WAL). More...
#include "protocore_config.h"Go to the source code of this file.
Log-structured hash key-value store on the WAL (PC_ENABLE_DBM, requires PC_ENABLE_WAL).
A Bitcask-style key-value store: the value data lives append-only in the write-ahead log (pc_wal_store.h) and an in-RAM open-addressed hash index maps each live key to where its latest value sits in the log. This is the design the measured SD envelope wants (docs/FEATURE_PERFORMANCE.md): every write is one of the WAL's fast sequential appends, never a slow durable random write.
The index is a fixed BSS array of PC_DBM_SLOTS slots (no heap); keys are bounded by PC_DBM_KEY_MAX and values by PC_DBM_VAL_MAX. Everything fails closed at those bounds. Like the other services, drive it from one context (a worker / loop), not concurrently.
On-media record payload (inside a WAL record): [op u8][key_len u16][val_len u32][key][value] (LE), op 0 = put, op 1 = delete (a tombstone, val_len 0).
Definition in file dbm.h.