Retries become duplicate effects
The write committed. The response vanished. Does the caller try again?
Contract-first operational database
RiffDB is the contract-first data layer for multi-tenant SaaS built by agents: business rules become checked contracts, writes become compiled commands, and unsafe paths disappear from the application interface.
Open source and running today as a standalone, local-only Rust proof of concept. It is not a production release.See the boundaries.
The application changed
Agents can produce a remarkable amount of application code. They can also reproduce every fragile pattern we spent decades learning to avoid, only faster and across more services in more variations.
The write committed. The response vanished. Does the caller try again?
Each line looks reasonable. Concurrent execution breaks the business rule.
Every service remembers a different fragment of what must remain true.
RiffDB’s thesis
The safest operation is the one an application cannot express incorrectly.
Why one data layer
Connecting a database, queue, search engine, and vector store does not create one transaction, one freshness contract, or one coherent backup. Fast glue code cannot remove a dual-write problem that exists in the architecture.
Wired together
Dual writes · stale indexes · fractured recovery
RiffDB’s direction
The contract is executable
A RiffDB contract declares entities, commands, outcomes, invariants, relationships, durable events, indexes, and projections. The compiler resolves and bounds the plan before it can run.
Understand contract-first statecommand AllocateBudget(
organization_id: Uuid,
amount: Decimal<2>
) returns Allocated
| InsufficientFunds {
// one declared dependency
read budget by organization_id
else BudgetNotFound;
require budget.remaining >= amount
else InsufficientFunds;
set budget.remaining =
budget.remaining - amount;
emit BudgetAllocated { amount };
}Database-enforced semantics
The guarantees travel with the command, regardless of which supported interface invokes it.
Applications invoke compiled domain operations. There is no generic insert, update, delete, or transaction callback in the supported application surface.
Idempotency identity and durable outcomes let a caller retry after a lost response without duplicating the mutation or its events.
State, outcome, events, provenance, outbox intent, and the commit record become durable together. Otherwise, none of them do.
Native MCP exposes only authorized commands and bounded context. It is a policy-filtered transport, never a privileged storage bypass.
One semantic path
Generated clients, CLI, gRPC, and native MCP share authentication, authorization, deterministic execution, conflict validation, and commit coordination.
Why now
Agent-built applications need more than a faster way to emit queries. They need an operational substrate that turns intent into a bounded, attributable, recoverable state transition.
RiffDB begins with a single-node semantic kernel. The long path points toward managed, replicated execution without giving up the contracts that make automated development trustworthy.
Beyond the current POC, the product direction brings transactions, schema migrations, event subscribers, projections, full-text search, vectors, and bounded analytics together as opt-in native parts of one data layer.
Boundary 01
RiffDB governs what an application principal may read and write. Identity, sessions, sign-in, and OAuth remain in the application.
Boundary 02
Capabilities are à la carte. When a specialist system becomes the right tool, the changelog and supported export path let RiffDB feed it without holding application data hostage.
Managed RiffDB
We’re working toward a managed service. Join the early-access list for material project updates and the first invitations.