MAINFRAME · TINY MAINFRAME COMPUTER CO. / A SHARED LOG FOR YOUR SERVICES

Build your engine.
Let Mainframe handle consensus.

A Rust library for building replicated services and databases. Mainframe orders and durably records commands through a shared log. You keep your API, your data structures in memory or on SSD, and the code that applies each change.

Independent Rust implementation inspired by Meta’s Delos research. S3 backends are prototypes; ordering and durability depend on the selected backend. Read the origins ↗

ORDER · APPLY · RECOVER
Rust Async APIPluggable storageOrdered replay

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.

META / DELOSTABLE

Relational storage above the log.

Meta described a table store with transactions, secondary indexes, and range queries built on Delos.

See the design and publication →
META / ZELOS

A different API. The same foundation.

Meta built a ZooKeeper-compatible coordination service on Delos, adding session and API semantics above the shared log.

Follow a session command →
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 handleryour map or SSD indexresult

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.

Explore the low-level log API
Mainframe / Shared log explorer Interactive model
EVERY SERVICE READS THE SAME SEQUENCE

Record a change. Give it a position.

Accepting writes
SERVICES / CLIENTS
A service
B service
C service
append
SHARED LOGposition →
Read entries by position, in order.tail: 4
4 entries · one shared order
log.append(entry).await?;Ok(LogPosition(3))
KEEP THE SERVICE YOU WANT TO WRITE

Plan how your service
uses the log.

Choose what data to store, how to handle reads and writes, and how to recover after a failure.

Design your service