RatDB
Version 0.1.0 — Alpha

RatDB

A place to store your shiny things.

A lightweight, durable, offline-first document database built in Rust. From everyday applications to the computing frontier.

An engraved rat cradles a bright turquoise crystal in its paws.
Written in RustEmbedded or standaloneLinux and Windows x86_64

What is RatDB?

RatDB stores JSON documents on your own machine. Give each document an ID, save it, and read it back after a restart. Documents in the same collection can have different fields.

Use it for a small application that needs to keep working offline, or link the storage engine directly into a Rust program that owns its data.

Local ownership

Run the database and authenticate locally. Your application can keep reading and writing when the network is down.

Document operations

Insert a new ID, replace a document, or update selected fields. Find matches by field value and browse a collection in bounded pages.

Recovery and backup

Writes publish a checksummed snapshot. Stop the server to make a verified backup, then restore it to a fresh file.

Warrens, dens
and shinies.

An instance is the running service. Each warren is a logical database. A den collects related documents inside it. The individual document you save is a shiny.

Example database
instance
└── garage                 warren
    └── cars               den
        ├── car:001        shiny
        └── car:002        shiny

Five-minute
quick start.

Download the alpha, extract the binary, and put it on your PATH. Initialize a new instance and choose an administrator password when prompted.

Leave the server running. In a second terminal, run ratdb and sign in as admin. Then enter the shell commands shown here.

Terminal 1 · Start the instance
ratdb init
ratdb serve
RatDB shell · Store your first shiny
use garage/cars
put car:001 {"make":"Ford","year":2021}
get car:001
{
  "id": "car:001",
  "make": "Ford",
  "year": 2021
}

Embedded or server?

In your Rust process

Open the database directly when one application owns the file. The embedded API can commit a bounded set of changes across multiple documents in a single write batch.

As a local service

Start ratdb serve to share an instance between the shell and applications. Rust and Python clients authenticate once per connection. For a remote machine, use an encrypted SSH tunnel to its loopback listener.

Asterhold and portability

The Rust core can run with an allocator and a storage adapter. The adapter supplies exact reads and writes, resizing, and a durable flush. Asterhold could provide those operations through its own filesystem or block service.

Mock filesystem and block-device adapters pass the host tests. The core also compiles for bare-metal ARM. Runs on Asterhold and physical target boards are future milestones.

Current limits

RatDB 0.1.0 is an alpha for evaluation.

Each commit still rewrites the live snapshot into the alternate bank. Capacity is fixed, and heavy write workloads become more expensive as the data grows. Network commands commit individually, and separate cursor pages can observe different committed states.

Process termination and simulated storage failures have been tested. Physical power cuts, extended endurance runs, and real Asterhold hardware remain open. The roadmap lists the evidence required for each milestone.