Skip to main content

mrdb

Declare tables and actions in Python, then read and write them from a typed TypeScript client. The data plane is a single Go binary; row bytes live in a local folder or an S3-compatible archive.

mrdb is built for apps that want their reads to come from durable, content addressed objects rather than a general-purpose SQL server: a page read fetches the byte ranges it needs, a live commit feed pushes only what changed, and a baked deployment can serve a public snapshot with no application server.

Install

uv add mrdb            # app library: declarations, actions, tasks
uv tool install mrdb   # CLI only

pip install mrdb works too. Python 3.12 or newer is required. The wheel embeds the native binary, so it is platform-specific; 0.2.x ships Linux x86_64.

The S3 archive path needs the extra:

uv add "mrdb[s3]"

Quick start

mrdb init myapp
cd myapp
mrdb dev

mrdb init writes config.toml, a Python declaration package (app/), and a frontend directory (ui/). mrdb dev starts the writer, the gateway, the local admin, and the frontend watcher, and regenerates the typed client when the declarations change.

To ship a server-free read tree:

mrdb deploy --out dist
mrdb deploy --check --dist dist

Declare

from mrdb import Column, Everyone, SignedIn, Table, action

class Note(Table, name="notes", id="id"):
    id: str
    title: str
    body: str = ""
    pinned: bool = Column(default=False)

    def access(self):
        return self.read(Everyone) | self.write(SignedIn)

    @action
    def add(self, title: str, body: str = "", id: str | None = None) -> None:
        self.put({"id": id, "title": title, "body": body})

Each @action runs as one atomic commit. id: str | None = None asks the kernel to mint an id and return it. access() decides who may read and write each row; it is also what gives a table one partition per scope.

Read

mrdb codegen turns the declarations into ui/src/tables.ts (a barrel over one module per db):

import { notes } from "./tables";

export function Notes() {
  const rows = notes.map((note) => <li key={note.id}>{note.title}</li>);
  return <ul>{rows}</ul>;
}

await notes.add("Hello", "first note");   // returns the minted id

Reads inside a component are tracked by the React build. A plain TypeScript app can use live from mrdb directly. The TypeScript client is vendored into ui/node_modules by the CLI; do not install it from npm.

How it fits together

app declarations + actions      Python
        |
        v
mrdb (one binary)               Go: storage, WAL, commits, leases, reads, FTS, gateway
        |
        v
local folder or S3 archive      row segments + published tips

browser / Bun / Node            TypeScript: generated tables, plan reads, live feed
  • One writer claim per partition, coordinated by a coordinator-free peer mesh. Several processes on one machine and several machines can write at once; writers on disjoint partitions do not contend.
  • A local folder is its own commit point. An archive writer commits through a local WAL and publishes segments first, the tip last, so a reader never sees a tip that names a missing object.
  • A public deployment can bake a plan tree and serve it as static bytes. A writable deployment runs mrdb serve and points the client at the gateway.

Documentation

The app reference ships with the package. Print its location:

mrdb docs

Start with index.md; it links the install, config, CLI, and error pages.

Tests

From a checkout of this repository:

python -m pytest mrdb/tests/unit -q
python -m pytest mrdb/tests/public -n auto -q
(cd mrdb/go && go vet ./... && go test -race ./...)
(cd mrdb/mrdb/extensions/frontend && bun test && bun run typecheck)

The public suite is black box through the Python SDK and the native writer. Slow measurements live under mrdb/bench/ and run on demand, not in the unit suite.

Release

cd mrdb
make build      # binary + wheel under dist/<os>-<arch>/
make check      # inspect the wheel
make publish    # upload it to PyPI

Metadata

Release files for mrdb 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mrdb 0.2.0
File Interpreter ABI Platform Actions
mrdb-0.2.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for mrdb-0.2.0-py3-none-manylinux_2_17_x86_64.whl

Release files / mrdb-0.2.0-py3-none-manylinux_2_17_x86_64.whl

Download URL mrdb-0.2.0-py3-none-manylinux_2_17_x86_64.whl
Size 7.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d92082226e63e7b949f491b4d3994cfbf1624df608d1e080914c151430dce71b
BLAKE2b-256 checksum
How to use checksums
f24fe8b433a4ea5ccfc810beafa40137c2c10aa30dea47ebceb2cc6065e7af92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mrdb 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page