CONSENSUS + DURABILITY / YOUR APPLICATION
Consensus and durability.
Your application above them.
The same foundation supports a small service, a custom datastore, or
a database engine. Each replica runs your deterministic code over
the same sequence of commands. You decide what those commands mean.
FOR APPLICATION ENGINEERS
A service can own its data.
Keep a JSON-RPC API and a map or local index. Submit commands to
Mainframe, then apply them on each replica. If your code already
handles storage and queries, you may not need a separate database.
purchase → shared log → your local stateFollow a purchase ↗
FOR DATABASE ENGINEERS
Your database can reuse consensus.
Build your query engine, indexes, and transaction rules above a
shared ordered history. Use the log to replicate commands while
keeping your storage representation and API.
command → shared log → your database engineFollow a database update ↗
The same pattern can support specialized storage, such as recording
branch updates while file contents live in object storage. Pierre’s
Code Storage
illustrates the product category; this is a hypothetical Mainframe design,
not a claim that Pierre uses Mainframe.
LESS WORK BETWEEN YOUR CODE AND YOUR DATA
Skip the database round trip.
A local read accesses your application’s state directly. No extra
network hop to a database. No database connection pool. No encoding
a database request and decoding its response. Less protocol work
means less CPU overhead and latency on that path.
request handler→your map or SSD index→result
The savings are on the local read path. JSON-RPC and log writes
still require encoding and I/O. Reading the latest data may also
require waiting for the service to catch up.
AGREEMENT
Apply changes in the same order.
Every service reads the same sequence of commands. If each runs
the same deterministic code—code that produces the same result
from the same inputs—they reach the same state.
DURABILITY
Recover after a restart.
Keep local data in memory or on SSD, and save the log in object
storage. The current prototype has S3 backends. A GCS backend is
planned.
LOCAL SPEED
Read your local data.
Read directly from your map or index. Writes must wait for the log
to be saved. A read that needs the latest data may have to wait
for recent entries to be applied.