The database that is a log, and all operations are `fold(log)`.
Zig
72
186 commits
updated Aug 30, 2026

A replicated, deterministic state machine key-value store written in Zig. The log is the source of truth; state is fold(log) — a pure function cached in an LSM tree. One global sequence number, no wall clocks inside the fold.
Status: single-node is stable. Multi-node replication (Raft transport) is in active development.
Zig 0.16.0
zig build # build
zig build test # unit + integration tests
foldb serve --config config.json
foldb repl --host 127.0.0.1 --port 7432
Supports commands: set <key> <value>, get <key>, delete <key>, range <start> <end>, batch <file.json>, and exit.
foldb client --host 127.0.0.1 --port 7432 --command get --key "mykey"
foldb client --host 127.0.0.1 --port 7432 --command set --key "mykey" --value "myvalue"
{
"storage_dir": "/var/lib/foldb", // required — where data is stored
"node_id": 1, // unique integer per node in the cluster
"listen_addr": "0.0.0.0", // optional, default: 0.0.0.0
"listen_port": 7432, // optional, default: 7432
"peers": [], // optional — list of peer objects
"max_epoch_size": 10000, // optional — max transactions per Raft epoch
"election_timeout_min_ms": 150, // optional — Raft election timeout range
"election_timeout_max_ms": 300,
"heartbeat_interval_ms": 50 // optional — Raft heartbeat interval
}
docs/internal/ — subsystem reference (storage, log, gateway, sequencer, CDC, network)Copyright © Jeremy Tregunna. Released under the Apache 2.0 License.
186 commits
Zig
99.8%
The database that is a log, and all operations are `fold(log)`.
Zig
72
186 commits
updated Aug 30, 2026

A replicated, deterministic state machine key-value store written in Zig. The log is the source of truth; state is fold(log) — a pure function cached in an LSM tree. One global sequence number, no wall clocks inside the fold.
Status: single-node is stable. Multi-node replication (Raft transport) is in active development.
Zig 0.16.0
zig build # build
zig build test # unit + integration tests
foldb serve --config config.json
foldb repl --host 127.0.0.1 --port 7432
Supports commands: set <key> <value>, get <key>, delete <key>, range <start> <end>, batch <file.json>, and exit.
foldb client --host 127.0.0.1 --port 7432 --command get --key "mykey"
foldb client --host 127.0.0.1 --port 7432 --command set --key "mykey" --value "myvalue"
{
"storage_dir": "/var/lib/foldb", // required — where data is stored
"node_id": 1, // unique integer per node in the cluster
"listen_addr": "0.0.0.0", // optional, default: 0.0.0.0
"listen_port": 7432, // optional, default: 7432
"peers": [], // optional — list of peer objects
"max_epoch_size": 10000, // optional — max transactions per Raft epoch
"election_timeout_min_ms": 150, // optional — Raft election timeout range
"election_timeout_max_ms": 300,
"heartbeat_interval_ms": 50 // optional — Raft heartbeat interval
}
docs/internal/ — subsystem reference (storage, log, gateway, sequencer, CDC, network)Copyright © Jeremy Tregunna. Released under the Apache 2.0 License.
186 commits
Zig
99.8%