Start building in seconds
Everything you need to build collaborative, offline-capable apps.
- Define & Store
- React Integration
- Multiplayer
// Define your data structure
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;
// Create a todo - it's instantly available
const todo = db.create('/data/todos/task1', TodoSchema, {
text: 'Review pull requests'
});
// Update it - changes are immediate
todo.set('done', true);
// Delete it - no await needed
todo.isDeleted = true;
// Your UI stays in sync automatically
function TodoList() {
// This query updates when ANY peer makes changes
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} />
));
}
function TodoItem({ path }: { path: string }) {
// This hook gives you a live, editable object
const todo = useItem(path);
return (
<label>
<input
type="checkbox"
checked={todo?.get('done') ?? false}
onChange={(e) => todo?.set('done', e.target.checked)}
/>
{todo?.get('text')}
</label>
);
}
// Collaborative whiteboard with automatic merging
const WhiteboardSchema = {
ns: 'whiteboard',
version: 1,
fields: {
title: { type: 'string', required: true },
shapes: { type: 'set' }, // Merge-friendly set
connectedUsers: { type: 'map' }, // Merge-friendly map
tags: { type: 'set' }
}
} as const;
// User A draws a circle (on laptop)
const board = db.item('/data/whiteboards/brainstorm');
board.set('shapes', board.get('shapes').add({
id: 'circle-1',
type: 'circle',
x: 100, y: 200
}));
// User B draws a square at same time (on tablet, offline)
board.set('shapes', board.get('shapes').add({
id: 'square-1',
type: 'square',
x: 150, y: 250
}));
// Both users add different tags simultaneously
// User A: board.set('tags', board.get('tags').add('urgent'));
// User B: board.set('tags', board.get('tags').add('design'));
// When they sync:
// ✅ Both shapes appear - no overwrites
// ✅ Both tags are present: Set {'urgent', 'design'}
// ✅ Cursor positions update in real-time via the map
// ✅ No conflict dialogs - additions always win
// The magic: Sets and maps merge like Git branches - intelligently combining changes.
// Unlike last-write-wins, everyone's additions are preserved.
Why developers choose GoatDB
The only database where clients can securely restore a crashed server. Perfect for single-tenant SaaS.
Never lose a change
Each document has its own commit graph. Branches merge automatically using three-way merge with ephemeral CRDTs. No merge conflicts, ever.
Version History
Every item tracks its complete history
Three-Way Merge
Git-style merging for live data
Ephemeral CRDTs
Conflict-free types without the overhead
Time Travel
Navigate through document history
Works Offline
Your app works without internet. Changes sync automatically when reconnected.
Self-Healing Architecture
Cryptographically signed commits enable clients to restore crashed servers. Ultra-cheap single-tenant deployments.
Instant UI Updates
Local changes are instant. Remote changes stream in real-time. No spinners. No loading states. No waiting.
Smart Conflict Resolution
Like Git's three-way merge but for live data. Multiple users edit simultaneously without conflicts.
Just TypeScript
TypeScript schemas. JavaScript queries. No SQL. No query language. Just your code.
Single Binary Deploy
Deno compiles everything into one binary. Deploy on cheap VMs. Each customer gets their own instance. Scale by adding instances.
Built for modern apps
Ultra-Cheap Single-Tenant
Deploy each customer on their own $5/month VM. The cryptographically signed commit graph means clients can restore crashed servers automatically. No complex HA setup needed.
Offline-First Apps
Create mobile and desktop apps that work seamlessly offline and sync when connected. Perfect for field work and unreliable networks.
Multiplayer Games
Build real-time multiplayer experiences with minimal server overhead. Each game room gets its own lightweight instance. Scale horizontally by adding cheap VMs.
Collaborative Editing
Build Google Docs-like experiences where multiple users edit the same document in real-time, with automatic conflict resolution.
GoatDB trades raw query performance for developer experience. If you need sub-100ms queries on millions of rows, use PostgreSQL.
See benchmarks →
Open Source
Apache 2.0 licensed. Built in public. Used in production.
Help us build the future of local-first software.