Guidance for Active-Active Replication on Amazon RDS for MySQL
Overview
How it works
This architecture diagram shows how to setup an active-active replication configuration for up to 9 Amazon RDS for MySQL instances using the Group Replication plugin. This allows for high availability and failover capabilities for your MySQL database.
Deploy with confidence
Ready to deploy? Review the sample code on GitHub for detailed deployment instructions to deploy as-is or customize to fit your needs.
Well-Architected Pillars
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
Operational Excellence
RDS for MySQL, EventBridge, Amazon SNS, and AWS CloudTrail help you with tracking and reviewing logs and information for quick error review and incident responses. Specifically, RDS for MySQL allows you to set up multi-primary mode between your RDS for MySQL database instances to provide continuous availability for your applications.
Security
Elastic Load Balancing (ELB) automatically distributes your incoming traffic across multiple targets; it monitors the health of its registered targets and routes traffic only to the healthy targets. AWS KMS is used in this Guidance to provide default encryption with the option to use custom KMS keys. The encrypted DB instances for RDS for MySQL offer an additional layer of data protection by encrypting underlying storage, backups, replicas, and snapshots. Lastly, consider protecting your resources with identity-based policies such as AWS Identity and Access Management (IAM).
Reliability
RDS for MySQL offers high availability through data replication across multiple AZs, and the Group Replication plugin offers data resilience. For durable storage for RDS snapshots, use Amazon Simple Storage Service (Amazon S3) to secure storage for critical data.
ELB automatically distributes your incoming traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses in one or more AZs. It monitors the health of its registered targets and routes traffic only to the healthy targets, which improves application availability. ELB scales your load balancer as your incoming traffic changes over time.
Lastly, CloudFormation automates resource deployment and provisions a rollback upon failures, supporting reliability in the midst of failures.
Performance Efficiency
Use the Group Replication plugin in RDS for MySQL, along with configurations like Transaction Size and Follow Controls, to optimize your application's performance and replication throughput. Also, using ProxySQL to split read and write operations across the RDS DB instances further enhances your application's performance. Moreover, Lambda and EventBridge are scalable, customizable services that help you maintain the active-active cluster topology.
Cost Optimization
RDS for MySQL allows you to deploy scalable MySQL servers with cost-efficient and resizable hardware capacity. And with ELB, you pay only for what you use. Finally, the broad and deep portfolio of Amazon EC2 instances, combined with Amazon EC2 Auto Scaling, helps you tailor compute resources to your business needs and scale capacity up and down based on observed demand.
Sustainability
The auto scaling capabilities of Amazon EC2 help align resources with application needs, minimizing waste and promoting sustainability. We recommend Graviton-based Amazon EC2 instances for RDS for MySQL to reduce your carbon footprint by using up to 60% less energy for the same performance as comparable x86-based instances. Additionally, the ability to stop and start RDS for MySQL DB instances eliminates the need for running resources for temporary testing or daily development activities.
Disclaimer
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages