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.

Git-Style Conflict Resolution

Three-way merge with ephemeral CRDTs. Multiple users edit simultaneously without conflicts — like Git, but for live data.

Single Binary, Ultra-Cheap Deploy

Deno compiles everything into one binary. Each customer gets their own instance on a $5/month VM. Clients restore crashed servers 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

Offline edits, concurrent users, multiple devices — changes merge automatically using Git-style three-way merge. Sets and maps combine additions from all peers. No conflict dialogs. Ever.

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.

Not for everything

GoatDB trades raw query performance for developer experience and resilience. If you need sub-100ms queries on millions of rows, use PostgreSQL.

See benchmarks →

Open Source

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

GitHub stars GitHub forks