A database per agent: Turso, Neon, Supabase, Cloudflare D1 and Durable Objects compared on idle cost, limits and cold starts
What an idle database costs, how many you can create, cold starts, branching and backups across Turso, Neon, Supabase, Cloudflare and more, with rules for picking one.
Give an agent a shared database and it can drop every other agent’s tables. So agent platforms increasingly give each agent, task or user a database of its own. Neon said in 2025 that over 80% of its new databases were being created by agents. Supabase says it launches over a million databases a week, and on 2 October it agreed to buy Turso, a company built on hosting millions of small SQLite databases that sit mostly idle.
At that scale three questions matter most: what a database costs when nobody uses it, how many you can have, and how long one takes to wake. On some platforms an idle database costs a fraction of a cent of storage; on others, several dollars a month for a server that keeps running. Multiply by ten thousand agents and that decides your business model.
This guide compares Turso, Supabase, Neon, Cloudflare D1, SQLite-backed Durable Objects, Prisma Postgres, PlanetScale and Xata on cost, limits, cold starts, branching, migrations, backups, regions and agent tooling, then covers the patterns, the path from SQLite to Postgres, and rules for choosing.
All prices and limits come from each vendor’s own pricing pages and docs, read on 8 October 2026. We didn’t run or benchmark any of these services. Every latency figure below is the vendor’s own claim, and we say so each time.
The short version
- Cheapest idle database: Durable Objects, D1 and Turso, where idle costs only storage. Neon, Xata (scale to zero) and Prisma Postgres (per operation) come close.
- Most databases: Durable Objects (no object cap), Turso’s paid plans and Neon’s Agent Plan (“unlimited”), D1 (50,000 by default, raisable to millions).
- Real Postgres that scales to zero: Neon, with copy-on-write branching.
- A full backend per user app: Supabase, at about $10 a month per idle paid project unless you get partner access to scale-to-zero instances.
- Agents on Cloudflare: Durable Objects; the Agents SDK gives each agent its own SQLite database.
- Not for thousands of tiny databases: PlanetScale, at $5 a month minimum each.
Why give each agent its own database?
One shared database with a tenant_id column is the default for good reasons: one schema, one migration, one backup. Agents change the case:
- Blast radius. An agent with SQL access can run
DROP TABLE. In its own database, it can only wreck its own data. - Lifecycle. A task’s scratch database is deleted when the task ends, a user’s when they leave. Dropping a database is more certain than
DELETE ... WHERE tenant_id = ?across forty tables. - Schema freedom. App-building agents need to create and alter tables, which is risky in a shared schema.
- Noisy neighbours and residency. A runaway query slows only its own database, and one user’s data in one database is easy to place, export or erase.
The price is operational: thousands of schemas to migrate, thousands of credentials, and no easy query across all of them.
What an idle database costs
This is the number that decides whether “a database per agent” is affordable. Most per-agent databases are idle most of the time: created, used for one session, then left alone.
| Option | What an idle database costs | What stops the meter | Plan fee |
|---|---|---|---|
| Turso | Storage only: “Idle databases cost only storage” | Nothing to stop: Turso says there’s no process running | Free; Developer $4.99/mo yearly ($5.99 monthly) |
| Cloudflare D1 | Storage only; “An empty database consumes approximately 12 KB” | No compute billed without queries | Workers Paid $5/mo |
| Durable Objects (SQLite) | Storage only, if the object can hibernate | Objects that can hibernate “are not billed for duration” | Free plan, or Workers Paid $5/mo |
| Neon | Storage, plus restore history on paid plans | Scale to zero after 5 minutes by default | None (no monthly minimum) |
| Prisma Postgres | Storage, within the plan’s allowance (no idle charge listed) | Billed per operation, not per hour | Free; Starter $10/mo |
| Xata | Storage | Scale to zero after 30 minutes idle by default | None listed; 14-day trial |
| Supabase | About $10/mo (Micro compute, $0.01344/h) on paid plans | Only pausing; paid projects aren’t auto-paused | Pro from $25/mo, with $10 of compute credit |
| PlanetScale | $5/mo (smallest Postgres node), $15 with HA | Nothing: billed while provisioned | None; no free plan |
Highlighted rows are the options where an idle database costs only its storage.
The split is architectural. Turso, D1 and Durable Objects run no process for an idle database; Turso calls one “simply a set of files in object storage”. Neon and Xata run real Postgres but shut it down after a timeout, so the first query after a pause pays a wake-up. Supabase and PlanetScale give each database an always-on server: in Supabase’s words, “a dedicated Postgres instance running on its own server”.
Supabase’s platforms guide does offer scale-to-zero Nano instances, but “Only select customers have access” to that pricing. Its Free plan allows two active projects and pauses them “after 1 week of inactivity”.
Storage rates, the real idle cost
Where idle means storage only, this is your idle cost.
| Option | Storage included | Storage above that |
|---|---|---|
| Turso | Free 5 GB; Developer 9 GB; Scaler 24 GB; Pro 50 GB | $0.75/GB (Developer), $0.50 (Scaler), $0.45 (Pro) |
| Cloudflare D1 | 5 GB per account (free and paid) | $0.75/GB-month |
| Durable Objects | 5 GB (free and paid) | $0.20/GB-month |
| Neon | Free: 1 GB per project, 20 GB per account | $0.35/GB-month, plus $0.20/GB-month for restore history on paid plans |
| Xata | Not stated | $0.28/GB-month |
| Prisma Postgres | Free 1.01 GB; Starter 10 GB; Pro 50 GB; Business 100 GB | $2/GB (Starter) down to $1/GB (Business) |
| Supabase | 8 GB of disk per paid project | $0.125/GB |
| PlanetScale | First 10 GB per Postgres cluster | Varies by region and storage type |
Supabase’s per-GB rate is lowest, but its per-project compute dwarfs storage for small databases. Where idle means storage only, Durable Objects are cheapest.
For scale: 1,000 idle databases of 10 MB each (10 GB in total) cost well under $10 a month in storage at list rates on Turso, D1, Durable Objects, Neon or Xata, plus any plan fee. As 1,000 Supabase Micro projects they cost about $9,800 a month (1,000 × 730 hours × $0.01344, less a $10 credit), and as PlanetScale $5 nodes, $5,000. That’s one scenario; real fleets mix sizes and wake-ups, so work from the unit rates.
What a busy database costs
Once an agent is working, the billing models stop matching, so compare the units.
| Option | What you pay for when busy | Unit rates above plan allowances |
|---|---|---|
| Turso | Rows read, rows written, sync traffic | Reads $1 per billion; writes $1 per million (Developer; cheaper on higher plans) |
| Cloudflare D1 | Rows read, rows written | Reads $0.001 per million; writes $1.00 per million |
| Durable Objects | Requests, duration (GB-seconds), rows read, rows written | Requests $0.15/million; duration $12.50 per million GB-s; rows as D1 |
| Neon | Compute time (CU-hours; 1 CU ≈ 4 GB RAM) | $0.106/CU-hour (Launch), $0.222/CU-hour (Scale) |
| Xata | Instance hours | From $0.012/hour (micro, 1 GB) to $1.536/hour (32 vCPU, 128 GB) |
| Prisma Postgres | Operations (one Prisma Client query counts as one) | $8 per million (Starter), $2 (Pro), $1 (Business) |
| Supabase | Instance hours, whatever the load | Micro $0.01344/h, Small $0.0206/h, Medium $0.0822/h |
| PlanetScale | Instance size, prorated to the millisecond | PS-5 $5/mo; PS-10 from $10/mo; HA triples it |
Row-based allowances are generous: Workers Paid includes 25 billion rows read and 50 million written a month across D1, Turso Developer 2.5 billion and 25 million. But Turso’s FAQ warns that “Every row touched while producing a response counts, not just the rows returned”, so an unindexed lookup on a 100,000-row table bills 100,000 rows. On row-billed platforms, indexes are cost control.
For time-billed Postgres, what counts is hours awake. A Neon database at 0.25 CU running around the clock costs about $19 a month on Launch (182.5 CU-hours × $0.106); used an hour a day, under $1, plus five idle minutes per session before it suspends. Neon’s Free plan includes 100 CU-hours per project per month, which it says is “enough to run a 0.25 CU compute for 400 hours”.
Prisma ignores query time (“Whether a query takes 10ms or 10sec to execute, its pricing impact remains the same”), which favours heavy queries over chatty agents.
Prices are list prices as of 8 October 2026, taken from each vendor’s pricing page. They exclude egress, add-ons and taxes. We haven’t tested these services and aren’t affiliated with any of them, so confirm current rates with the vendor before committing.
How many databases you can have, and how big
| Option | Databases | Max size per database |
|---|---|---|
| Durable Objects | No limit on object count; 500 classes on paid | 10 GB per object |
| Turso | Free 100; paid plans “Unlimited” | No documented cap; optional per-database size limit |
| Neon | Free and Launch 100 projects; Scale 1,000 (raisable on request); Agent Plan “Unlimited” | Free 1 GB per project |
| Cloudflare D1 | Free 10; paid 50,000, raisable to “millions to tens-of-millions” | Free 500 MB; paid 10 GB, which “cannot be further increased” |
| Prisma Postgres | Free 50; paid 1,000; higher for partners on request | Set by plan storage |
| Supabase | Free 2 active projects; paid has no documented cap, but each costs compute | 8 GB disk included, expandable |
| PlanetScale | No documented cap | Set by cluster size |
| Xata (BYOC) | Priced by concurrent branches: up to 1,000, 10,000, 100,000 or more | Not stated |
Neon’s “unlimited” Agent Plan needs the Scale plan and an application; Neon raises limits “incrementally”, pays for your users’ free-tier projects and offers up to $25,000 in credits to companies not eligible for its startup program.
A Turso caveat: in June 2025 it capped monthly active databases on paid plans (500 on Developer, then $0.10 each). Today’s pricing page shows no such metric, and we couldn’t confirm whether it still applies, so ask. Every Turso branch and restore also “uses one of your available databases”, and Free-plan databases are archived after 10 days of inactivity.
API rate limits cap creation speed: Neon allows “700 requests per minute”, Supabase 120 a minute per endpoint, with project creation rate-limited per organisation and the Management API “subject to our fair-use policy”. Durable Objects need no creation call: the object and its database exist once you address its ID.
Cold starts and throughput
| Option | What happens when idle | Wake-up, vendor’s claim |
|---|---|---|
| Turso | Nothing runs; files stay in object storage | “no cold starts and no wake-up penalty” |
| Prisma Postgres | Stays ready | “no scale-to-zero and no cold starts”, which Prisma says “isn’t independently benchmarked” |
| Neon | Compute suspends after 5 minutes (configurable on paid) | “within a few hundred milliseconds”; first connection about 1–2 seconds for a new project |
| Xata | Branch suspends after 30 minutes | About 1 second on Xata Cloud, about 10 seconds self-hosted |
| Durable Objects | Hibernates after about 10 seconds idle | No number published; the constructor runs again on wake |
| Cloudflare D1 | Not documented | No number published |
| Supabase (paid) | Always on | None while running; paused Free projects must be restored |
| PlanetScale | Always on | None |
Supabase says Turso’s servers do load databases “when needed”; Turso’s claim is that you don’t notice. None of these figures is independently benchmarked, and we tested none.
The flip side of SQLite is throughput. D1 is “inherently single-threaded, and processes queries one at a time”: about 1,000 queries a second at 1 ms each, 10 at 100 ms. Durable Objects have a soft limit of 1,000 requests a second per object. Plenty for one agent; not for a database many users hammer at once. Turso’s new engine adds concurrent writes, but on Turso Cloud that engine is in “early preview”.
Isolation: what “its own database” actually means
- Durable Objects: each is “a single-threaded, globally-unique instance with its own persistent storage”. Code and data are bound together.
- D1: each database is backed by one Durable Object, but a Worker bound to many databases can reach all of them (up to about 5,000 bindings per script).
- Turso: each database is a separate SQLite file on a shared, “massively multitenant server”, with tokens scoped per database and optional per-database encryption keys.
- Neon: a project per tenant gives “complete data and resource isolation”, says its agent guide, with its own compute.
- Supabase and PlanetScale: a server per project or cluster, the strongest isolation and the dearest. PlanetScale’s logical databases share one cluster, but it says for “thousands of users, it’s best to use dedicated Postgres clusters.”
- Prisma Postgres: each database is its own instance on a unikernel-based architecture.
Branching, copies and backups
Agents fork state constantly: try something, keep it or throw it away. Copy-on-write branching makes that cheap.
| Option | Branch or copy | Point-in-time restore | Other backups |
|---|---|---|---|
| Turso | Copy-on-write, “effectively instant”; no extra usage cost; counts as a database | Free 1 day, Developer 10, Scaler 30, Pro 90 days; restores create a new database | Deleted databases recoverable for 5 days on paid plans |
| Neon | Copy-on-write, “instantly”; 10 per project (Free, Launch), 25 (Scale), 1,000 (Agent Plan) | Free 6 hours; Launch up to 7 days; Scale up to 30 days | Snapshots: 1 (Free), 100 (paid) |
| Xata | Copy-on-write, about 3 seconds whatever the source size (vendor claim) | Not confirmed | Not confirmed |
| Durable Objects | No fork; copy in your own code | 30 days, via bookmarks in the SQL API | None built in |
| Cloudflare D1 | No clone or fork yet (“planned”) | Time Travel: 30 days paid, 7 days free, always on and free of charge | Export to R2 for longer retention |
| Supabase | Branch is a new instance with no data by default; $0.01344 per branch-hour | Add-on: $100/mo per 7 days of retention | Daily: Pro 7 days, Team 14 days |
| Prisma Postgres | Database per preview; no data branching documented | None yet | Daily snapshots: 7 days (Starter, Pro), 30 days (Business) |
| PlanetScale | Branches are isolated databases with no data copied; from $5/mo each | 2 days | Every 12 hours, kept 2 days |
Highlighted cells are the cheapest way to fork a database with its data: a copy-on-write branch costs nothing until it diverges. D1 restores overwrite the database “in place”; Turso and Neon can restore into a new copy, safer when an agent wants to inspect the past. Turso’s “Accident Protection” also lets agents undelete databases through its MCP server.
Migrations across thousands of databases
No vendor here has a supported tool to roll a schema change across a fleet:
- Turso’s Multi-DB Schemas did that, and are deprecated for new users. Its docs suggest a
_schema_versiontable, sincePRAGMA user_versionis read-only. - D1 has
wrangler d1 migrations apply, one database at a time; you script the loop. - Durable Objects run migrations in the constructor inside
blockConcurrencyWhile(), so each object upgrades itself when it next wakes. For millions of idle objects that’s the only approach that scales, but your code must read every old schema still out there. - Neon documents a pattern: list projects through the API and run Drizzle migrations against each in CI.
- Supabase’s CLI migrations and declarative schemas target one linked project.
Our advice: keep a schema version in every database, make migrations additive and idempotent, and choose eager (a job loops through all databases) or lazy (each upgrades on first use). Lazy suits mostly idle fleets; eager suits fleets that must match before a deploy.
Regions and data residency
| Option | Where it runs | Residency controls |
|---|---|---|
| Durable Objects | Cloudflare’s network; 11 location hints | Jurisdictions: EU, US, FedRAMP; objects don’t move after creation |
| Cloudflare D1 | 6 location hints (no South America, Africa or Middle East) | Jurisdictions: EU, US, FedRAMP, set at creation only |
| PlanetScale | 19 regions (12 AWS, 7 GCP) | Region fixed per branch |
| Supabase | 17 AWS regions | Region choice; the “Europe” general region can land in London or Zurich, outside the EU |
| Turso | 10 AWS regions | Region per group; own S3 buckets on Pro |
| Neon | 8 AWS regions (Azure deprecated for new projects) | Region fixed at creation |
| Prisma Postgres | 6 regions | Region choice |
| Xata | AWS and GCP; full list not confirmed | BYOC on AWS, Azure or GCP |
Cloudflare’s jurisdictions are the only per-database residency setting here that the platform enforces; its location hints, by contrast, do “not guarantee” placement. The Durable Objects docs note that an object’s ID is still logged outside its jurisdiction. Supabase warns that “Region selection is a data-location control, not proof of regulatory compliance”.
SDKs, MCP servers and agent frameworks
Turso, Neon, Supabase, Prisma, PlanetScale and Xata all run an official hosted MCP server that lets an agent create databases and run SQL. Cloudflare’s answer is different: it builds the database into its agent runtime.
| Option | Official MCP server | Agent-specific features |
|---|---|---|
| Turso | mcp.turso.ai (create, branch, restore, query; audit-logged) |
Mastra’s LibSQLStore; plugins for Claude Code, Codex and Cursor; AgentFS |
| Neon | mcp.neon.tech (read-only mode available; Neon advises development use) |
Claimable Neon: agents provision without an account, unclaimed projects expire after 72 hours |
| Supabase | mcp.supabase.com (read-only mode, project scoping, cost confirmation before creating projects) |
Project-claim OAuth flow for platforms; app MCP servers that run under each user’s row-level security |
| Prisma Postgres | mcp.prisma.io (create and delete databases, backups, recovery, SQL) |
npx create-db makes a temporary database that lasts 24 hours unless claimed |
| PlanetScale | mcp.pscale.dev (scoped tokens, read-only or full) |
Insights-only variant without query tools |
| Xata | api.xata.tech/mcp (data-changing SQL needs explicit confirmation) |
Branch per pull request through a GitHub App |
| Durable Objects | Not a database MCP server; the Agents SDK builds MCP servers and clients | Every Agent is a Durable Object with its own SQL database and a sql template tag |
| Cloudflare D1 | We didn’t review Cloudflare’s own MCP servers for D1 | Workers bindings; databases created through the API |
Supabase’s MCP docs say “you should not give it to your customers or end users”. Treat each of these servers as an admin credential and scope agents’ tokens to their own database. If your agent builds apps for users, Neon, Prisma and Supabase all let it create a database first and hand ownership to a human later.
Which pattern fits: per agent, per task, per user or per tenant
- Per agent (one long-lived agent’s memory and state): small, long-lived, mostly idle databases, so idle cost decides. Durable Objects, where the agent is the object, or Turso.
- Per task (a scratchpad for one job, deleted afterwards): creation speed, branching from a template and easy deletion matter. Neon or Turso branches, or D1 and Durable Objects. Pair it with a sandbox for code.
- Per user (each user’s data, with agents acting inside it): personal assistants and local-first apps. SQLite shines, and Turso’s sync can put a copy on the user’s device.
- Per tenant (one customer organisation, many users): bigger, busier databases, so Postgres (Neon, Supabase, PlanetScale) and its size and connection limits matter more than idle cost.
- Shared with row-level security: still right when tenants are many, tiny and alike and you query across them. With Supabase’s new app MCP servers, “every tool call runs as that user”, and row-level security decides what each client sees.
A useful rule: isolate at the level where you’d want to delete, restore or move data in one go.
From many small SQLite databases to Postgres
The Supabase–Turso deal bets that people start on SQLite and outgrow it. Turso’s post promises that “when SQLite isn’t enough, you can move into standard Postgres through the Supabase ecosystem”. Neither company describes a tool, price or timeline, and both describe the deal as under way, not closed. Until a tool exists, plan the move yourself:
- Know the triggers: nearing a size cap (10 GB on D1 and Durable Objects), many concurrent writers, Postgres extensions such as pgvector, or reporting across tenants.
- Write portable SQL. SQLite types are loose: pick date formats both read, avoid SQLite-only functions, use a query builder that targets both.
- Graduate one tenant at a time to its own Postgres project, while the long tail stays on SQLite. Or consolidate into one Postgres database with a
tenant_idand row-level security, a bigger job because every query needs the filter. - Or start on Postgres. Neon, Prisma and Xata make an idle Postgres database cost little more than storage, and Neon’s PGlite runs Postgres inside sandboxes.
To self-host SQLite, libSQL’s sqld (MIT) serves many databases as namespaces, with optional replication to S3, but its README says “new features are being developed in Turso”, whose cloud now runs a closed-source server.
Which one should you use?
- Your agents run on Cloudflare Workers: use Durable Objects, one per agent or user. No object limit, cheaper storage than D1, 30-day restore, EU jurisdiction. Pick D1 to query from many Workers or for
wranglermigrations and read replicas (beta). - You need SQLite databases at very large numbers, anywhere: use Turso. Idle costs only storage, branches are free copy-on-write, and MCP and restore are built for agents. Ask about the active-database limit and watch the Supabase deal.
- You need real Postgres, one database per agent or task, mostly idle: use Neon. Apply for the Agent Plan past 100 projects.
- Each user gets a whole app backend (auth, storage, functions): use Supabase, budgeting about $10 per active project per month, or apply for platform access to Nano instances that scale to zero.
- You use Prisma and want per-operation billing with no cold starts: use Prisma Postgres, as long as 1,000 databases per workspace (or a partner deal) is enough and you can live without point-in-time restore.
- You want to branch a large production Postgres for each coding agent: look at Xata, whose branches take seconds whatever the database size.
- A few big tenants with heavy, steady load: use PlanetScale, or a dedicated Neon or Supabase project per tenant.
- Tenants are many, tiny and alike, and you need queries across them: don’t split. Use one Postgres database with row-level security.
FAQ
What is a database per agent?
Each AI agent, task or user gets its own isolated database instead of sharing tables keyed by tenant_id. The agent can change its schema and data without touching anyone else’s, and each database can be deleted, restored or moved alone. It’s practical now because several vendors charge almost nothing for an idle database.
What’s the cheapest way to give every AI agent its own database?
The SQLite-based services: Cloudflare Durable Objects, Cloudflare D1 and Turso. An idle database there costs only its storage. Durable Objects storage is $0.20 per GB-month above 5 GB, and D1 and Turso charge $0.75 on their entry plans. Among Postgres options, Neon, Prisma Postgres and Xata make an idle database cost close to its storage.
Does Supabase scale to zero?
Not by default. Paid Supabase projects run on dedicated compute billed by the hour, about $10 a month for Micro, whether or not they get queries, and paid projects aren’t auto-paused. Supabase offers scale-to-zero Nano instances only to select platform customers. Free projects pause after a week of inactivity.
How many databases can I create on Cloudflare D1?
10 on the free plan and 50,000 on Workers Paid. Cloudflare says it can raise that to millions per account on request. Each database is capped at 500 MB on free and 10 GB on paid, and the 10 GB cap can’t be raised.
What happens to Turso now that Supabase is acquiring it?
Both companies say Turso keeps running, existing users see no change and Turso Database stays open source. Supabase promises a path from Turso’s SQLite into Supabase Postgres as workloads grow, but hasn’t described a tool, pricing or timeline, and neither post says the deal has closed.
How long does a Neon database take to wake from scale to zero?
Neon says a suspended database “reactivates automatically within a few hundred milliseconds”, and its agent guide says a brand-new project’s first connection takes about one to two seconds. By default compute suspends after five minutes idle. Paid plans can change that, and the Scale plan allows anything from one minute to always on.
How do I run migrations on thousands of tenant databases?
No vendor here has a supported tool. Track each database’s schema version in a table and migrate eagerly (a job loops through every database) or lazily (each upgrades on first use), as Cloudflare recommends for Durable Objects with blockConcurrencyWhile().
