Nov 17, 202611 min read

Aurora Serverless v2 for PostgreSQL: ACUs, Scale to Zero and When to Use It

How Aurora Serverless v2 capacity works for PostgreSQL, what an ACU is, the current state of scaling to zero with automatic pause, the CLI and Terraform setup, how to convert a provisioned cluster, what it costs, and when provisioned RDS or Aurora is the better choice, plus how to run it with Encore.

Illustration for Aurora Serverless v2 for PostgreSQL: ACUs, Scale to Zero and When to Use It

Aurora Serverless v2 is an Aurora DB instance class, db.serverless, whose capacity moves up and down with load instead of being fixed by an instance size. For PostgreSQL it is the same Aurora engine and storage as a provisioned cluster, so the database, endpoints and drivers do not change, only how compute is sized and billed.

Short answer: Aurora Serverless v2 measures capacity in Aurora capacity units (ACUs) of about 2 GiB of memory each, scales each instance within a cluster-wide range in steps as small as 0.5 ACU, and bills per second. As of November 2026 it can scale to zero: set the minimum to 0 ACUs and idle instances pause after a timeout you choose, with no instance charge while paused and a resume of about 15 seconds on the next connection.

This guide covers how capacity and scale to zero work, setup with the CLI and Terraform, converting a provisioned cluster, cost, when provisioned RDS is the better pick, and how to run it with Encore.

Aurora Serverless v2 at a glance

Detail
Capacity unit1 ACU, approximately 2 GiB of memory with matching CPU and networking
Range for PostgreSQL0 to 256 ACUs on most current versions, up to 384 on the newest versions and platform version 4
Scaling stepAs small as 0.5 ACU, larger steps at higher capacity
BillingACU-hours, measured per second, plus Aurora storage and I/O
Scale to zeroMinimum of 0 ACUs with an auto-pause interval of 300 seconds to one day
Resume timeAbout 15 seconds, 30 seconds or more after more than 24 hours paused
Range scopeOne range per cluster, shared by every db.serverless instance

Ranges and version requirements are from how Aurora Serverless v2 works.

Scale to zero: current status

AWS announced scaling to zero on November 20, 2024, replacing the old floor of 0.5 ACUs. The auto-pause documentation describes the current behavior:

  • Version requirement. Aurora PostgreSQL must run at least 13.15, 14.12, 15.7 or 16.3, and the capacity table also lists 17.4 and 18.3. Clusters created before the feature keep a 0.5 ACU minimum until you change it to 0.
  • Pause interval. SecondsUntilAutoPause sets how long an instance must go without user connections before it pauses, from 300 seconds, the default, to 86,400 seconds.
  • Billing while paused. The instance charge is zero and the ServerlessV2Usage metric drops to zero. Storage and other cluster-level charges continue.
  • Resume. Any connection attempt resumes the instance, even one with wrong credentials. Connections complete once it is running, typically after about 15 seconds. An instance paused for more than a day can enter a deeper sleep that takes 30 seconds or more.

Several things keep instances awake even with a minimum of 0 ACUs:

  • Any open user connection, including idle connections held by an application connection pool.
  • An RDS Proxy on the cluster, which holds a connection to every instance. Scale to zero and RDS Proxy do not mix.
  • Logical replication on Aurora PostgreSQL, which keeps the writer and readers in failover tiers 0 and 1 active.
  • Being the primary or a secondary cluster in an Aurora global database, or having a zero-ETL integration to Redshift.

Readers with a failover priority of 2 to 15 can pause on their own while the writer stays active, which suits a reporting reader used only during office hours.

How ACUs and scaling work

You set one capacity range on the cluster, and every db.serverless writer or reader scales independently within it. Capacity is measured every second and grows in steps as small as 0.5 ACU, with larger steps at higher capacity, so an instance at 32 ACUs adds capacity faster than one at 1 ACU.

The minimum matters for more than cost, since memory for the PostgreSQL buffer cache shrinks as an instance scales down, so a minimum set too low evicts hot data and the next burst starts with cold reads. The capacity guidance suggests a minimum whose memory holds the frequently accessed data, and a reader minimum close to the writer's to avoid replication lag. For PostgreSQL, max_connections is derived from the maximum ACUs, but a minimum of 0 or 0.5 ACUs caps it at 2,000, so use a minimum of 1 or more for connection-heavy workloads.

The CloudWatch metrics ServerlessDatabaseCapacity and ACUUtilization show where an instance sits in its range. An instance pinned at the maximum needs a higher ceiling, and one that never drops below a level is a hint for the minimum.

Create an Aurora Serverless v2 cluster with the AWS CLI

The capacity range belongs to the cluster, and the instance class belongs to each instance:

~
$ aws rds create-db-cluster \ --db-cluster-identifier app-pg \ --engine aurora-postgresql \ --engine-version 17.4 \ --master-username postgres \ --manage-master-user-password \ --storage-encrypted \ --db-subnet-group-name app-db-subnets \ --vpc-security-group-ids sg-0123456789abcdef0 \ --serverless-v2-scaling-configuration MinCapacity=0,MaxCapacity=16,SecondsUntilAutoPause=900 $ aws rds create-db-instance \ --db-instance-identifier app-pg-1 \ --db-cluster-identifier app-pg \ --engine aurora-postgresql \ --db-instance-class db.serverless # Change the range later; this applies immediately, without a reboot$ aws rds modify-db-cluster \ --db-cluster-identifier app-pg \ --serverless-v2-scaling-configuration MinCapacity=0.5,MaxCapacity=32 $ aws rds describe-db-clusters --db-cluster-identifier app-pg \ --query 'DBClusters[0].ServerlessV2ScalingConfiguration'

Setting a nonzero minimum removes SecondsUntilAutoPause from the configuration, and setting the minimum back to 0 lets you specify it again.

Aurora Serverless v2 with Terraform

The aws_rds_cluster resource takes a serverlessv2_scaling_configuration block, and each aws_rds_cluster_instance uses db.serverless:

# aurora_serverless.tf resource "aws_rds_cluster" "app" { cluster_identifier = "app-pg" engine = "aurora-postgresql" engine_version = "17.4" database_name = "app" master_username = "postgres" manage_master_user_password = true storage_encrypted = true db_subnet_group_name = var.db_subnet_group vpc_security_group_ids = [var.db_security_group_id] serverlessv2_scaling_configuration { min_capacity = 0 # 0 lets idle instances pause max_capacity = 16 # about 32 GiB of memory at peak seconds_until_auto_pause = 900 } } resource "aws_rds_cluster_instance" "writer" { identifier = "app-pg-1" cluster_identifier = aws_rds_cluster.app.id instance_class = "db.serverless" engine = aws_rds_cluster.app.engine engine_version = aws_rds_cluster.app.engine_version } variable "db_subnet_group" { type = string } variable "db_security_group_id" { type = string }

A cluster can mix provisioned and db.serverless instances, for example a provisioned writer sized for steady load and a serverless reader for spiky reporting queries. Add more aws_rds_cluster_instance resources for readers.

Convert a provisioned Aurora cluster to Serverless v2

An existing provisioned instance converts by modifying its class to db.serverless. If it is the first serverless instance in the cluster, you set the cluster's capacity range in the same operation, per the Aurora Serverless v2 administration guide. To keep downtime low for the writer:

  1. Check the engine version supports the range you want, and upgrade first if needed.
  2. Add a db.serverless reader, or convert an existing reader, and let it catch up.
  3. Fail over so the serverless reader becomes the writer, and clients on the cluster endpoint follow it.
  4. Convert or remove the old provisioned instance.

The same steps in reverse move a workload back to provisioned, which you may need if it outgrows the largest ACU setting. RDS for PostgreSQL instances have no serverless class, so moving from RDS to Aurora Serverless v2 is a migration to Aurora first. The Aurora vs RDS guide covers that choice.

What Aurora Serverless v2 costs

The worked example on the Aurora pricing page uses $0.12 per ACU-hour for Aurora Standard and $0.156 per ACU-hour for I/O-Optimized. Prices vary by region, and at those rates the compute side looks like this:

PatternACU-hours per monthCompute at $0.12
Floor of 0.5 ACU, never pauses365about $44
Development database, 2 ACUs for 40 hours a week, paused otherwiseabout 347about $42
Steady 8 ACUs, about 16 GiB of memory, around the clock5,840about $700

Storage, and I/O on Aurora Standard, come on top in every row. The first two rows are where serverless wins: compute follows usage, and a paused development database costs only its storage. The third row is a steady workload, and before choosing serverless for it, compare the result with the on-demand or reserved price of a provisioned instance of similar memory in your region.

Aurora Serverless v2 vs provisioned RDS or Aurora

ChooseWhen
Aurora Serverless v2 with a 0 ACU minimumDevelopment, preview, staging and internal tools idle most of the day, where a 15 second first connection is acceptable
Aurora Serverless v2 with a nonzero minimumProduction traffic with large swings, such as daily peaks or batch jobs, where sizing for the peak would waste most of the day
Provisioned AuroraSteady load that needs Aurora features: up to 15 low-lag readers, fast failover, storage that grows on its own
Provisioned RDS for PostgreSQLSteady, modest load where cost predictability and community PostgreSQL behavior matter most

Serverless is also a poor fit when something must hold connections open, like RDS Proxy or logical replication to an analytics pipeline, since the instance can never pause, and when the workload sits near the top of the range all day.

Application tips for scale to zero

  • Raise connect timeouts. AWS recommends client timeouts above 15 seconds, and 30 seconds or more if the database can stay paused longer than a day.
  • Retry the first connection. If many connections arrive during a resume, some can fail. AWS suggests retrying failed connections, for example up to three times.
  • Let the pool go idle. A pool that keeps minimum or idle connections open stops the instance from pausing. Check the pool's idle timeout and minimum size, and make sure health checks and schedulers do not query the database around the clock.
  • Move scheduled jobs. Aurora does not resume a paused instance for engine-level scheduled jobs such as pg_cron, and jobs due while it sleeps are skipped. Trigger them from the application instead, where the connection itself resumes the instance.

How Encore runs Aurora Serverless v2

Encore

Encore gives you infrastructure from code for databases: you declare a PostgreSQL database next to the service that uses it, and in an AWS environment Encore provisions the database server in your own account. When the environment is created you choose between Amazon RDS for PostgreSQL, the default, and Aurora PostgreSQL. On Aurora, the AWS infrastructure docs describe Serverless v2 support directly: set an instance's class to db.serverless and the cluster's capacity range, between 0 and 256 ACUs in steps of 0.5, and a minimum of 0 lets the instances pause when idle. These are settings in the environment's infrastructure page, not code, so the same application can run on a provisioned Aurora writer in production and a serverless one in staging.

Set up the app

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create reports --example=ts/hello-world$ cd reports && mkdir -p reports/migrations
// reports/encore.service.ts import { Service } from "encore.dev/service"; export default new Service("reports");
-- reports/migrations/1_create_reports.up.sql CREATE TABLE reports ( id BIGSERIAL PRIMARY KEY, tenant_id TEXT NOT NULL, title TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now() ); CREATE INDEX reports_tenant_created ON reports (tenant_id, created_at DESC);
// reports/reports.ts import { api } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; // The same declaration runs on RDS, provisioned Aurora or Aurora Serverless v2. const db = new SQLDatabase("reports", { migrations: "./migrations" }); interface Report { id: number; title: string; createdAt: string; } export const create = api( { expose: true, method: "POST", path: "/tenants/:tenantId/reports" }, async ({ tenantId, title }: { tenantId: string; title: string }): Promise<Report> => { const row = await db.queryRow<Report>` INSERT INTO reports (tenant_id, title) VALUES (${tenantId}, ${title}) RETURNING id, title, created_at::text AS "createdAt" `; return row!; }, ); export const list = api( { expose: true, method: "GET", path: "/tenants/:tenantId/reports" }, async ({ tenantId }: { tenantId: string }): Promise<{ reports: Report[] }> => { const reports: Report[] = []; for await (const row of db.query<Report>` SELECT id, title, created_at::text AS "createdAt" FROM reports WHERE tenant_id = ${tenantId} ORDER BY created_at DESC LIMIT 50 `) { reports.push(row); } return { reports }; }, );

encore run starts a local PostgreSQL for this code, and in the cloud Encore injects the connection configuration, as the database docs explain, so nothing in the service refers to ACUs, instance classes or endpoints. Encore runs migrations on deploy and gives each service its own database role. A new Aurora cluster starts with one db.r6g.large writer and max_connections of 1000; switching that writer to db.serverless and setting the range happens in the dashboard, and changing max connections or the PostgreSQL version reboots the instances. The infrastructure overview covers what each environment type gets.

Two decisions stay with you, and the first is the server type: the RDS or Aurora choice is made when the environment is created and cannot be changed afterwards, so pick Aurora for any environment that should scale to zero. Second, the pause rules above still apply: an instance only pauses once every connection is closed, so measure with ServerlessDatabaseCapacity whether a staging environment reaches zero. If you already run an Aurora Serverless v2 cluster, you can import the existing cluster, and Encore keeps its settings and instances as they are.

An AI coding agent adding a table or a query to this service writes a migration and SQL, and the decision between provisioned and serverless capacity stays an environment setting it never has to touch.

Best fit: teams on AWS that want serverless Postgres for idle environments and provisioned capacity for steady production, from one codebase.

Frequently asked questions

Can Aurora Serverless v2 scale to zero?

Aurora Serverless v2 can scale to zero: with a minimum capacity of 0 ACUs, Aurora Serverless v2 instances pause after a period with no user connections, from 300 seconds to one day, and you pay no instance charge while paused. Aurora PostgreSQL needs version 13.15, 14.12, 15.7, 16.3, 17.4, 18.3 or higher. Resuming typically takes about 15 seconds, and 30 seconds or more after a pause longer than 24 hours.

What is an ACU in Aurora Serverless v2?

An Aurora capacity unit is approximately 2 GiB of memory with corresponding CPU and networking. You set a minimum and maximum ACU range for the cluster, and each db.serverless instance scales within it in steps as small as 0.5 ACU, billed per second in ACU-hours.

How do I create an Aurora Serverless v2 PostgreSQL cluster?

Run aws rds create-db-cluster with --engine aurora-postgresql, a supported --engine-version and --serverless-v2-scaling-configuration MinCapacity=0,MaxCapacity=16,SecondsUntilAutoPause=900, then add a writer with aws rds create-db-instance using --db-instance-class db.serverless and the same cluster identifier. In Terraform, set serverlessv2_scaling_configuration on aws_rds_cluster and instance_class db.serverless on aws_rds_cluster_instance.

Is Aurora Serverless v2 cheaper than RDS?

For databases that sit idle for long stretches, such as development, preview and internal tools, it often is, because a paused instance has no compute charge. For steady production load it usually costs more, since you pay per ACU-hour all day at whatever capacity the load needs, while a provisioned instance of similar memory has a fixed hourly price.

Does Encore support Aurora Serverless v2?

Encore supports it on AWS environments that use Aurora PostgreSQL: you set an instance's class to db.serverless and the cluster's capacity range, between 0 and 256 ACUs in steps of 0.5, in the environment's infrastructure settings, and a minimum of 0 lets the instances pause when idle. Application code does not change.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders