Skip to content
Explainer · Cloud database basics

Serverless Databases Explained: How They Work & When to Use Them

A serverless database is a managed database where you do not choose or pay for a fixed server size: capacity follows demand, compute can pause when the database is idle, and the bill is based on usage. This page explains how serverless databases work (scale to zero, usage-based billing, separated storage and compute), compares the main options on AWS, Azure, Google Cloud and specialist providers, and sets out when serverless is and is not a good fit.

Facts checked 8 October 2026 against the providers' official documentation and pricing pages. Next review due January 2027. Cloud services, regions and prices change often; confirm on the provider's site before you buy.
Short answer
  • Serverless databases scale capacity automatically and bill for what is used; many can pause compute entirely when idle, leaving only storage on the bill.
  • Relational options include Aurora Serverless (PostgreSQL and MySQL), the Azure SQL Database serverless tier and Neon; NoSQL options include DynamoDB on-demand, Azure Cosmos DB serverless and Firestore.
  • The main trade-off is resume time after a pause: providers document it (Neon says a few hundred milliseconds; Microsoft says lower initial responsiveness after inactive periods), but it is not zero.
  • Serverless fits development databases, intermittent and spiky workloads; steady, busy workloads are usually cheaper on a provisioned instance.
How we know: Research-based: behaviour and billing models were checked against AWS (Aurora Serverless, DynamoDB), Microsoft Learn (Azure SQL Database serverless, Cosmos DB serverless), Google Cloud (Firestore, BigQuery), Neon, Cloudflare and Turso documentation on 8 October 2026. CodeWithSQL has not run these services and has not measured cold starts or resume times; any timings quoted are the providers' own documented figures.

What is a serverless database?

A serverless database is a managed database in which the provider decides how much compute is running at any moment. You do not pick an instance size and pay for it around the clock. Instead you set limits (or none), the service scales capacity with the workload, and you are billed for the capacity or requests actually used plus the data stored. "Serverless" does not mean there are no servers; it means you do not manage or pay for a fixed one.

The providers describe it in these terms. AWS calls Aurora Serverless an on-demand, autoscaling configuration that automatically starts up, shuts down and scales capacity based on the application's needs, billed per second while the database is active. Microsoft describes the Azure SQL Database serverless tier as automatically scaling compute based on demand and billing for compute used per second. AWS describes DynamoDB on-demand mode as a serverless option with pay-per-request pricing.

Every serverless database is also a managed database; the difference is the capacity and billing model. Our managed databases guide covers the provisioned alternative.

How serverless databases work

Scale to zero

Many serverless relational databases can stop compute completely when nothing is happening. Neon documents that a database scales to zero after 5 minutes of inactivity and reactivates when queried again. Azure SQL Database serverless pauses databases during inactive periods, when only storage is billed, and resumes them when activity returns. AWS documents scaling Aurora Serverless to zero capacity units with automatic pause and resume. This is what makes serverless cheap for databases that are idle most of the day.

Usage-based billing

Billing follows usage, but the unit differs by service: capacity units per second or hour (Aurora Serverless ACUs, Neon compute units, Azure vCore seconds), requests (DynamoDB read and write request units, Cosmos DB request units), or rows read and written (Cloudflare D1, Turso). Cloudflare says plainly that if you are not running queries against a D1 database, you are not billed for compute. Usage-based bills are low when traffic is low but are harder to predict, so set budgets and alerts.

Separated storage and compute

Scaling compute up, down or to zero without losing data requires storage that lives apart from the compute nodes. Neon's architecture documentation describes its Postgres as split into two independent layers, compute and storage, connected by a stream of write-ahead log records, so compute can scale, go idle and restart without moving data. On Neon, this design is also what enables fast database branching.

Serverless database options by provider

The table compares the main serverless database services. For PostgreSQL specifically, the serverless PostgreSQL guide in this section goes deeper.

Serverless database services compared (October 2026)
ServiceData modelScales to zeroBilling unitNotes
Aurora Serverless (AWS)PostgreSQL- and MySQL-compatibleYes, with automatic pause and resumeAurora capacity units (ACUs) per second, plus storage and I/OCan mix serverless and provisioned instances in one cluster
Azure SQL Database serverlessSQL Server engine (Azure SQL)Yes, auto-pause after a configurable delayvCore seconds plus storageGeneral Purpose and Hyperscale tiers
NeonPostgreSQLYes, after 5 minutes idle (configurable on paid plans)Compute-unit hours plus storageBranching; free plan available
Amazon DynamoDB on-demandKey-value and document (NoSQL)No compute to pause; pay per requestRead and write request units plus storageAWS calls it a serverless option
Azure Cosmos DB serverlessNoSQL (several APIs)No minimum chargeRequest units consumed plus storageNo capacity planning
Google FirestoreDocument (NoSQL)No compute to pause; pay per operationReads, writes, deletes plus storageDaily free quota
Cloudflare D1SQLite semanticsNot billed for computeRows read and written plus storageQueried from Workers or HTTP API
TursoSQLite-compatibleIdle databases cost only storageRows read and written, storage, syncsTurso announced it is joining Supabase

AWS serverless database options

On AWS, Aurora Serverless is the serverless relational choice and DynamoDB is the serverless NoSQL choice. AWS describes Aurora Serverless as scaling in fine-grained increments and down to zero with Aurora PostgreSQL and Aurora MySQL. For the RDS and Aurora families, read Amazon RDS vs Amazon Aurora; for the NoSQL side, DynamoDB vs PostgreSQL.

Azure serverless database options

Azure SQL Database serverless is a compute tier of Azure SQL Database, available in the General Purpose and Hyperscale service tiers, so you keep the same engine and tools and change only how compute is sized and billed. Azure Cosmos DB has a serverless account type that charges only for the request units your operations consume and the storage your data uses.

Google Cloud serverless database options

Cloud SQL is provisioned, not serverless. Google's serverless databases are Firestore, a fully managed, serverless document database, and BigQuery, which Google calls a serverless data analytics platform for analytical queries rather than application traffic. For a serverless PostgreSQL on Google Cloud you would look outside Cloud SQL, for example to a specialist provider.

Resume time and other trade-offs

The first request after a paused database wakes up has to wait for compute to start. Providers document this rather than hide it: Neon says a suspended database reactivates within a few hundred milliseconds, and Microsoft's comparison of serverless and provisioned compute lists lower initial responsiveness after inactive periods for serverless and immediate response for provisioned. CodeWithSQL has not measured these times; test with your own workload and region before relying on them.

Other trade-offs to weigh:

  • Connections. Applications that open many short-lived connections (for example, serverless functions) can exhaust database connections. Use the provider's connection pooler where one exists.
  • Cost at steady load. A database that is busy all day gets little benefit from pausing, and usage-based compute can then cost more than a provisioned instance of similar size. Compare both with your expected hours.
  • Limits. Serverless tiers set maximum capacity, and some features are restricted; Neon, for example, only supports scale to zero on computes up to 16 CU.
  • Billing surprises. A runaway query or a bot can drive usage up quickly. Set spending limits or alerts.

When to use a serverless database

Good fit:

  • Development, test and preview databases that sit idle outside working hours.
  • Side projects, internal tools and low-traffic production apps.
  • Spiky or unpredictable traffic where sizing an instance for the peak wastes money.
  • Many small databases, such as one per tenant or per branch.

Poor fit:

  • Steady, high utilisation all day; Microsoft notes that provisioned compute suits more regular usage with higher average utilisation.
  • Latency-sensitive endpoints that cannot accept a resume delay, unless you disable scale to zero.
  • Workloads that need engine features or extensions the serverless tier does not support.

To place serverless among the other hosting options, read database hosting: how to choose; for the free serverless tiers, see free database hosting. Comparisons such as Neon vs AWS RDS and Cloudflare D1 vs Turso look at specific pairs.

Frequently asked questions

What is serverless SQL?

It usually means a relational database queried with SQL whose compute scales automatically and is billed by usage, such as Aurora Serverless, Azure SQL Database serverless or Neon. The SQL itself is standard for the engine; only the hosting and billing model changes.

What is the AWS serverless database?

For relational data, Aurora Serverless (PostgreSQL- and MySQL-compatible), which scales in fine-grained increments and can scale to zero. For NoSQL, DynamoDB, whose on-demand mode AWS describes as serverless with pay-per-request pricing.

Is there an Azure serverless database?

Yes. Azure SQL Database has a serverless compute tier that scales compute automatically, bills per second and pauses during inactive periods. Azure Cosmos DB also has a serverless account type billed by request units consumed.

Does Google Cloud have a serverless database?

Firestore is Google's serverless document database, and BigQuery is a serverless analytics platform. Cloud SQL, Google's managed MySQL, PostgreSQL and SQL Server service, is provisioned rather than serverless.

Are serverless databases slower?

While running, they use the same engines, so there is no general reason for them to be slower. The difference is the resume delay after a pause, which providers document (Neon states a few hundred milliseconds). We have not measured it.

Is a serverless database cheaper?

For idle or spiky workloads, usually yes, because you stop paying for compute when nothing runs. For a database that is busy all day, a provisioned instance is often cheaper. Compare both with your expected usage.

Sources

Checked 8 October 2026.

How we research cloud database guides: our editorial method. CodeWithSQL earns nothing from the providers mentioned.

Choosing where to run your database?

Start with the section overview, or compare providers side by side.