SevenDB — reactive,scalable , in-memory database designed for real-time systems with deterministic execution, fine-grained backpressure, and modern hardware optimization.
Go
72
271 commits
updated Mar 19, 2026
SevenDB is a reactive database, building on DiceDB and extending it with a stronger foundation for deterministic subscriptions, bucket-based sharding, and compute scalability.
SevenDB aims to be the foundation for reactive applications at scale — where subscriptions are as reliable as reads and as scalable as writes.
you can run this using make bench , here are the single-machine results on my ryzen-7 5700
SevenDB benchmark — GETSET
Target: localhost:7379, conns=16, workers=16, keyspace=100000, valueSize=16B, mix=GET:50/SET:50
Warmup: 5s, Duration: 30s
Ops: total=3695354 success=3695354 failed=0
Throughput: 123178 ops/s
Latency (ms): p50=0.111 p95=0.226 p99=0.349 max=15.663
Reactive latency (ms): p50=0.145 p95=0.358 p99=0.988 max=7.979 (interval=100ms)
SevenDB speaks the same RESP protocol as Redis.
That means you can connect to it with any existing Redis client (redis-cli, ioredis, redis-py, etc.) and use standard commands, with extra power from reactive subscriptions.
Clone and build SevenDB:
git clone https://github.com/sevenDatabase/SevenDB.git
cd sevendb
make build # builds ./sevendb executable
or
go run main.go #run like a normal go program
By default, the server listens on localhost:7379.
Best way to connect to sevenDB is through SevenDB-cli
git clone https://github.com/sevenDatabase/SevenDB-cli
cd SevenDB-cli
make build
./sevendb-cli # ensure the sevendb server is running first
SevenDB supports familiar Redis-style commands:
> SET user:1 "Alice"
OK
> GET user:1
"Alice"
Unlike Redis, subscriptions in SevenDB are first-class operations.
> GET.WATCH user:1
Subscribed to key [user:1]
Now, when user:1 changes:
> SET user:1 "Bob"
Your subscription immediately receives:
user:1 -> "Bob"
Some advanced features, like durable outbox delivery and EMITRECONNECT, require the Emission Contract to be enabled.
CLI flag:
sevendb --emission-contract-enabled=true \
--emission-notifier-poll-ms=5 # optional: tune notifier poll interval
Config (sevendb.yaml):
emission-contract-enabled: true
emission-notifier-poll-ms: 5 # optional
With this enabled, emissions are written to a raft-backed outbox and delivered deterministically by a per-bucket notifier.
If your client disconnects and later reconnects, you can resume emissions without gaps using EMITRECONNECT.
EMITRECONNECT key sub_id last_commit_indexOK <next_index> on success (resume from this next commit index)STALE_SEQUENCE if the server has compacted past your indexINVALID_SEQUENCE if the provided index is invalid for this subscriptionSUBSCRIPTION_NOT_FOUND if the subscription isn’t active for the keyExample (RESP/CLI style):
> EMITRECONNECT user:1 client123:987654321 42
OK 43
Notes:
sub_id is the subscription identifier associated with your GET.WATCH (the client/fingerprint pair used by the server). If you’re using the official SevenDB client, it will surface this ID for reconnects.SevenDB exposes lightweight emission metrics for visibility during development and ops.
bucket (the internal shard ID) when the Emission Contract is enabled.Options:
Enable a Prometheus endpoint (off by default):
sevendb \
--emission-contract-enabled=true \
--metrics-http-enabled=true \
--metrics-http-addr=":9090"
Then scrape http://<host>:9090/metrics. Example metric names:
sevendb_emission_pending_entries{bucket="a"}sevendb_emission_sends_per_sec{bucket="a"}sevendb_emission_reconnects_total{bucket="a",outcome="ok|stale|invalid|not_found"}Config (sevendb.yaml):
metrics-http-enabled: true
metrics-http-addr: ":9090"
Emit a compact log line every N seconds (off by default):
sevendb --metrics-log-interval-sec=10
You’ll see lines like:
level=INFO msg=emission_metrics pending=0 subs=0 sends_per_sec=0 acks_per_sec=0 lat_ms_avg=0 reconnect_ok=0 reconnect_stale=0
Notes:
/metrics endpoint only includes SevenDB application metrics (no Go runtime by default) to keep output small and stable.SevenDB's WAL normally buffers writes and flushes/fsyncs on an interval (--wal-buffer-sync-interval-ms). For many workloads this amortizes IO and is sufficient. You can opt a specific SET write into synchronous durability:
sevendb \
--enable-wal=true \
--wal-enable-durable-set=true \
--wal-dir=logs
SET mykey "value" DURABLE
# or
SET mykey "value" SYNC
Behavior:
DURABLE / SYNC: SevenDB appends the command to the WAL buffer and replies OK (fsync happens later).DURABLE / SYNC: SevenDB flushes and fsyncs the WAL segment before replying OK, ensuring the change is on disk (subject to filesystem semantics) when acknowledged.ERR wal sync failed: <reason> instead of OK.Metrics:
sevendb_set_durable_sync_total: count of SETs that forced an immediate WAL sync.sevendb_set_buffered_total: count of SETs written without a durability request.Use this for critical keys (e.g., transaction commits, idempotency markers) without globally forcing synchronous writes.
Traditional databases excel at storing and querying, but they treat reactivity as an afterthought. Systems bolt on triggers, changefeeds, or pub/sub layers — often at the cost of correctness, scalability, or painful race conditions.
SevenDB takes a different path: reactivity is core. We extend the excellent work of DiceDB with new primitives that make subscriptions as fundamental as inserts and updates.
Additional docs:
See docs: Determinism: scope, harness, and how to run
Quick runs:
# Emission determinism (100-run cases)
go test ./internal/emission -run 'Determinism_Repeat100' -count=1
# WAL determinism (rotation and prune)
go test ./internal/raftwal -run 'Determinism_Repeat100' -count=1
Reconnect Benchmarks:
go run ./scripts/bench/reconnect_bench.go --host localhost --port 7379 --iterations 1 --warmup-emissions 50
Crash Recovery Benchmarks:
Server Crash Scenario :
go run scripts/bench/crash_recovery_bench.go \
--scenario=server \
--binary=/home/blagden/Documents/sevenDB/sevendb \
--iterations=5 \
--updates=200
Client Crash Scenario:
./sevendb --enable-wal --wal-enable-durable-set # in another terminal
go run scripts/bench/crash_recovery_bench.go \
--scenario=client \
--iterations=5 \
--updates=2
Failover Benchmarks:
go run failover_bench.go -binary /home/blagden/Documents/sevenDB/sevendb -iterations 30
Throughput, Latency Benchmarks:
make bench
Fan-out Benchmarks:
go run scripts/bench/fanout_bench.go
Throughput vs Latency Benchmarks:
go run scripts/bench/throughput_vs_latency_bench.go \
--start-rate 1000 \
--end-rate 50000 \
--step-rate 2000 \
--step-duration 5s \
--conns 50
SUBSCRIBE / UNSUBSCRIBE are first-class operations, logged like INSERT or UPDATE.(sub_id, emit_seq) for “effective-once” delivery.DiceDB gave us the foundation: a Redis-compatible, reactive engine with subscriptions. SevenDB extends it with:
emit_seq) for gap-free ordering across migrations.In short: DiceDB rethought data reactivity. SevenDB rethinks scalable, correct reactivity.
🚧 Early development — expect rapid iteration.
Go
99.0%
SevenDB — reactive,scalable , in-memory database designed for real-time systems with deterministic execution, fine-grained backpressure, and modern hardware optimization.
Go
72
271 commits
updated Mar 19, 2026
SevenDB is a reactive database, building on DiceDB and extending it with a stronger foundation for deterministic subscriptions, bucket-based sharding, and compute scalability.
SevenDB aims to be the foundation for reactive applications at scale — where subscriptions are as reliable as reads and as scalable as writes.
you can run this using make bench , here are the single-machine results on my ryzen-7 5700
SevenDB benchmark — GETSET
Target: localhost:7379, conns=16, workers=16, keyspace=100000, valueSize=16B, mix=GET:50/SET:50
Warmup: 5s, Duration: 30s
Ops: total=3695354 success=3695354 failed=0
Throughput: 123178 ops/s
Latency (ms): p50=0.111 p95=0.226 p99=0.349 max=15.663
Reactive latency (ms): p50=0.145 p95=0.358 p99=0.988 max=7.979 (interval=100ms)
SevenDB speaks the same RESP protocol as Redis.
That means you can connect to it with any existing Redis client (redis-cli, ioredis, redis-py, etc.) and use standard commands, with extra power from reactive subscriptions.
Clone and build SevenDB:
git clone https://github.com/sevenDatabase/SevenDB.git
cd sevendb
make build # builds ./sevendb executable
or
go run main.go #run like a normal go program
By default, the server listens on localhost:7379.
Best way to connect to sevenDB is through SevenDB-cli
git clone https://github.com/sevenDatabase/SevenDB-cli
cd SevenDB-cli
make build
./sevendb-cli # ensure the sevendb server is running first
SevenDB supports familiar Redis-style commands:
> SET user:1 "Alice"
OK
> GET user:1
"Alice"
Unlike Redis, subscriptions in SevenDB are first-class operations.
> GET.WATCH user:1
Subscribed to key [user:1]
Now, when user:1 changes:
> SET user:1 "Bob"
Your subscription immediately receives:
user:1 -> "Bob"
Some advanced features, like durable outbox delivery and EMITRECONNECT, require the Emission Contract to be enabled.
CLI flag:
sevendb --emission-contract-enabled=true \
--emission-notifier-poll-ms=5 # optional: tune notifier poll interval
Config (sevendb.yaml):
emission-contract-enabled: true
emission-notifier-poll-ms: 5 # optional
With this enabled, emissions are written to a raft-backed outbox and delivered deterministically by a per-bucket notifier.
If your client disconnects and later reconnects, you can resume emissions without gaps using EMITRECONNECT.
EMITRECONNECT key sub_id last_commit_indexOK <next_index> on success (resume from this next commit index)STALE_SEQUENCE if the server has compacted past your indexINVALID_SEQUENCE if the provided index is invalid for this subscriptionSUBSCRIPTION_NOT_FOUND if the subscription isn’t active for the keyExample (RESP/CLI style):
> EMITRECONNECT user:1 client123:987654321 42
OK 43
Notes:
sub_id is the subscription identifier associated with your GET.WATCH (the client/fingerprint pair used by the server). If you’re using the official SevenDB client, it will surface this ID for reconnects.SevenDB exposes lightweight emission metrics for visibility during development and ops.
bucket (the internal shard ID) when the Emission Contract is enabled.Options:
Enable a Prometheus endpoint (off by default):
sevendb \
--emission-contract-enabled=true \
--metrics-http-enabled=true \
--metrics-http-addr=":9090"
Then scrape http://<host>:9090/metrics. Example metric names:
sevendb_emission_pending_entries{bucket="a"}sevendb_emission_sends_per_sec{bucket="a"}sevendb_emission_reconnects_total{bucket="a",outcome="ok|stale|invalid|not_found"}Config (sevendb.yaml):
metrics-http-enabled: true
metrics-http-addr: ":9090"
Emit a compact log line every N seconds (off by default):
sevendb --metrics-log-interval-sec=10
You’ll see lines like:
level=INFO msg=emission_metrics pending=0 subs=0 sends_per_sec=0 acks_per_sec=0 lat_ms_avg=0 reconnect_ok=0 reconnect_stale=0
Notes:
/metrics endpoint only includes SevenDB application metrics (no Go runtime by default) to keep output small and stable.SevenDB's WAL normally buffers writes and flushes/fsyncs on an interval (--wal-buffer-sync-interval-ms). For many workloads this amortizes IO and is sufficient. You can opt a specific SET write into synchronous durability:
sevendb \
--enable-wal=true \
--wal-enable-durable-set=true \
--wal-dir=logs
SET mykey "value" DURABLE
# or
SET mykey "value" SYNC
Behavior:
DURABLE / SYNC: SevenDB appends the command to the WAL buffer and replies OK (fsync happens later).DURABLE / SYNC: SevenDB flushes and fsyncs the WAL segment before replying OK, ensuring the change is on disk (subject to filesystem semantics) when acknowledged.ERR wal sync failed: <reason> instead of OK.Metrics:
sevendb_set_durable_sync_total: count of SETs that forced an immediate WAL sync.sevendb_set_buffered_total: count of SETs written without a durability request.Use this for critical keys (e.g., transaction commits, idempotency markers) without globally forcing synchronous writes.
Traditional databases excel at storing and querying, but they treat reactivity as an afterthought. Systems bolt on triggers, changefeeds, or pub/sub layers — often at the cost of correctness, scalability, or painful race conditions.
SevenDB takes a different path: reactivity is core. We extend the excellent work of DiceDB with new primitives that make subscriptions as fundamental as inserts and updates.
Additional docs:
See docs: Determinism: scope, harness, and how to run
Quick runs:
# Emission determinism (100-run cases)
go test ./internal/emission -run 'Determinism_Repeat100' -count=1
# WAL determinism (rotation and prune)
go test ./internal/raftwal -run 'Determinism_Repeat100' -count=1
Reconnect Benchmarks:
go run ./scripts/bench/reconnect_bench.go --host localhost --port 7379 --iterations 1 --warmup-emissions 50
Crash Recovery Benchmarks:
Server Crash Scenario :
go run scripts/bench/crash_recovery_bench.go \
--scenario=server \
--binary=/home/blagden/Documents/sevenDB/sevendb \
--iterations=5 \
--updates=200
Client Crash Scenario:
./sevendb --enable-wal --wal-enable-durable-set # in another terminal
go run scripts/bench/crash_recovery_bench.go \
--scenario=client \
--iterations=5 \
--updates=2
Failover Benchmarks:
go run failover_bench.go -binary /home/blagden/Documents/sevenDB/sevendb -iterations 30
Throughput, Latency Benchmarks:
make bench
Fan-out Benchmarks:
go run scripts/bench/fanout_bench.go
Throughput vs Latency Benchmarks:
go run scripts/bench/throughput_vs_latency_bench.go \
--start-rate 1000 \
--end-rate 50000 \
--step-rate 2000 \
--step-duration 5s \
--conns 50
SUBSCRIBE / UNSUBSCRIBE are first-class operations, logged like INSERT or UPDATE.(sub_id, emit_seq) for “effective-once” delivery.DiceDB gave us the foundation: a Redis-compatible, reactive engine with subscriptions. SevenDB extends it with:
emit_seq) for gap-free ordering across migrations.In short: DiceDB rethought data reactivity. SevenDB rethinks scalable, correct reactivity.
🚧 Early development — expect rapid iteration.
Go
99.0%