Your database is your backend.

Write your logic. Deploy one binary. Every client syncs in real-time.
No app server. No pub/sub. No glue code.

terminal
$ cosmictron deploy
Module compiled (0.8s)
4 tables, 6 reducers registered
Real-time subscriptions active
Live at wss://my-app.cosmictron.dev

Ready. 0 config files needed.
Open Source · MIT / Apache 2.0
SIMPLIFY

Stop managing infrastructure.
Start shipping product.

Express / Fastify / Hono
Logic runs inside the database

Your business logic executes where your data lives. No API layer, no serialization overhead, no cold starts.

Redis / Kafka / Pusher
Every query is a live subscription

Changes propagate to every connected client in milliseconds. No message broker, no fanout service, no polling.

Postgres + Prisma + migrations
Embedded storage with SQL

Tables, indexes, and row-level security defined in code. Deploy and your schema is live. No migration files.

One $5/mo VPS. One process. Zero ops.

USE CASES

Built for apps that need to feel alive.

Real-time collaboration

Figma-style multiplayer. Every cursor, every keystroke syncs instantly. Incremental subscriptions mean zero wasted bandwidth.

Multiplayer games

Server-authoritative game state. Players see only what RLS allows. Reducer logic runs inside the database — no separate game server.

Chat & messaging

Typing indicators to message history. All from SQL subscriptions. No WebSocket plumbing, no Redis pub/sub.

Live dashboards

Aggregate queries update incrementally. No polling, no timers. Your dashboard reacts to every database change in real time.

HOW IT WORKS

Three files. Zero config. One deploy.

1

Define your data

module.rs
#[table(name = "messages", public)]
pub struct Message {
    #[primary_key] #[auto_inc]
    pub id: u64,
    pub sender: Identity,
    pub text: String,
}
2

Write your logic

module.rs
#[reducer]
fn send(text: String) {
    let sender = caller_identity();
    db::insert(Message { sender, text });
}
3

Subscribe from anywhere

client.ts
const db = new Cosmictron("my-app");

db.subscribe("SELECT * FROM messages");
db.on("messages", ({ inserts }) => {
  inserts.forEach(m => render(m));
});
SUPERPOWERS

Built for developers who ship.

Performance

Incremental real-time sync

DBSP circuits compute only what changed. Not the full query — just the delta. Join 3 tables with an aggregate? Only the affected rows recompute. Your users feel instant because it is instant.

Security

Security you can't forget

Row-level security policies are SQL predicates, auto-injected into every query and every subscription. It's not opt-in — it's structural. You literally cannot serve data a user shouldn't see.

Freedom

Truly open source

MIT and Apache 2.0. Not BSL, not SSPL, not 'source-available.' Self-host on your $5 VPS or your enterprise cluster. No egress fees. No surprise bills. Your data never touches our servers.

DX

TypeScript native

Full V8 runtime — not TypeScript compiled to WASM. Use any npm package. Write async code. Call external APIs. The TypeScript you already know, running inside your database.

MIGRATE

Already using something else?

Coming from Firebase?

  • Self-hosted, open-source. Your data stays on your server.
  • Incremental subscriptions (DBSP), not full re-evaluation on every write.
  • SQL-based row-level security, not a proprietary rules DSL.
Read the migration guide

Coming from Supabase?

  • Business logic runs inside the database. No separate Edge Functions.
  • Incremental joins and aggregations — not just single-table row changes.
  • Truly open source (MIT/Apache 2.0). No features locked behind cloud.
Read the migration guide

Coming from MongoDB Realm?

  • Realm is sunset. Cosmictron offers the same real-time sync pattern.
  • Embedded business logic replaces Atlas Functions.
  • SQL subscriptions replace Realm's object-level notifications.
Read the migration guide
PERFORMANCE

Numbers, not promises.

0
reducer calls/sec
500 concurrent clients
0 ms
average latency
p50 end-to-end
0 +
max connections
single node
O(delta)
subscription updates
incremental, not full scan

Benchmarked on a single node. No caching tricks. Reproducible.

COMING SOON

Don't want to self-host?

Cosmictron Cloud is coming. Managed hosting, automatic backups, one-click deploy. Join the waitlist.

No spam. Just one email when we launch.