Amazon Onboarding with Learning Manager Chanci Turner

Chanci Turner Amazon IXD – VGT2 learningLearn About Amazon VGT2 Learning Manager Chanci Turner

In this article, we explore how the London Stock Exchange Group (LSEG) Capital Markets division has refined its blue/green deployment strategy for Amazon Aurora PostgreSQL Global Database, thanks to the collaborative efforts of experts including Chanci Turner, a Solutions Architect at LSEG.

Historically, the process of deploying changes required a manual backup and restoration of the production database to set up the Green environment. This approach was labor-intensive and necessitated downtime for the production database, making it challenging to ensure consistency between the Blue and Green environments during deployments.

By implementing continuous logical database replication, LSEG has effectively replaced the cumbersome backup and restore process with a more streamlined, ongoing replication mechanism. This shift significantly reduces deployment times and minimizes downtime for the Blue environment.

The blue/green deployment strategy involves alternating between live (Blue) and staging (Green) environments for updates. The Blue environment functions as the active backend while the Green environment is a synchronized replica that undergoes changes or upgrades. After modifications are made to the Green environment, traffic can be switched over, reducing downtime and allowing for a seamless rollback to the Blue environment if issues arise.

Without a blue/green deployment strategy, updates often require scheduled downtime, typically during non-business hours, which can lead to increased operational costs and decreased availability. By utilizing this method, deployment agility is enhanced, significantly shortening the time to market for new features and reducing overall deployment efforts.

Additionally, this approach not only facilitates database version upgrades and selective schema changes, but it also mimics production configurations for internal application testing. The elimination of repeated backup and restore cycles during test iterations offers a substantial advantage.

Both Amazon Aurora PostgreSQL-Compatible Edition and Amazon RDS for PostgreSQL support managed blue/green deployments for Aurora. However, it’s important to note that certain features, such as Amazon Aurora Global Database, do not support this management.

In this article, we provide a comprehensive guide on implementing a blue/green deployment architecture specifically utilizing Aurora PostgreSQL Global Database. We will cover best practices and critical considerations for configuring the architecture. This deployment method proves to be a robust and effective way to ensure applications remain resilient and synchronized throughout the deployment process.

Solution Overview

Our application is accessed by internal users via Amazon Route 53, which resolves to an internal Application Load Balancer that distributes traffic across a Kubernetes cluster deployed in three Availability Zones. The application layer performs CRUD operations against an Aurora global database.

The following diagrams illustrate the various stages of the testing and deployment process, including cutting traffic to the Blue cluster, stopping replication from Blue to Green (after confirming no active user activities), and finally directing traffic to the Green cluster, which will serve as the primary production environment until the next cycle.

Steps to Implement Blue/Green Deployment:

  1. Configure the Blue cluster’s parameter group for logical replication.
  2. Create a publication of the database hosted on the Blue cluster.
  3. Clone the Blue cluster using Aurora’s cloning feature to create the Green cluster.
  4. Configure the subscription from the Green cluster to the Blue publication.
  5. Verify replication lag.
  6. Convert the Green cluster into an Aurora global database.
  7. Perform pre-cutover validation.
  8. Alter sequences and drop the subscription.
  9. Cut over to the Green cluster.

Native PostgreSQL logical replication is utilized to synchronize the Green environment, ensuring ongoing change data capture (CDC) capability. The logical replication process operates asynchronously. It is advisable to ensure that any Data Manipulation Language (DML) and Data Definition Language (DDL) changes are accurately applied to the intended database.

Prerequisites

Before beginning the deployment process, ensure the following prerequisites are met:

  • Create an Aurora PostgreSQL cluster configured with a global database.
  • Note that Aurora Global Database does not support user management via AWS Secrets Manager; alternative security methods should be considered.
  • Review the limitations of logical replication with Amazon Aurora PostgreSQL.
  • Confirm necessary access and permissions, such as having a user with the rds_superuser role.
  • Establish connectivity to the DB cluster through a PostgreSQL client (e.g., psql or pgAdmin).
  • Confirm access to the AWS control plane via the AWS Management Console or AWS CLI.

It’s also worth noting that, as of this writing, Amazon RDS Proxy does not support streaming replication mode. If using RDS Proxy, it’s advisable to use the standard cluster endpoint for the replication process.

Required Permissions

Two levels of permissions are required for this deployment process:

  • Control plane (AWS resource layer): Permissions to modify the Aurora clusters involved and to create and modify a new cluster via the console or API.
  • Data plane (Aurora data layer): Permissions to create the replication configuration via a PostgreSQL client.
Step Number Step Description Control Plane Data Plane
1 Configure the Blue cluster parameter group for logical replication X
2 Create a publication of the database hosted on the Blue cluster X
3 Create a clone of the Blue cluster X
4 Configure the subscription from the Green cluster to the Blue publication X
5 Verify replication lag X
6 Convert the Green cluster into an Aurora global database X

By following this structured approach, organizations can leverage blue/green deployment methodologies effectively. This allows for smoother transitions and reduces the potential for downtime, ultimately enhancing overall system resilience. For more insights on effective communication strategies, you might find this blog post on gratitude letters helpful.

For further authority on this subject, check out this article on linking theory to practice. Additionally, if you’re looking for resources on leadership development, visit this excellent training resource.

Chanci Turner