twilightdb

Getting started

  1. Sign up. You get a team and a first database, main, on the Free plan.
  2. In the console, make a key for the database: admin to create collections, write or read for your app.
  3. Install an SDK and connect to https://api.twilightdb.com with the key as the bearer token.

Install an SDK

The SDKs (TypeScript, Go, Python, Swift, Java, Kotlin, Dart) aren't on package registries yet. Until they are, ask support@twilightdb.com for access to the source and install from it; the TypeScript one is @twilightdb/client.

A first program

// 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 })
})

What to read next

The full guide is being published. Questions: support.