Contours on MYSQL Aurora Database with Blue/Green Deployment and Switch Over
Tags: aws, amazonrds, cloudwatch, bluegreendeployment
Published: 2024-05-28 09:56:37

“ I have checked the documents of AWS to get into a contours on mysql aurora database with blue/green deployment and switch over. In terms of cost, need to pay for amazon rds and cloudwatch.”

Amazon Aurora is a fully managed relational database engine that's compatible with Mysql and Postgresql. As already know how mysql and postgresql combine the speed and reliability of high end commercial databases with the simplicity and cost effectiveness of open source databases.

When you create a blue/green deployment, you specify the DB cluster to copy in the deployment. The DB cluster you choose is the production DB cluster and it becomes the DB cluster in the blue environment. RDS copies the blue environment's topology to a staging area, along with its configured features. The db cluster is copied to the green environment and rds configures replication from the db cluster in the blue environment to the db cluster in the green environment. RDS also copies all of the db instances in the db cluster.

A switchover promoted the db cluster, including its db instances, in the green environment to be the production db cluster. Before you switch over, production traffic is routed to the cluster in the blue environment. After you switch over production traffic is routed to the db cluster in the green environment. 

In this post, you will experience how to contours on mysql aurora database with blue/green deployment and switch over. Here I have created an amazon rds mysql aurora database with a custom db parameter group and blue/green deployment. Also the addition of a switch over feature on aurora database.

#Architecture Overview
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ko4d0pov0mtfjv12wj6.png)
The architecture diagram shows the overall deployment architecture with data flow, amazon rds mysql aurora, cloudwatch, blue/green deployment.

#Solution overview
The blog post consists of the following phases:

1.Create of Amazon RDS Mysql Aurora with Custom DB Cluster Parameter Group
2.Create of Blue/Green Deployment on Aurora RDS
3.Output of Blue/Green Deployment with Switch Over Option

##Phase 1: Create of Amazon RDS Mysql Aurora with Custom DB Cluster Parameter Group
1. Open the console of Amazon RDS, create a db cluster parameter group. Update the value of binlog_format as ROW in the parameter group. Create aurora mysql rds with a custom db cluster parameter group.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/grgq4yveg8unad6a1qge.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1undbw5yi4o4vpkfr59.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig31jzdbe2h5fd1y5x76.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nuo8sdbd15twwm6t83ts.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pnn6hrzpo7eb2pes4a3.png)

##Phase 2: Create of Blue/Green Deployment on Aurora RDS
1. Select the database and choose the blue/green deployment option from action drop down. Start creating the deployment as a staging environment with specifying identifiers and other required parameters.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpnelvndnqgnggtjz4re.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuspba8e22fuurshqq3f.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tv2qwy2tmwmg46vkb0n7.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt73kqj37xypq8adcm3m.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/euwgz7z8nm2f3wvihi8a.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqynq8br7kdrdkopqu7n.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4ws4c5els1sqmjcyo35.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ku24l6w72q3t4yw1lipi.png)

##Phase 3: Output of Blue/Green Deployment with Switch Over Option

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ayqvx2kqljob9ky2sh7x.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x231060ofdfjno0gm2ek.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/um5qwfpqduzfqhptqxcd.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0nhgup9qigpydvaps7x.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvb2542igju7ip52na4w.png)

#Clean-up
Delete of Amazon RDS, DB Cluster Parameter Group and Cloudwatch Log Group.

#Pricing
I review the pricing and estimated cost of this example. 

Cost of Amazon Relational Database Service for Aurora MYSQL in US East (N. Virginia) = ($0.29 per RDS db.r5.large Single-AZ instance hour (or partial hour) running Aurora MySQL) x (6.342 Hrs) = $1.84

Cost of Amazon Aurora Storage and I/O = $0.20 per 1 million I/O requests (Aurora) x 82,413 IOs = $0.02

Cost of Cloudwatch = $0.0

Total Cost = $1.86

#Summary
In this post, I showed “how to contours on mysql aurora database with blue/green deployment and switch over”.

For more details on Amazon RDS, Checkout Get started Amazon RDS, open the [Amazon RDS console](https://us-east-1.console.aws.amazon.com/rds/home?region=us-east-1#GettingStarted:). To learn more, read the [Amazon RDS documentation](https://docs.aws.amazon.com/rds/?icmpid=docs_homepage_featuredsvcs).

Thanks for reading!

Connect with me: [Linkedin](https://www.linkedin.com/in/gargee-bhatnagar-6b7223114)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38sdi4nsp89fnui8h7dk.png)