twilightdb

THE REALTIME DATABASE

Live data, every transaction exact, on servers you can own.

TwilightDB is a hosted database for apps. Queries stay live and send only what changed, every transaction is strictly serializable, and the same database runs on your own servers when you need it to.

board.ts
// Issue is your protobuf type: every field is checked, no migrations
const db = new TwilightDB({ baseUrl, token: process.env.TWILIGHTDB_TOKEN }).database("tdb-…-main")
const issues = db.collection("issues", IssueSchema)

// live: the first page, then only what changed, never a re-sent list
for await (const ev of db.watchQuery(issues, { filters: [where("status", "==", Status.OPEN)] }))
  render(ev.upserted, ev.removed)

// exact: strictly serializable, retried for you if another write got there first
await db.transaction(async (tx) => {
  const sprint = await tx.get(sprints, id)
  tx.put(sprints, id, { ...sprint!.value, committed: sprint!.value.committed + points })
})

A database that does the hard parts for you.

For app developers who'd rather never operate a database, and for agents building apps: everything an app needs from its data, without designing around a database's limits.

Live by default

Watch a record, a query or a view. Changes stream in as they commit, and incremental views send only the delta.

Every transaction exact

Strictly serializable across any records you touch, on FoundationDB. No per-transaction document limits to design around.

Typed from end to end

Collections have protobuf types, stored as data. Change a type without a migration: add the new shape, retire the old.

Query your way

A query builder in every SDK for everyday and live reads, read-only SQL for reports, full-text and vector search built in.

Rules that travel with the data

Validation and per-collection access rules live in the database, so browsers and phones can talk to it directly.

SDKs in seven languages

TypeScript, Go, Python, Swift, Java, Kotlin and Dart, plus a Rust client. Webhooks, change streams and Parquet or Iceberg export.

How it compares

Supabase and Neon are excellent Postgres services. Pick them when you want Postgres; pick TwilightDB when you want live queries and exact transactions without building them yourself.

TwilightDBSupabaseNeon
Data modelTyped records (protobuf), schema as dataPostgres tablesPostgres tables
RealtimeLive queries and incremental views that push only the changeRealtime: row changes and broadcast over websocketsNot built in (logical replication to your own consumer)
TransactionsStrictly serializable, alwaysACID; read committed by default, serializable on requestACID; read committed by default, serializable on request
SQLRead-only SQL (joins, reports); writes through the SDKsFull Postgres SQL and extensionsFull Postgres SQL and extensions
BranchesBranches and point-in-time restore (a branch copies its data; not yet self-serve on twilightdb.com)Preview branchesInstant copy-on-write branches
Beyond the databaseDatabase only; sign-in tokens checked by its rulesAuth, storage, edge functions includedDatabase only
Run it yourselfYes: the same product (container, Debian package)Yes: DockerOpen source; heavier to run
MaturityNew; SDKs aren't on package registries yetMature, large communityMature, large community

Hosted by us, or owned by you.

The hosted service and the self-hosted database are the same product, built on FoundationDB. Start here and take it in-house later, with the same API and the same data.

  • Same API, same SDKsprotobuf over Connect
  • Backups and restore to any momentchange stream kept whole
  • Moves between clusters livebehind a write fence
  • Metrics and request logsper database

Simple plans

Free

$0/month

2 databases · 500 MB each

Pro

$25/month

10 databases · 8 GB each

Team

$149/month

50 databases · 50 GB each

See every limit →

Your first database is a minute away.

Create a database