Database per AI agent: Turso vs Neon vs Supabase vs Cloudflare D1 compared
Cheapest per-agent databases: Durable Objects, D1 (up to 100,000 databases) and Turso charge only storage when idle; Neon is the Postgres that scales to zero; Supabase costs about $10 a month per idle project. Limits, cold starts and branching compared.
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, Xata and Google’s AlloyDB Express 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, first read on 8 October 2026 and re-checked on 24 November 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
- The cheapest idle databases are Durable Objects, D1 and Turso, where idle costs only storage. Neon, Xata, AlloyDB Express (scale to zero) and Prisma Postgres (per operation) come close.
- For the most databases, use Durable Objects (no object cap), Turso’s paid plans or Neon’s Agent Plan (both “unlimited”), or D1 (up to 1,000,000 per account, with $0.10 a month for each one past 100,000).
- For real Postgres that scales to zero, Neon is the established choice, with copy-on-write branching; Google’s AlloyDB Express also scales to zero but is a preview with no backups.
- For a full backend per user app, Supabase costs about $10 a month per idle paid project unless you get partner access to scale-to-zero instances.
- For agents on Cloudflare, use Durable Objects; the Agents SDK gives each agent its own SQLite database.
- PlanetScale, at $5 a month minimum each, doesn’t suit thousands of tiny databases.
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:
- An agent with SQL access can run
DROP TABLE. In its own database, it can only wreck its own data. - 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. - App-building agents need to create and alter tables, which is risky in a shared schema.
- 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 for the first 100,000 databases; $0.10/mo for each one above that, “even when it is empty or receives no traffic” | 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 (no minimum fee); free trial |
| AlloyDB Express (preview) | Storage; “You aren’t billed for compute while the instance is paused” | Pauses after 15 minutes idle, per Google’s blog | None; billing starts December 2026 |
| Supabase | About $10/mo (Micro compute, $0.01344/h) on paid plans | Nothing: “Projects under a paid plan cannot be paused” | Pro from $25/mo, with $10 of compute credit |
| PlanetScale | $5/mo (smallest Postgres node), $15 with HA | Nothing automatic; manual sleep is in beta, cost not published | None; no free plan |
Highlighted rows are the options where an idle database costs only its storage (on D1, up to 100,000 databases per account).
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, Xata and AlloyDB Express run real Postgres but shut the compute 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”.
D1’s per-database charge is new since this guide was first published: its pricing and limits pages now say Workers Paid “includes 100,000 databases per account”, then $0.10 a month each, up to 1,000,000. A Durable Object can also stay billed while it waits: for Workers with a compatibility date of 1 October 2026 or later, each pending I/O operation can keep an object alive for up to 15 minutes, and “Duration charges continue while an operation prevents eviction.”
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”. PlanetScale added sleep and wake for Postgres in beta on 20 November, but it is manual (dashboard or API), a new connection doesn’t wake the database, and PlanetScale’s docs don’t say what a sleeping database costs.
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 | None listed | $0.28/GB-month (more in Frankfurt and Singapore) |
| AlloyDB Express | Free tier: 2 GB a month per billing account for the first 12 months | $0.30/GB-month (us-west1; more in other regions) |
| Prisma Postgres | Free 2 GB (shared across the workspace); 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. At a million databases, D1’s per-database fee adds $90,000 a month (900,000 above the included 100,000, × $0.10; our arithmetic), while Durable Objects and Turso’s paid plans add nothing per database. Real fleets mix sizes and wake-ups, so work from the unit rates.
How we chose
We picked services that create databases through an API in seconds and are used for one database per agent, task or user: SQLite services built for many small databases (Turso, D1, Durable Objects), Postgres that scales to zero or bills per use (Neon, Prisma Postgres, Xata, AlloyDB Express), and Supabase and PlanetScale, the dedicated-server Postgres options we weigh per-agent designs against; Neon’s figure on agent-created databases and Supabase’s on databases launched per week are quoted at the top. AlloyDB Express was added on 24 November, after Google launched it in preview for coding agents.
Xata is joining ClickHouse (announced 9 November): it says “Nothing changes for Xata customers in the short term”, but it “will eventually migrate Xata customers to ClickHouse Managed Postgres”, which became generally available alongside the deal.
Left out: Fly.io’s $4 Managed Postgres Developer plan pauses after 15 idle minutes but is a fixed fee per cluster, like PlanetScale’s $5 node; Databricks Lakebase runs Neon’s technology inside a Databricks workspace rather than as a standalone service; Amazon Aurora Serverless and other cloud Postgres services provision one cluster at a time and suit per-tenant rather than per-agent use, which our Postgres hosting comparison covers.
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) |
| AlloyDB Express | Compute time, billed per second (1 CU = 1 vCPU and 4 GB RAM) | $0.115/CU-hour (us-west1); free tier of 50 compute units a month for 12 months |
| 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 about 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 24 November 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 1,000,000, of which 100,000 are included | 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 |
| AlloyDB Express | Not stated for Express; AlloyDB’s general quota is 3 to 10 clusters per project per region (20 at most) | 20 GB in preview; writes stop at the cap |
| Supabase | Free 2 active projects; paid has no documented cap, but each costs compute | 8 GB disk included, expandable |
| PlanetScale | No documented cap on databases; 100 development branches per database by default, raisable to 5,000 | Set by cluster size |
| Xata (BYOC) | Priced by concurrent branches: up to 1,000, 10,000, 100,000 or more | Not published on Xata’s pricing page |
The highlight marks the one unlimited count that needs no paid plan or application (Turso’s paid plans and Neon’s Agent Plan are also unlimited).
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.
Turso removed its cap on monthly active databases in May 2026 (“Now, that limit is gone”), so the paid plans’ “Unlimited” means what it says. Every Turso branch and restore still “uses one of your available databases”, and Free-plan databases are archived after 10 days of inactivity.
Google pitches one AlloyDB Express cluster per test or agent database (a cluster can hold several Postgres databases), but its docs don’t say whether Express clusters count against AlloyDB’s cluster quota. If they do, one cluster per agent stops at 20 per project per region, so ask before planning a fleet on it.
API rate limits cap creation speed: Neon allows “700 requests per minute”, and Supabase 120 a minute per endpoint, with 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 | “Prisma Postgres has no cold starts”; its docs don’t describe scale to zero or a wake time |
| Neon | Compute suspends after 5 minutes (Launch can only turn this off; Scale sets 1 minute to always on) | “within a few hundred milliseconds”; a new project is provisioned in “typically under 1 second” |
| Xata | Branch suspends after 30 minutes | About 1 second on Xata Cloud, about 10 seconds self-hosted |
| AlloyDB Express | Pauses after 15 minutes idle (Google’s blog) | About 20 seconds, per the docs; a new database is ready in about 2 seconds |
| 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, unless put to sleep by hand (beta) | None while running; a sleeping database must be woken from the dashboard or API, and no wake time is published |
Supabase says Turso’s servers do load databases “when needed”. 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
What separates one database from the next ranges from a whole server to a file on a shared one.
| Option | What one database is | What keeps databases apart |
|---|---|---|
| Durable Objects | “a single-threaded, globally-unique instance with its own persistent storage” | Code and data are bound together; storage is reachable only from inside the object |
| Cloudflare D1 | A database backed by one Durable Object | Bindings: a Worker bound to many databases can reach all of them (up to about 5,000 bindings per script) |
| Turso | A separate SQLite file on a shared, “massively multitenant server” | Tokens scoped per database; per-database encryption keys on Pro and Enterprise |
| Neon | A project with its own compute | “complete data and resource isolation”, says its agent guide |
| AlloyDB Express | A cluster with one instance | A separate cluster with its own single-node instance; admins’ IAM, network and organisation policies apply to every new one |
| Supabase | A project on its own server | A dedicated instance per project, the strongest isolation and the dearest |
| PlanetScale | A cluster on its own server | A dedicated cluster, the strongest isolation and the dearest; logical databases can share one, but PlanetScale says for “thousands of users, it’s best to use dedicated Postgres clusters” |
| Prisma Postgres | Its own instance | 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); extra branches $1.50 per branch-month on paid plans | 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 in Xata’s docs or pricing as of 24 November | Not in Xata’s docs or pricing as of 24 November |
| AlloyDB Express | None documented; upgrades one-way to full AlloyDB | None in preview | None in preview: “automated backups, on-demand backups, PITR, and Backup and DR aren’t supported” |
| 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; Cloudflare says only “In the future” | Time Travel: 30 days paid, 7 days free, always on and free of charge | Export to R2 for longer retention; deleted databases can be undeleted within 7 days |
| Supabase | Branch is a new instance with no data unless you seed it or choose “Include data”; $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 (Prisma says it’s coming in November 2026) | 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. 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, for fleets that must match before a deploy) or lazy (each upgrades on first use, for mostly idle fleets).
Regions and data residency
| Option | Where it runs | Residency controls |
|---|---|---|
| Durable Objects | Cloudflare’s network; 11 location hints (South America, Africa and Middle East hints start nearby instead) | 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 | 22 regions (12 AWS, 7 GCP, 3 Azure; Azure for Postgres and Neki, not Vitess) | Region fixed per branch |
| Supabase | 17 AWS regions | Region choice; the “Europe” general region can land in London or Zurich, outside the EU |
| Turso | 12 AWS regions | Region per group; BYOC in your own AWS account on Enterprise |
| Neon | 8 AWS regions (Azure deprecated for new projects) | Region fixed at creation |
| AlloyDB Express | 7 Google Cloud regions in preview (Asia, Australia, London and us-west1; none in central or eastern US) | Region choice; Google lists data-residency support among its governance controls |
| Prisma Postgres | 6 regions | Region choice |
| Xata | 5 Xata Cloud regions (AWS us-east-1, us-west-2, eu-central-1; GCP us-central1, asia-southeast1) | Region choice; BYOC on AWS, Azure or GCP |
Highlighted cells are residency settings the platform enforces per database: Cloudflare’s jurisdictions keep data inside the EU, the US or FedRAMP boundaries, while its location hints 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, Xata and Google run official hosted MCP servers that let an agent create databases and run SQL, and Cloudflare’s general API MCP server does the same for D1. PlanetScale’s lets an agent query but not create databases. For Durable Objects, Cloudflare builds the database into its agent runtime instead.
| 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 or branches; destructive-SQL warnings in supporting clients) |
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; admins can cap query access; no tool to create databases or branches) |
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 |
| AlloyDB Express | AlloyDB’s remote MCP server (alloydb.googleapis.com/mcp) creates Express clusters and runs SQL |
Google Cloud policies apply to every database an agent creates |
| 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 | Cloudflare API MCP server (mcp.cloudflare.com), whose search() and execute() tools call the D1 API; the older Workers Bindings server is deprecated |
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; Supabase now offers project-scoped access tokens. 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
A useful rule: isolate at the level where you’d want to delete, restore or move data in one go.
| Pattern | What it holds | What decides the choice | Good fits |
|---|---|---|---|
| Per agent | One long-lived agent’s memory and state | Idle cost: databases are small, long-lived and mostly idle | 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, easy deletion | Neon or Turso branches, D1, Durable Objects or AlloyDB Express; pair it with a sandbox for code |
| Per user | Each user’s data, with agents acting inside it | Sync and portability, for personal assistants and local-first apps | SQLite: Turso’s sync can put a copy on the user’s device |
| Per tenant | One customer organisation, many users | Size and connection limits more than idle cost | Postgres: Neon, Supabase, PlanetScale |
| Shared, with row-level security | Many tiny, similar tenants you query across | Cross-tenant queries | One Postgres database; with Supabase’s app MCP servers, “every tool call runs as that user” |
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. Turso’s later posts call it “part of Supabase”, but as of 24 November neither company has published a closing announcement. 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, Xata and AlloyDB Express 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”.
Which one should you use?
- If 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); past 100,000 databases it costs $0.10 a month each. - If you need SQLite databases in very large numbers, anywhere, use Turso. Idle costs only storage, there’s no cap on databases on paid plans, branches are free copy-on-write, and MCP and restore are built for agents. Watch the Supabase deal.
- If you need real Postgres, one database per agent or task, mostly idle, use Neon. Apply for the Agent Plan past 100 projects.
- If you’re on Google Cloud and need throwaway Postgres for agent test runs, try AlloyDB Express: a preview with no backups, a 20 GB storage cap and about 20 seconds to resume.
- If 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.
- If 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 manage without point-in-time restore until it ships (Prisma says November 2026).
- If you want to branch a large production Postgres for each coding agent, look at Xata, whose branches take seconds whatever the database size, and watch its move to ClickHouse.
- If you have a few big tenants with heavy, steady load, use PlanetScale, or a dedicated Neon or Supabase project per tenant.
- If 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, though D1 charges $0.10 a month for each database past 100,000 per account. Among Postgres options, Neon, Prisma Postgres, Xata and Google’s AlloyDB Express 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 Supabase’s docs say paid projects “cannot be 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 up to 1,000,000 per account on Workers Paid, which includes 100,000; each database above that costs $0.10 a month, even when empty. Each database is capped at 500 MB on free and 10 GB on paid.
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 into Supabase Postgres but hasn’t described a tool, pricing or timeline. Turso’s later posts call it “part of Supabase”, but as of 24 November neither company has published a closing announcement, and Turso’s prices and sign-ups are unchanged.
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 new project is provisioned in “typically under 1 second”. By default compute suspends after five minutes idle. On the Launch plan you can only turn that off; the Scale plan allows anything from one minute to always on.
Correction (24 November 2026): The first version of this guide said Turso’s paid plans might still cap monthly active databases and that we couldn’t confirm it; Turso had removed that limit in May 2026, before we published. It listed Prisma Postgres’s Free plan as including 1.01 GB of storage; Prisma’s pricing page shows 2 GB, as does its blog, last updated on 28 September. It said PlanetScale’s MCP server lets an agent create databases; its documented tools don’t include that. We also removed quotes attributed to Prisma (“no scale-to-zero and no cold starts”, “isn’t independently benchmarked”) and Cloudflare (“planned”) that we couldn’t find on their pages, and claims we could no longer source.
