s4saas4that

What is the best database for an API or backend service?

Prices read from each vendor's own pricing page on 28 August 2026.

An API is a different customer from an app. It usually needs no auth system, no file storage and no realtime, because whatever calls it already has those. What it needs is to be cheap when nothing is happening, fast when something is, and reachable from wherever the code runs.

That inverts the ranking. The all-in-one platforms that win for an app are carrying features a service will never call, priced into a monthly floor it pays whether or not anybody makes a request. The things that matter instead are scale-to-zero billing, connection handling from serverless runtimes, and how many databases you can have before it gets expensive.

Our pick

PickNeonFree, then pay per use

Compute scales to zero, so an idle service costs nothing, and there is no monthly minimum on paid plans, so the bill tracks the work. Standard Postgres means no lock-in beyond the connection string, and branching gives every preview deploy real data. The free plan suspends, and usage-based billing with no floor is harder to forecast than a flat fee.

What we judged on

Also worth it

TursoFree, then $4.99/mo

The multi-tenant answer. A hundred databases on the free plan makes one database per customer affordable rather than theoretical, and $4.99 is the cheapest paid tier in the category. Built on libSQL, which is open source and can be run yourself. One writer at a time per database is the constraint to check against your write pattern.

Cloudflare D1Free, then $5/mo

If the service already runs on Cloudflare Workers, this removes the connection pooling problem entirely because the database lives inside the same platform. Scale-to-zero billing on rows, and $5 covers most small services. It decides your hosting for you, which is either the point or a dealbreaker.

Prisma PostgresFree, then $10/mo

Connection pooling and caching handled, which is the usual serverless Postgres headache, and fifty databases on the free plan. Billed per operation, which is a harder number to predict than storage. Most of the value assumes you are already using the Prisma ORM.

Not for this job

CarefulUpstashFree, then $10/mo

Excellent at what it is for, which is caching, rate limiting and queues, and it speaks HTTP so it works from edge runtimes where a Redis client will not. It is not a primary database, and treating it as storage will hurt. Per-command pricing also gets expensive fast under a chatty workload.

Prices, side by side

ToolFromFree tier
NeonFree, then pay per useFree plan: 0.5 GB storage per project, 100 compute-hours, 10 branches, up to 100 projects, no card required.
TursoFree, then $4.99/moFree plan: 100 databases, 5 GB storage, 500 million rows read and 10 million written a month.
Cloudflare D1Free, then $5/moFree on the Workers free plan: 5 GB storage, 5 million rows read and 100,000 rows written a day.
Prisma PostgresFree, then $10/moFree plan: 500 MB storage, 200,000 operations a month, up to 50 databases, no card required.
UpstashFree, then $10/moFree plan: 256 MB, 500,000 commands a month, 10 GB bandwidth, 1 database.

Read on 28 August 2026. Every price change we have recorded.

Questions people ask

What is the cheapest way to run a database that is idle most of the time?

Anything that bills by usage rather than a monthly floor. Neon scales compute to zero, and Cloudflare D1 bills by rows read and written, so both can cost nothing on a quiet day. A flat $25 plan costs $25 whether or not anybody calls the service.

Do I need connection pooling for a serverless API?

With plain Postgres, usually yes, because serverless functions open connections faster than the database wants to close them. Neon and Prisma Postgres handle pooling for you. Cloudflare D1 sidesteps it by living inside the Workers runtime.

Is a database per customer sensible?

It is if the platform prices for it. Turso allows a hundred databases on the free plan and treats it as a normal pattern; on most Postgres hosts a database per customer means a project per customer and a bill per customer, which stops being sensible around ten.

This is one question about databases. See all 12 compared, or browse the other guides.