# Jazz

> Jazz is a relational database that runs inside your backend, with real-time queries and permissions built in.

**Start here as an agent:** before building with Jazz, read the [Agent Quickstart](https://jazz.tools/quickstart.md). It walks you through the decisions to make with your user and how to build, test and ship.

This file is an index of the docs. Append `.md` to any docs page URL for Markdown.
Search the docs as Markdown: GET https://jazz.tools/api/search?q=<words>&format=md (add &full=1 to inline the top pages).

## Overview

- [Overview](https://jazz.tools/docs.md): Get a first glimpse of how to set Jazz up and how to use it from the server and clients.
- [Why Jazz / Comparisons](https://jazz.tools/docs/why-jazz.md): See what sets Jazz apart, how it compares to the tools you might know, and what it changes for a team.
- [How Jazz Works / FAQ](https://jazz.tools/docs/how-jazz-works.md): Learn the mental model behind Jazz, how backends and clients talk to it, and find answers to common questions.

## Setup

- [Quickstart](https://jazz.tools/docs/setup/run-locally.md): See how your coding agent sets Jazz up in your app, what it asks you, and how it checks it's done.
- [Next.js, Better Auth and Vercel](https://jazz.tools/docs/setup/nextjs-better-auth.md): Build a Jazz app on the default stack, end to end on one page: Next.js, Better Auth, the thin client, deployed to Vercel.
- Main Backend
  - [Vercel](https://jazz.tools/docs/setup/deployment/vercel.md): Learn how to run Jazz inside your Next.js app on Vercel, with each environment's data in its own Sandbox.
  - [Jazz Cloud](https://jazz.tools/docs/setup/deployment/jazz-cloud.md): Learn how to keep your app's data on Jazz Cloud, with your own backend in front for auth.
  - [Your Own Server](https://jazz.tools/docs/setup/deployment/own-server.md): Learn how to run Jazz in your own Node server, VM or container, with the data in SQLite on its disk.
- Auth
  - [How Auth Works in Jazz](https://jazz.tools/docs/setup/auth/backend.md): Learn how your backend decides who a user is, how the browser follows your auth, and what a session is.
  - [Better Auth](https://jazz.tools/docs/setup/auth/better-auth.md): Learn how to sign users in with Better Auth and connect its session to Jazz.
  - [WorkOS](https://jazz.tools/docs/setup/auth/workos.md): Learn how to sign users in with WorkOS AuthKit and connect its session to Jazz.
  - [Other / Custom](https://jazz.tools/docs/setup/auth/custom.md): Learn how to connect any other auth library, or your own sign-in, to Jazz.
  - [Device Accounts](https://jazz.tools/docs/setup/auth/local-first.md): Let users start as guests, with no sign-in, and keep their data when they sign up: device accounts are Jazz's local-first friendly auth method.

## Clients

- Browser
  - [Thin Client](https://jazz.tools/docs/setup/web-client/thin-client.md): Learn how to set up the thin browser client, which talks to your backend with no local database.
  - [Local-First Client](https://jazz.tools/docs/setup/web-client/local-first-client.md): Learn how to set up the local-first browser client, from bundler config to local storage and sync.
- [React Native](https://jazz.tools/docs/setup/react-native.md): Learn how to use Jazz from React Native and Expo apps.
- [Backend Client](https://jazz.tools/docs/setup/backend-client.md): Learn how to connect other trusted machines to Jazz through your main backend, for machine-to-machine access.

## Working with Data

- Schemas & Policies
  - [Defining Tables](https://jazz.tools/docs/schemas/defining-tables.md): Learn how to define tables and the relations between them in schema.ts.
  - [Column Types](https://jazz.tools/docs/schemas/column-types.md): Look up every column type in the schema DSL and what it maps to in SQL.
  - [Relationships](https://jazz.tools/docs/schemas/relationships.md): Learn how to model references between tables with UUID columns, s.rel and s.reverse.
  - [Declarative Permissions](https://jazz.tools/docs/schemas/policies.md): Learn how to write declarative permissions, from simple ownership to relationship-based access, and how to test them.
  - [Migrations](https://jazz.tools/docs/schemas/migrations.md): Learn how to change your schema while older clients keep working.
- Reading Data
  - [Queries](https://jazz.tools/docs/reading/queries.md): Learn how to run one-shot queries and subscriptions, use the framework hooks and Suspense, and choose read durability.
  - [Filters, Sorting & Pagination](https://jazz.tools/docs/reading/filters-and-sorting.md): Learn how to filter rows with where(), sort them with orderBy() and page through them with limit and offset.
  - [Includes & Relations](https://jazz.tools/docs/reading/includes-and-relations.md): Learn how to load related rows with include(), pick columns with select() and run recursive queries.
  - [Edit Metadata](https://jazz.tools/docs/reading/metadata.md): Learn how to read who created and changed a row, and when, through magic columns like $createdBy and $createdAt.
  - [Loading Tiers](https://jazz.tools/docs/reading/loading-tiers.md): Learn how to choose how long a read waits for the server.
  - [History](https://jazz.tools/docs/reading/history.md): Learn how to query and subscribe to earlier versions of your data.
- Writing Data
  - [Writing Data](https://jazz.tools/docs/writing/writing-data.md): Learn how to insert, update and delete rows, show sync status and handle write errors.
  - [Transactions](https://jazz.tools/docs/writing/transactions.md): Learn how to group reads and writes into one mergeable or serializable transaction.
  - [Mergeable Text](https://jazz.tools/docs/writing/text.md): Learn how to store prose as Markdown that merges concurrent edits.

## Running Jazz

- Operating Jazz
  - [Backups & Upgrades](https://jazz.tools/docs/operating/backups-and-upgrades.md): Learn how to keep the data in your backend's Jazz directory safe and upgrade it across releases.
  - [Monitoring](https://jazz.tools/docs/operating/monitoring.md): Learn how to watch Jazz inside your backend: tracing, slow queries, memory and alerts.
  - [Scaling & Sharding](https://jazz.tools/docs/operating/scaling.md): Find out what to do when one Jazz server is no longer enough.
- Tooling
  - [CLI & MCP](https://jazz.tools/docs/tooling/cli-and-mcp.md): Learn what the jazz-tools command line does, and how agents use your app's data through its MCP server.
  - [Inspector](https://jazz.tools/docs/tooling/inspector.md): Learn how to look at your app's data, and let agents debug it, through your own backend.
  - [Testing](https://jazz.tools/docs/tooling/testing.md): Learn how to test your Jazz app, on its own and through your app's backend.

## Recipes

- Local-first
  - [Local-First Data Model](https://jazz.tools/docs/recipes/local-first/local-first-data-model.md): Learn how Jazz keeps local state, row histories and conflicts, and how loading behaves.
  - [How Sync Works](https://jazz.tools/docs/recipes/local-first/how-sync-works.md): Look under the hood at subscriptions, local replicas, tiers and merges.
- [Branches](https://jazz.tools/docs/recipes/drafts-and-branches.md): Learn how to model your app's own branches with ordinary columns and head-over-base views.
- Access Control
  - [User-owned data](https://jazz.tools/docs/recipes/access-control/user-owned-data.md): Build the most common Jazz pattern end to end: data that belongs to the user who created it.
  - [Shared access between users](https://jazz.tools/docs/recipes/access-control/shared-access.md): Build sharing between users with a shares table and existence-based permissions.
  - [Invite links](https://jazz.tools/docs/recipes/access-control/invite-links.md): Build share links that grant access to a private resource without knowing the recipient in advance.
  - [Group permissions](https://jazz.tools/docs/recipes/access-control/group-permissions.md): Build a workspace with roles, using a members table and existence-based permissions.
- Data Patterns
  - [Real-time collaborative list](https://jazz.tools/docs/recipes/data-patterns/real-time-collaborative-list.md): Build a list that several users subscribe to and see each other's changes in real time.
  - [Collaborative text editing](https://jazz.tools/docs/recipes/data-patterns/collaborative-text-editing.md): Build text that several people edit at once, online or offline, with a text merge column.
  - [Rich text editor](https://jazz.tools/docs/recipes/data-patterns/rich-text-editor.md): Connect a ProseMirror editor to a Markdown merge column, then draw comments and other people's cursors over the text.
  - [Nested data with permission inheritance](https://jazz.tools/docs/recipes/data-patterns/nested-data.md): Build a project, task and comment hierarchy whose permissions are inherited, with queries and multi-level inserts.
- [Effect](https://jazz.tools/docs/recipes/effect.md): Learn how to use Jazz from Effect v4 programs, in the browser and on the server.

## Reference

- [WHERE Operators](https://jazz.tools/docs/reference/where-operators.md): Look up every filter operator for each column type, with examples.
- [Durability Tiers](https://jazz.tools/docs/reference/durability-tiers.md): Look up the read and write durability tiers and how far each one waits for data to travel.
- [Framework Patterns](https://jazz.tools/docs/reference/framework-patterns.md): Look up the matching Jazz API in React and Expo, Vue, Svelte and Solid.
- [Examples](https://jazz.tools/docs/reference/examples.md): Find the example app that shows what you're looking for.
- [Advanced Internals](https://jazz.tools/docs/reference/internals.md): Look under the hood at raw tables, row histories, sync, the query pipeline and the browser architecture.
- [Local-first auth internals](https://jazz.tools/docs/reference/local-first-auth-internals.md): Look under the hood at how a local signing identity founds an offline account and links other identities.
- [Changelog](https://jazz.tools/docs/changelog.md): Every Jazz 2 release, newest first, with links to its full release notes.
