MMS • Renato Losio
Article originally posted on InfoQ. Visit InfoQ
Amazon Aurora Serverless v2 has recently announced that it now supports scaling to zero capacity, enabling the database to automatically pause after a period of inactivity based on database connections. The lack of the ability to scale to zero capacity for Aurora’s on-demand automatic scaling configuration has been a contentious topic for many years.
Jason Pedreza, senior database specialist solutions architect at AWS, and Anum Jang Sher, product manager at AWS, explain:
Automatic pause and resume feature helps you manage costs for applications that don’t have a stringent service-level objective. For workloads, that can tolerate a resume time of approximately 15 seconds, you can use this feature in the following cases: clusters used for development and testing and applications where a cold start is acceptable while the database resumes.
Announced in preview at re:Invent four years ago and generally available since spring 2023, Aurora Serverless v2 previously required a minimum capacity of 0.5 ACU, with one ACU equating to approximately 2 GiB of memory, along with corresponding CPU and networking resources.
Since the typical time to resume is approximately 15 seconds and requested connections are established only after the database instance finishes resuming, the cloud provider recommends configuring client timeout settings (such as the connectTimeout
and sslResponseTimeout
for the JDBC driver) to exceed this duration. Reflecting on the “pre:Invent” announcements, Jeremy Daly, co-founder of Ampt and author of the serverless newsletter Off-by-none, comments:
Perhaps one of the biggest announcements was that Amazon Aurora Serverless v2 now supports scaling to zero capacity. This was available in v1, which made it an excellent choice for development environments, but when v2 launched, it was no longer an option. There’s still a 15 second cold start, but unless you have highly predictable traffic patterns, I wouldn’t enable this in production.
Earlier this year, AWS announced the retirement of Aurora Serverless v1, with the primary complaint from the community being the lack of a “scale to zero” option for the managed relational database on AWS.
The SecondsUntilAutoPause
property now determines how long a database instance must remain without open connections before pausing, with a minimum (default) value of 5 minutes and a maximum of 1 day. AWS cautions that when an Aurora Serverless v2 instance resumes, its initial capacity may be lower than it was before pausing. There are also notable differences in auto-pause behavior between Aurora Serverless v2 and the deprecated Aurora Serverless v1. Additionally, certain scenarios prevent scaling to zero ACU, such as when using an RDS Proxy or any proxy that maintains an open connection to a database instance in the cluster.
According to the documentation, when the database is paused and a new connection is requested, it will automatically resume and scale to meet application demand. Manual stopping and starting of a cluster is still possible when the auto-pause feature is enabled, but any paused instances will automatically resume upon restart. While Yan Cui writes “Finally lives up to its name!”, Corey Quinn, chief cloud economist at The Duckbill Group, comments:
After fighting it for years and failing at their attempt to retcon their own history, Amazon finally wakes up to the realization that Serverless does in fact mean “scales to zero.”
AWS emphasizes several application design considerations for the Aurora Serverless v2 auto-pause feature. When implementing connection logic, it is recommended to retry the connection if the initial attempt returns an error. Additionally, applications should avoid leaving client sessions or programming tools with open connections to the database.
The ability to scale to zero capacity is currently supported for Aurora PostgreSQL versions 13.15+, 14.12+, 15.7+, and 16.3+, as well as Aurora MySQL version 3.08+.