This Guidance demonstrates how to configure active-active replication with up to nine Amazon Relational Database Service (Amazon RDS) for MySQL instances using the Group Replication plugin. With the provided AWS CloudFormation stacks and scripts, you can implement a multi-primary mode topology to achieve continuous availability for your applications. Write operations are distributed across multiple database instances in an active-active cluster, maximizing availability and reducing write latency.

Please note: [Disclaimer]

Architecture Diagram

[Architecture diagram description]

Download the architecture diagram PDF 

Well-Architected Pillars

The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.

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.

  • 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.

    Read the Operational Excellence whitepaper 
  • 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).

    Read the Security whitepaper 
  • 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.

    Read the Reliability whitepaper 
  • 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.

    Read the Performance Efficiency whitepaper 
  • 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.

    Read the Cost Optimization whitepaper 
  • 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.

    Read the Sustainability whitepaper 

Introducing Group Replication plugin for active/active replication on Amazon RDS for MySQL

This blog post discusses MySQL Group Replication, its use cases, configuration, application-level considerations, and significance in modern database management.


The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.

References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.

Was this page helpful?