Logo

dev-resources.site

for different kinds of informations.

Scaling to Zero with Amazon Aurora Serverless v2

Published at
12/16/2024
Categories
aws
aurora
serverless
Author
sudo_anuj
Categories
3 categories in total
aws
open
aurora
open
serverless
open
Author
9 person written this
sudo_anuj
open
Scaling to Zero with Amazon Aurora Serverless v2

Amazon Aurora Serverless v2 takes serverless database management to the next level by supporting scaling down to zero Aurora Capacity Units (ACUs). This feature allows you to optimize costs during periods of database inactivity while benefiting from the robust capabilities of Aurora Serverless. Whether you're running a development environment, testing, or applications where a cold start is acceptable, this feature can significantly cut costs without 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. With scaling options now ranging from 0 to 256 ACUs, Aurora Serverless v2 offers unparalleled flexibility and cost optimization.


Why Scale to 0 ACUs?

The automatic pause and resume feature enables Aurora Serverless v2 to pause database activity after a specified idle period. During this pause, no compute costs are incurred—only storage costs are billed. When user activity resumes, Aurora seamlessly scales up to meet the demand. This process typically takes less than 15 seconds.

Ideal Use Cases

  • Development and Testing: Cost-efficient for environments with sporadic usage.
  • Cold Start Applications: Suitable for workloads that tolerate a short resume time.

How to Enable Scaling to 0 ACUs

Prerequisites

Ensure your Aurora version is compatible:

  • Aurora PostgreSQL-Compatible Edition: Version 13.15 or higher
  • Aurora MySQL-Compatible Edition: Version 3.08.0 or higher

Configuring Automatic Pause

You can configure this feature while creating a new database or modifying an existing one. 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/

aurora Article's
30 articles in total
Favicon
How to generate a Aurora Postgresql cluster with all auto explain enabled
Favicon
Amazon Aurora DSQL: The New Era of Distributed SQL
Favicon
Real-Time Data Integration Techniques Using PostgreSQL Foreign Data Wrapper (FDW)
Favicon
Comparing AWS RDS and Amazon Aurora: Which Managed Database Service is Right for You?
Favicon
Referential integrity In The Absence Of Foreign Key
Favicon
Multi-Region Distributed SQL Transaction Latency
Favicon
Scaling to Zero with Amazon Aurora Serverless v2
Favicon
Joins, Scale, and Denormalization
Favicon
Aurora Serverless v2 scales to zero.. but how fast?
Favicon
Aurora DSQL - Simple Inserts Workload from an AWS CloudShell
Favicon
Data inconsistency in AWS Amazon Aurora Postgres solved with Local Write Forwarding?
Favicon
Unlocking Aurora DSQL with AWS Lambda: A Seamless Solution for Serverless, Scalable, and Event-Driven Architectures
Favicon
Aurora Limitless - Creation
Favicon
Aurora Limitless - Connection
Favicon
Cách thay đổi bảng MySQL lớn bằng Percona Toolkit trên EC2 và AWS Aurora !!
Favicon
Migrating from SQLServer to Aurora PostgreSQL
Favicon
Migrating from AWS RDS to Aurora
Favicon
Best Places to See the Northern Lights: A Guide to Unforgettable Auroras
Favicon
Relational Databases on AWS: Comparing RDS and Aurora
Favicon
Automated Database Horizontal Scaling with Amazon Aurora Limitless Database
Favicon
Test your mySQL / Aurora database with Lambda
Favicon
Level Up Your Data Management Game: Unleash Performance in Aurora Limitless
Favicon
Level Up Your Data Management Game: Unleash Performance in Aurora Limitless
Favicon
Aurora vs. RDS: How to Choose the Right AWS Database for 2024
Favicon
Embracing the Future of Database Management: A Deep Dive into Amazon Aurora Limitless Database
Favicon
Version up test against Aurora MySQL 2 EOL with SQL test tool
Favicon
Amazon Aurora PostgreSQL shared buffers and cache
Favicon
Amazon Aurora
Favicon
Databases in AWS: RDS
Favicon
Spring Boot with AWS Aurora read replica

Featured ones: