Scaling to Zero with Amazon Aurora Serverless v2
Anuj Tyagi

Anuj Tyagi @sudo_anuj

About: Passionate about cloud, software architecture, SRE practices

Location:
United States
Joined:
Dec 29, 2020

Scaling to Zero with Amazon Aurora Serverless v2

Publish Date: Dec 16 '24
1 0

The new version v2 of Amazon Aurora Serverless has made improvements in providing scaling support down to zero Aurora Capacity Units (ACUs). This is useful to save cost database is not in use. For instance, if we are using Aurora in lab/stage environment, we can scale it down to 0 during non-working hours and thus we don't need to pay for it.
So, If you're running a development or test or where cold start is acceptable, this feature can help in saving cost significantly compromising scalability.

What is Amazon Aurora Serverless v2?

Aurora Serverless v2 is an on-demand, auto-scaling configuration for Amazon Aurora. It automatically adjusts database capacity based on workload requirements and measures capacity in ACUs. One ACU includes approximately 2 GiB of memory, along with CPU and networking resources equivalent to provisioned Aurora instances. The scaling options allow ACUs range from 0 to 256. This way, Aurora Serverless v2 provide flexibility and optimization in cost.


Why Scale to 0 ACUs?

The automatic pause and resume feature allow Aurora Serverless v2 to pause database for a specified idle period. During this idle period, no compute costs are applied and service will be billed for storage costs which is usually not that high. When the user resumes activity, Aurora can scales up to meet the demand. This process usually takes less than 15 seconds.

Ideal Use Cases

  • Development and Testing: Cost-efficient for environments with periodic usage.
  • Cold Start Applications: Useful for workloads that can tolerate allow cold start and need short resume time.

How to Enable Scaling to 0 ACUs

Prerequisites

Before we enable scaling ACU, we need to make sure Aurora version meet the requirements:

  • For Aurora PostgreSQL: Version 13.15 or higher
  • For Aurora MySQL: Version 3.08.0 or higher

Configuring Automatic Pause

We can configure this feature in both cases, during new database creation or even in a running database by changing configuration.

To set up the automatic pause:

  1. Set the minimum capacity to 0 ACUs.
  2. Specify the idle timeout duration (300 to 86,400 seconds) before pausing.

Example AWS CLI command:

aws rds create-db-cluster \
  --db-cluster-identifier my-serverless-v2-cluster \
  --region us-east-1 \
  --engine aurora-postgresql \
  --engine-version 16.3 \
  --serverless-v2-scaling-configuration MinCapacity=0,MaxCapacity=4,SecondsUntilAutoPause=600 \
  --master-username myuser \
  --manage-master-user-password
Enter fullscreen mode Exit fullscreen mode

Understanding the Pause and Resume Mechanism

When a database is paused:

  • The status remains Available, but compute billing halts.
  • Metrics like CPUUtilization and ACUUtilization report 0% in Amazon CloudWatch.
  • Cluster-level events are logged, including pause initiation and completion.

Scenarios Preventing Auto-Pause

  • Open user connections.
  • Logical or binlog replication enabled.
  • Aurora RDS Proxy maintains active connections.
  • Global database configurations (primary cluster writer instance).

When resuming, the database scales up based on workload demands. It’s important to implement retry logic in your client applications to handle resume delays gracefully.


Deployment Patterns

Development Environments

  • Single-AZ Cluster with automatic pause enabled to save compute costs.

High-Availability Applications

  • Multi-AZ Clusters with both writer and reader instances configured as Aurora Serverless v2.

Mixed Activity Workloads

  • Combine Aurora Serverless v2 with provisioned instances for critical components, while using auto-pause for low-priority readers.

Considerations for Automatic Pause

  • Reader instances with failover priority 0 or 1 will follow the writer instance's behavior.
  • Instances in secondary global clusters or with zero-ETL Redshift integration do not auto-pause.
  • Scheduled engine-specific jobs (e.g., autovacuum in PostgreSQL) do not trigger auto-resume.

Conclusion

By enabling 0 ACUs scaling, Aurora Serverless v2 delivers a cost-effective solution for databases with intermittent usage patterns. With the ability to scale up seamlessly when demand returns, this feature provides a perfect balance of cost savings and operational efficiency. Whether you're managing test environments or architecting cost-sensitive applications, Aurora Serverless v2 is a powerful tool for modern database management.

Reference: https://aws.amazon.com/blogs/database/introducing-scaling-to-0-capacity-with-amazon-aurora-serverless-v2/

Comments 0 total

    Add comment