SevenDB: Reinventing Reactive Databases with Deterministic Subscriptions and Scalable Compute
Share this article
For decades, databases treated reactivity—real-time data change notifications—as a bolt-on feature. Triggers, changefeeds, and pub/sub systems were retrofitted onto storage engines, often leading to race conditions, scalability limits, or consistency tradeoffs. Enter SevenDB, a new open-source database that rebuilds reactivity from the ground up. Building on DiceDB's foundations, it introduces deterministic subscriptions, bucket-based compute sharding, and durable outbox delivery, positioning reactivity as a first-class citizen.
The Reactivity Gap
Traditional databases prioritize storage and query efficiency, treating data changes as secondary events. This forces developers into complex workarounds:
"Systems bolt on triggers, changefeeds, or pub/sub layers — often at the cost of correctness, scalability, or painful race conditions."
SevenDB flips this model. Its core architecture ensures every subscription is as fundamental as a GET or SET operation, logged via Raft for consistency and replayability.
Architectural Breakthroughs
1. Buckets & Compute Sharding
Data is partitioned into buckets—each an independent unit for replication, subscriptions, and computation. Compute sharding dynamically allocates resources:
- Hot Mode: All replicas process changes for instant failover.
- Cold Mode: Only the notifier evaluates changes, reducing CPU overhead.
2. Deterministic Subscriptions
Unlike ephemeral pub/sub, SevenDB logs subscriptions like data operations. Plan-hash checks enforce determinism, ensuring failovers replay identical states:
// Test determinism (from docs)
go test ./internal/emission -run 'Determinism_Repeat100' -count=1
3. Durable Outbox & EMITRECONNECT
Emissions aren’t fire-and-forget. Changes land in a Raft-backed outbox before delivery. If clients disconnect, EMITRECONNECT resumes streams without gaps:
> EMITRECONNECT user:1 client123:987654321 42
OK 43 # Resumes from index 43
Performance and Operations
Benchmarks on a Ryzen 7 5700 show promising throughput:
Throughput: 123,178 ops/s
Latency (ms): p50=0.111 p95=0.226
Reactive Latency (ms): p50=0.145 p95=0.358
Operational flexibility includes:
- Selective Durability: SET key value DURABLE forces immediate WAL sync for critical writes.
- Observability: Prometheus metrics for per-bucket emission tracking (sevendb_emission_pending_entries).
Why Developers Should Care
SevenDB isn’t just faster pub/sub. By scoping data, compute, and subscriptions to buckets, it eliminates entire classes of distributed systems bugs. Its Redis compatibility lowers adoption friction, while features like the Emission Contract enable enterprise-scale use cases. As the team notes:
"DiceDB rethought data reactivity. SevenDB rethinks scalable, correct reactivity."
Currently in early development, SevenDB represents a bold reimagining of real-time data infrastructure. For teams building event-driven microservices or global applications, it offers a path to reactivity without compromise.
Get Started:
git clone https://github.com/sevenDatabase/SevenDB
make build && ./sevendb
Source: SevenDB GitHub Repository