StitchDB vs Xata: Branching Postgres or a Full Backend?
Xata and StitchDB both run standard Postgres and both care about branching, but they are different kinds of product. Xata is a branch-native Postgres platform: copy-on-write branches of production with built-in anonymization, scale-to-zero, and the choice of Xata Cloud, your own cloud account (BYOC) or self-hosting the open source edition. StitchDB is a complete app backend on a dedicated Postgres database per project, with Auth, REST and GraphQL APIs, Realtime, Storage, Edge Functions and preview branches built from migrations. Choose Xata when you need the database and the best branching of large datasets; choose StitchDB when you want the whole backend in one place.
#At a glance
| Xata | StitchDB | |
|---|---|---|
| What it is | Managed Postgres platform with storage-level branching | Hosted backend: Postgres + Auth, APIs, Realtime, Storage, Functions |
| Postgres | Standard, unmodified Postgres | Standard Postgres 17 locally; dedicated database per project hosted |
| Branches | Copy-on-write from production, share unchanged data | Separate database per branch, built from migrations and seed; optional masked production data |
| Anonymization | Built in for production clones | Masking by column name and type, rules editable in SQL comments |
| Idle behavior | Branches hibernate, wake on first query (~1 s cloud, ~10 s open source) | Idle preview branches pause after 3 days; restore from their page |
| Auth, REST, storage | Not included | Included |
| Deployment | Xata Cloud (AWS, GCP), BYOC (AWS, Azure, GCP), self-hosted open source | Managed only, EU data centers |
| Pricing (as of November 2026) | Cloud from $0.012/hour per instance + $0.28/GB-month storage; 14-day trial | Free $0; Pro $15.99/mo; Scale $49/mo |
| Compliance listed | SOC 2, GDPR; BAA on BYOC | EU hosting; see security page |
Xata details are from xata.io and xata.io/pricing.
#Branching, compared honestly
Both platforms promise "a database for every pull request". They get there differently, and the difference matters with large data.
Xata branches at the storage layer. A branch shares unchanged pages with its parent and only stores what it changes, so a branch of a large production database is fast and cheap to create. Branches can be production-like with built-in anonymization, and idle ones hibernate and stop using compute.
StitchDB gives each preview branch its own Postgres database, URL, keys, Auth users, storage and functions. It is built from production's migrations (or a copy of its schema) and then seed.sql. You can optionally copy production data with personal data masked: e-mails, phone numbers, names, addresses, IPs, birth dates and tokens are replaced inside production's own query, the same real value gets the same fake value everywhere so joins still work, and passwords are removed (or replaced with one test password). Masking rules can live in your migrations:
comment on column public.tickets.body is '@mask text'; -- replace with placeholder textYou can also create a branch from a point in time via Backups, which starts with production's data as it was at that moment.
stitchdb branches create pr-142 --with-data --wait
stitchdb branches switch pr-142
stitchdb db pushThe trade-off: a StitchDB branch with copied data takes time proportional to the data, while a Xata copy-on-write branch does not. In return, each StitchDB branch is a full backend, so your preview deployment can sign users in, upload files and call functions against an isolated copy. Branches are on paid plans (Pro: 3 per project) and the GitHub App can create one per pull request with a check and a comment. See GitHub integration.
#Database vs backend
With Xata you get Postgres and connect with any driver or ORM. Your app still needs auth, an API layer and file storage from somewhere.
With StitchDB, a table is an API the moment it exists, and access is per user through row level security:
create table public.tickets (
id bigint generated always as identity primary key,
user_id uuid not null default auth.uid() references auth.users,
subject text not null,
body text,
created_at timestamptz not null default now()
);
alter table public.tickets enable row level security;
create policy "own tickets" on public.tickets for all to authenticated
using (user_id = auth.uid()) with check (user_id = auth.uid());const { data } = await stitchdb.from('tickets').select('id, subject, created_at')You can still connect ORMs and SQL tools directly on port 5432 or 6543. See connect.
#Pricing models
Xata Cloud is resource-based: you pay per instance-hour (micro at $0.012/hour, about $9/month, up to 8xlarge at $1.536/hour) plus $0.28 per GB-month of storage, with no charge per branch or per database (as of November 2026). Branches that hibernate stop using compute. There is no ongoing free cloud tier, but the open source edition is free to self-host.
StitchDB has flat plans (as of November 2026): Free $0 (2 projects, 500 MB database each, no branches), Pro $15.99/month (10 GB database, 100 GB files, 1 TB egress, 100,000 MAU, 3 branches per project), Scale $49/month (20 GB database, 2 TB egress). Branches share the account's database and file quota. Paid plans start with a spend cap on. See pricing.
#Where they run
Xata runs on AWS and GCP in its cloud, in your own AWS, Azure or GCP account with BYOC, or on your servers with the open source edition. StitchDB runs only in its EU data centers in Germany (Falkenstein, Nuremberg) and Finland (Helsinki), with no BYOC or self-hosting. If data must stay inside your own cloud account, Xata is the clear choice.
#A pull request workflow on each
On Xata: your CI creates a branch from production for the pull request, the preview deployment connects to it with a connection string, and the branch hibernates when idle. Auth, file storage and the API for the preview come from your other services, pointed at test configurations.
On StitchDB: install the GitHub App, and every pull request gets a preview branch with its migrations applied, a check and a comment with the branch URL. The preview deployment uses the branch's API URL and anon key, so sign-up, sign-in, uploads, realtime and functions all run against the isolated copy. Auth settings such as providers and redirect URLs are copied from production. When the pull request closes, delete the branch, or let it pause after 3 idle days.
// preview build: same code, branch URL and key from env
const stitchdb = createClient(process.env.STITCHDB_URL, process.env.STITCHDB_ANON_KEY)If your previews only need a database, Xata's flow is lighter and faster with big data. If they need the whole backend, StitchDB's flow needs fewer moving parts.
#Using them together
Nothing stops you from mixing: some teams keep a large analytical Postgres on a branching platform and run the app backend separately. StitchDB's Import from Postgres can copy from any Postgres 12+ with a live copy when logical replication is available, and every StitchDB project can export a standard pg_dump, so moving data in either direction uses normal tools.
#Verdict
Choose Xata if you need BYOC or self-hosting, instant branches of a large production database, built-in anonymization for those clones, or you only need a database and already have auth and APIs.
Choose StitchDB if you want a full backend per project, preview branches that include auth, storage and functions, flat pricing with a free tier, and EU-only hosting.
For more options see Xata alternatives and database branching for preview environments.
#FAQ
#Is Xata still a serverless database with its own API?
No. Xata Lite was retired on February 28, 2026. The current Xata is a Postgres platform with copy-on-write branching.
#Are StitchDB branches copy-on-write?
No. Each branch is its own database built from migrations, optionally filled with masked production data or restored from a point in time.
#Does Xata include authentication?
Xata's current platform is a Postgres database platform; auth and storage are not part of it.
#Can I self-host StitchDB like Xata's open source edition?
No. StitchDB is managed only. For local development, stitchdb start runs the full stack on your machine without Docker.
Get branching plus Auth, APIs and Storage in one project: create a StitchDB account.