Skip to main content

GoatDB

A peer-to-peer database that spans devices.
For apps and agents that work everywhere.

Current databases force a choice: embed them in the client and struggle with sync, or run them in the cloud and lose offline support. GoatDB takes a different path — a peer-to-peer data layer that reaches from your backend to your browser, works offline, and heals itself when servers crash.

Works Offline, Syncs Automatically

Your app works without internet. Local changes are instant — no spinners, no loading states. Changes sync automatically when reconnected.

No Conflict Dialogs. Ever.

Multiple users edit the same data at the same time. Changes merge automatically — no manual conflict resolution, no data loss.

Self-Healing, Simple to Deploy

Compiles to a single binary on every runtime. If your server crashes, clients carry the full history and restore it automatically.

Start building in seconds

Everything you need to build collaborative, offline-capable apps.

1

Define & create

Declare your schema and write data locally — no await, no round trips.

const TodoSchema = {
ns: 'todo',
version: 1,
fields: {
text: { type: 'string', required: true },
done: { type: 'boolean', default: () => false },
createdAt: { type: 'date', default: () => new Date() }
}
} as const;

const todo = db.create('/data/todos/task1', TodoSchema, {
text: 'Review pull requests'
});
todo.set('done', true);
2

Query live

React hooks that re-render whenever data changes, from any peer.

function TodoList() {
const todos = useQuery({
source: '/data/todos',
schema: TodoSchema,
predicate: ({ item }) => !item.get('done'),
sortBy: 'createdAt'
});

return todos.results().map(todo => (
<TodoItem key={todo.path} path={todo.path} />
));
}
3

It just syncs

No conflict dialogs. Ever. Offline edits, concurrent users, multiple devices — everything merges automatically. You never write conflict-resolution code.

4

Built for AI agents

Give agents resilient state that follows them across devices. From cloud to edge — one cryptographically signed data layer.

const task = db.create('/data/tasks/plan-1', TaskSchema, {
title: 'Analyze Q4 metrics',
status: 'pending',
assignedAgent: session.id
});
task.set('status', 'complete');

Built for modern apps

Offline-First Apps

Create mobile and desktop apps that work seamlessly offline and sync when connected. Perfect for field work and unreliable networks.

Collaborative Editing

Build Google Docs-like experiences where multiple users edit the same document in real-time, with automatic conflict resolution.

Distributed AI Agents

Give AI agents resilient, real-time state that follows them across devices. From cloud to browser, agents share a single cryptographically signed data layer.

Pay once at startup. Zero IO after.

GoatDB loads your dataset into memory when a repository opens — then eliminates IO from every subsequent operation. Reads complete in 1–2μs with no network hop, no disk wait, no server in the loop. A remote PostgreSQL query costs 1–5ms in the same datacenter, 10–50ms from the browser. GoatDB removes that cost from your hot path entirely.

The tradeoff is startup time: opening a large repository takes a few hundred milliseconds. After that, your app runs at memory speed. Sync and persistence happen fully in the background.

See the benchmarks →

Open Source

MIT licensed. Built in public. Used in production.
Help us build the future of local-first software.

GitHub stars GitHub forks