How Jazz Works / FAQ
Learn the mental model behind Jazz, how backends and clients talk to it, and find answers to common questions.SQLite and S3 underneath
- Each Jazz server stores its data in plain SQLite: tables, rows, indexes
- Large values (files, blobs, streams) live in S3-compatible object storage
- Works with local disk and compatible cloud storage
What Jazz adds on top
- A typed schema and generated migrations
- Permission policies checked on every read and write
- Live queries: results stay up to date as rows change
- Edit metadata (
$createdBy,$updatedAt, …) and row history - Merging writes by default, serializable transactions when you need them
- Drafts and branches, mergeable text
- Mutable blobs and streams on S3: edit, append to and stream large values like any other column, with the same permissions, live updates and history as rows
How a backend talks to Jazz
- Your main backend runs
createJazzin its own process, with the schema and permissions it imports - Use
jazz.dbto read and write with backend authority. This bypasses user permission policies and is useful for admin and system work - Use
jazz.forReqUser(request)to apply authorship and policies based on the user making the request - Backend clients (other trusted machines) reach Jazz through the main backend
- Writes are confirmed by the server before they count as durable
How frontends talk to Jazz
Frontends use the same query and write API as your server code. Your backend authenticates the user and applies your permission policies.
- Thin client: sends queries and writes to your backend without a local database, keeping the bundle small
- Opt-in local-first client: creates an embedded database on the device, so reads and writes work offline and sync when connected
Sync and local-first
- A local-first client keeps a local SQLite replica of the rows its queries need
- Reads are instant and work offline; writes apply locally and sync later
- The server stays the authority: it checks policies and settles conflicts
- Details: How Sync Works
Sharding
Sharding is coming soon. For many apps, one server is enough. Sharding is for apps that outgrow it:
- Adding shards spreads your data across several servers
- A stateless gateway routes queries and writes to the right shard
- Each live query sees a consistent result, even when its data spans shards
- Cross-shard transactions use two-phase commit
FAQ
Reset permanently deletes unsynced writes and local-only data in the selected namespace. Before resetting a cache you intend to resync, confirm that the required data is already on the configured server and that the same account can still access it. Reconnect to that server with the same account after resetting; app queries and subscriptions can then fetch the data permitted by current access rules. Local durability and ordinary shutdown do not prove server sync completed.
In browser apps using the React, Vue, Svelte, or Solid Jazz clients, keep the client open and run this in the devtools console:
await window.__jazz.clearStorage();
If the page has more than one live Jazz storage context, inspect the available namespaces and then choose one explicitly:
window.__jazz.listLiveStorageNamespaces();await window.__jazz.clearStorage("my-app::alice");
The helper requires a live registered client on this page. Do not shut it down before calling the helper. If the client never finishes opening or no live namespace is listed, this helper cannot perform the reset.
If you're working directly with a Db handle instead of the window helper, await db.deleteClientStorage() is the underlying API. See Resetting browser storage for how this differs from logout and the device account key's storage.
- Browser persistent storage only.
- If exactly one live namespace exists,
clearStorage()uses it automatically. - If multiple live namespaces exist, Jazz throws and lists the available namespaces until you choose one.
- Can be initiated from either leader or follower tabs; Jazz coordinates the reset across tabs for that namespace.
- Deletes only the selected IndexedDB namespace. Preserve
localStorage,sessionStorage, cookies, and other databases; a device account's key is stored outside this data database. Apps with custom credential stores must check those separately. - Reopens a clean worker/runtime so the same live client remains usable after the wipe.
This is useful when iterating on your schema during development. window.__jazz is registered by
every browser client, production builds included: it resets this browser's own storage and
closes this page's own clients, nothing more.
window.__jazz is Jazz's name, as is window.__jazzWindowStorageContexts__. If your app (or
another library) sets window.__jazz itself, Jazz leaves it alone, warns once on the console and
works without the helper: rename your own global to get window.__jazz.clearStorage() back.
useAll and QuerySubscription return undefined until the first response arrives from the requested tier. After that, the value is an array — empty ([]) if no rows match, or populated. See The loading state for details.
Yes. Pass serverUrl: null. Jazz will not try to sync: browser clients keep their data
in local persistent storage, while other runtimes use their configured local driver.
Yes. When a user signs up with an external provider, their identity carries over. See Signing up later.
Keep the result of the write and call wait() when your app needs to know whether the server
accepted it. A rejected write throws PersistedWriteRejectedError, which provides the server's
code, reason, and transactionId.
Use db.onMutationError() as a fallback for rejected writes that do not have an active wait()
call. The callback receives the rejection code, reason, and local transaction record. See
Writing data for an example and
Declarative Permissions for how the server decides whether to accept a write.
It's fast, embeddable, and simple to back up and inspect.