
Game developer’s guide to Amazon Aurora Serverless v2
Amazon Aurora is been a strong choice for game developers, offering 3x the throughput of PostgreSQL and 5x the throughput of MySQL, with full PostgreSQL and MySQL compatibility… One of the largest gaming companies, Riot Games, has used Amazon Aurora to great success, achieving minimal downtime d…
Game developers face unique database challenges when building and scaling their games. When a game suddenly gains traction, whether through social media buzz, streamer attention, or positive reviews, the database infrastructure needs to seamlessly handle millions of concurrent players.
Simultaneously, during off-peak hours or if a game doesn’t achieve expected popularity, maintaining expensive infrastructure based on peak capacity predictions can lead to wasted resources. This is particularly challenging for indie game developers and smaller studios who can’t afford to gamble on over-provisioned infrastructure.
Amazon Aurora is been a strong choice for game developers, offering 3x the throughput of PostgreSQL and 5x the throughput of MySQL, with full PostgreSQL and MySQL compatibility. One of the largest gaming companies, Riot Games, has used Amazon Aurora to great success, achieving minimal downtime during migration, reducing their operational overhead while maintaining reliable service for their millions of global players.
Amazon Aurora Serverless v2, an on-demand autoscaling configuration for Amazon Aurora, can address these challenges. Aurora Serverless v2 helps automate the process of monitoring workload and adjusting capacity for your databases. You’re charged only for the resources that your database clusters consume, depending on the number of Aurora Capacity Units (ACU). Review Amazon Aurora pricing to determined usage by the day, hour, or month.
Aurora Serverless v2 can help you stay within budget and avoid paying for infrastructure you don’t use. It combines the high availability and durability of Amazon Aurora with serverless flexibility, automatically scaling capacity up and down based on application demand.
For game developers, this means you can focus on creating engaging player experiences. Aurora Serverless v2 handles the complexities of database management from scaling during unexpected viral success to maintaining consistent performance during competitive events—all while optimizing costs during quieter periods.
Aurora Serverless v2 offers numerous improvements over v1 with more responsive and granular scaling, and better availability with multiple Availability Zones (AZs) support. It has the ability to have up to 16 database instances for each cluster, and preservation of buffer cache during scaling. This makes it better suited for production workloads while maintaining the cost benefits of serverless architecture.
With support for both MySQL and PostgreSQL compatibility, Aurora Serverless v2 makes it seamless to migrate existing game databases or build new ones. Aurora Serverless v2 offers the benefits of a traditional relational database reliability with cloud-focused scalability.
Scaling and monitoring Aurora Serverless v2
Aurora Serverless v2 automatically scales database resources based on specified minimum and maximum capacities, measured in ACUs. Each ACU consists of approximately 2 gibibytes (GiB) of memory, along with proportional CPU and network resources.
Aurora Serverless v2 scales incrementally and granularly based on utilization of those resources without disrupting database operations. Scaling occurs as small as 0.5 ACU increments, with larger increments at higher capacities, and can also scale to zero ACUs with the auto-pause feature. Newer database engine versions allow a maximum capacity of 256 ACUs and a minimum capacity of 0 ACUs, expanding the scaling range.
Aurora Serverless v2 database instances scale faster at higher capacities, so setting a higher minimum capacity enables quicker scaling to meet sudden high-capacity demands. You can choose to make a reader scale at the same time as the associated writer, or independently from the writer.
To optimize Aurora Serverless v2 performance, it’s recommended to set the minimum capacity to a value that enables each database writer or reader to maintain the application’s working set in the buffer pool. This approach prevents the buffer pool contents from being discarded during periods of low activity. The max_connections value for Aurora Serverless v2 database instances is based on the memory size derived from the maximum ACUs.
In addition to CPU, memory, and network throughput, there are two key Amazon CloudWatch metrics for monitoring Aurora Serverless v2 scaling:
- ServerlessDatabaseCapacity: Reports ACUs for current database instance capacity (instance-level) or average ACUs across all instances (cluster-level).
- ACUUtilization: Percentage of ServerlessDatabaseCapacity divided by maximum ACU value. Guidelines:
- If approaching 100 percent, consider increasing the maximum ACU setting.
- For read-heavy workloads, add reader instances if readers approach 100 percent while writers doesn’t.
- Set high maximum ACU for production to handle unexpected spikes, where performance and scalability are the primary considerations.
These metrics are calculated every second, allowing near real-time monitoring and optimization of capacity settings.
Migrating from existing databases
For customers who are already running databases on premises or with other cloud providers, there are two main options for migrating to Aurora Serverless:
- Amazon Web Services (AWS) Database Migration Service
- MySQL/PostgreSQL native tools
AWS Database Migration Service (AWS DMS) can be used to securely migrate databases with minimal downtime. AWS DMS is a fully managed service that provides database discovery and high availability during the migration process. With AWS DMS, ongoing changes from your source database is also replicated to Aurora Serverless v2, minimizing gameplay downtime for your players.
AWS DMS also supports migration between different types of database engines through the DMS schema conversion. With Aurora Serverless v2, MySQL-compatible and PostgreSQL databases are supported as targets for AWS DMS.
Using commands native to MySQL and PostgreSQL databases is a second option. This option is suitable for migrations that can sustain reasonable downtime, as they provide a fixed point in time copy of your data.
- For MySQL databases, you can use the mysqldump command. For more information regarding how to use the command read Importing data to an Amazon RDS for MySQL database with reduced downtime.
- For PostgreSQL databases, you can use the pg_dump and pg_restore commands. For more information regarding how to use these command read Best practices for migrating PostgreSQL databases to Amazon RDS and Amazon Aurora.
You can also convert a provisioned Aurora database instance to Aurora Serverless v2 by following the procedure in Modifying a DB instance in a DB cluster. Make sure the cluster meets the requirement in Requirements and limitations for Aurora Serverless v2, including minimum engine versions.
If the provisioned cluster is running an engine version that isn’t available for Aurora Serverless v2, upgrade the engine version of the cluster. For running clusters, you can minimize downtime by converting a database instance to Aurora Serverless v2 as the first step in the switchover process. You will need to follow the procedure outlined in Switching from a provisioned cluster to Aurora Serverless v2.
Best practices for managing serverless
When implementing Aurora Serverless v2 for game backends, focus on capacity management, security, and operational efficiency. Configure minimum ACU settings to maintain your application’s working set in the buffer pool, while setting maximum ACUs to accommodate peak workloads. Amazon ElastiCache is an in-memory caching service that can be used to reduce traffic to your Aurora database and enables the setting of a lower maximum ACU.
Cost optimization and operational excellence are achieved through strategic use of auto-pause features during off-peak hours and implementing read replicas for read-heavy workloads. The auto-pause feature can help manage costs in development and testing environments, where brief pauses in database availability are acceptable. The instances are automatically paused during periods of inactivity and resumes them (typically within 15 seconds) when needed.
The mixed-configuration clusters of Amazon Aurora offer additional flexibility—you can combine Aurora Serverless v2 and provisioned capacity based on your specific needs. This flexibility enables various setups. You can use a large provisioned writer with Aurora Serverless v2 readers when you need more read or write capacity than is available for an Aurora Serverless v2 writer. Alternatively, when write workloads fluctuate, but read workloads remain constant, you can implement an Aurora Serverless v2 writer with provisioned readers.
Security and high availability remain fundamental to a well-architected implementation. Implement encryption at rest using AWS Key Management Service (AWS KMS), AWS Identity and Access Management (IAM) authentication for database access, and maintain proper network isolation through virtual private cloud (VPC) security groups.
For production environments, we recommend multi-AZ deployments with regular failover testing. Based on customer feedback, maintaining separate environments for development and testing, along with comprehensive disaster recovery procedures, helps verify reliable game operations.
AWS best practices continue to evolve as we work backwards from customer needs, helping game developers build robust, scalable database infrastructure that delivers consistent player experiences.
By following guidelines and regularly reviewing them against specific game requirements and usage patterns, developers can confirm their Aurora Serverless v2 implementation remains robust, cost-effective, and optimally performing under varying load conditions.
Summary
Amazon Aurora Serverless v2 offers game developers an auto-scaling database solution that combines traditional relational database reliability with cloud-centric flexibility. It enables efficient management of unpredictable player loads, maintains performance during peak events, and optimizes costs during quieter periods.
With support for MySQL and PostgreSQL, comprehensive monitoring tools, and automatic scaling, Aurora Serverless v2 empowers developers to focus on creating engaging player experiences. All while it facilitates scalability, reliability, and performance for successful game operations.
Contact an AWS for Games specialist to know how we can help accelerate your business.
Further reading
Author: Srividhya Pallay