Are you preparing for AWS Certified Solutions Architect Professional certification exam? In this space, we are writing series of articles on topics which are covered in the Solutions Architect Professional certification exam. In this article, we are explaining one of the important feature available with Amazon web services which is AWS RDS Multi-AZ and Read Replica. You would expect lot of questions from this topic for Solutions Architect Professional exam. You can subscribe to us for receiving the further updates on this topic.
- AWS Certified Solutions Architect Professional – Free Test
- How to prepare for AWS certified solutions architect professional exam?
This topic addresses the High Availability and Business continuity topic mentioned in the below table and as highlighted in the AWS Blueprint for the exam guide
Purpose of Multi-AZ and Read Replica
AWS provides the facility of hosting Relational databases. The following databases are supported – PostgreSQL, MySQL, MariaDB, Oracle, and Microsoft SQL Server.
For the databases, there are 2 features which are provided by AWS
- Multi-AZ – In this architecture, AWS maintains a copy of the primary database in another Availability Zone. So if a failure occurs in the primary database, an instance switch over can occur to the secondary database. The data is replicated synchronous to the standby instance.
The primary DB instance switches over automatically to the standby replica if any of the following conditions occur:
- An Availability Zone outage
- The primary DB instance fails
- The DB instance’s server type is changed
- The operating system of the DB instance is undergoing software patching
- A manual failover of the DB instance was initiated using Reboot with failover
When operations such as DB instance scaling or system upgrades like OS patching are initiated for Multi-AZ deployments, for enhanced availability, they are applied first on the standby prior to an automatic failover. As a result, your availability impact is limited only to the time required for automatic failover to complete. Note that Amazon RDS Multi-AZ deployments do not failover automatically in response to database operations such as long running queries, deadlocks or database corruption errors.
- Read Replica – This is where you take a snapshot of the current RDS in AWS. This is like a read only copy that can be used to increase the scalability of a database. Normally a Read replica is used to offload heavy read traffic for an application. So if you have an application that has a heavy query interface and looks for consistent number of reads, then Read replica can be used. The transactional part can exist in the main database and the reads can happen in the Read replica database.
Read replicas are available in Amazon RDS for MySQL, MariaDB, and PostgreSQL.
Some of the other advantages of read replica’s are
- Enhanced security – All traffic between the source and destination database is encrypted.
- Read replicas in Amazon RDS for MySQL, MariaDB, and PostgreSQL provide a complementary availability mechanism to Amazon RDS Multi-AZ Deployments. You can promote a read replica if the source DB instance fails. You can also replicate DB instances across AWS Regionsas part of your disaster recovery strategy.
Creating a Multi-AZ Database
Let’s now look at the steps involved in creating a Multi-AZ database. For our example, we will use a MySQL database provided by AWS.
Step 1: After logging into the console , go to the Database->RDS section
Step 2: In the next screen , choose the MySQL Engine
Step 3: Choose the option of hosting a production database which automatically comes with the Multi-AZ option.
Step 4: In the DB details , the Multi-AZ Deployment will be marked as ‘Yes’.
Specify a database name , user name and password and click on Next step
Step 5: In the next step, choose the VPC. It always a good practice to ensure the database is not publicly accessible.
Accept all the default settings and click on Launch DB Instance.
Once the database is created, you would get the endpoint for the database
Creating a Read Replica
Let’s now look at the steps involved in creating a Read Replica database. For our example, we will use a MySQL database which was created in the earlier steps.
Step 1: After logging into the console , go to the Database->RDS section
Step 2: Navigate to the database which was created in the earlier step. Choose the Instance Actions and choose on Create Read Replica.
Step 3: In the next step , you need to choose the instance details which will be used to host the read replica. Also you need to mention the provisioned IOPS and the source database. You then to also specify the new instance identifier for the read replica database.
Step 4: You can also decide on the region in which the Read replica can be launched in
Step 5: Once all the settings are in place, just click on Create Read Replica.
Once the database has been created you will be able to see this database in the console and use this like an ordinary database
Final Points to Remember about RDS Multi-AZ and Read Replica
- In Multi-AZ, the data from the primary instance is replicated to a secondary instance.
- The secondary instance is located in another Availability zone.
- In Read Replica, a snapshot is taken of the primary database.
- Read replicas are available in Amazon RDS for MySQL, MariaDB, and PostgreSQL.
- Read replicas in Amazon RDS for MySQL, MariaDB, and PostgreSQL provide a complementary availability mechanism to Amazon RDS Multi-AZ Deployments
- All traffic between the source and destination database is encrypted for Read Replica’s.
- The standby replica in a Multi-AZ deployment cannot take on read requests. It is only meant for a failover and is not used for read purposes.
- You need to enable backups before creating Read replica’s. This can be done by setting the backup retention period to a value other than 0
- Amazon RDS for MySQL, MariaDB and PostgreSQL currently allow you to create up to five Read Replicas for a given source DB Instance
- It is possible to create a read replica of another read replica. You can create a second-tier Read Replica from an existing first-tier Read Replica. By creating a second-tier Read Replica, you may be able to move some of the replication load from the master database instance to a first-tier Read Replica.
- Even though a read replica is updated from the source database, the target replica can still become out of sync due to various reasons.
- You can delete a read replica at any point in time.
In this article we have explained about AWS RDS Multi AZ and Read Replica. This is one of the most important feature offered by Amazon Web Services (AWS) that will help the Developers. You would expect lot of questions from this topic in your certification exam.
If you are preparing for the AWS certifications exam and looking for any help, please send us a mail or call to our customer support team.
- Study Guide for VMware Spring Professional(VMware EDU-1202) Certification - May 29, 2023
- Top 40+ Agile Scrum Interview Questions (Updated) - May 21, 2023
- How to turn on Cloud Security with Microsoft Defender? - May 16, 2023
- Top Cloud Security Certifications for 2023 - May 15, 2023
- Importance of Cybersecurity Architecture in the Rise of Cybersecurity Threats - May 8, 2023
- Hands on labs for Google Cloud Associate Cloud Engineer Certification - April 28, 2023
- Ultimate Guide to Certified in Cybersecurity Certification - April 27, 2023
- Exam tips on AWS Certified SAP on AWS – Specialty exam (PAS-C01) - April 18, 2023
3 thoughts on “High Availability using AWS RDS Multi-AZ and Read Replica”
Awesome post !! Everything is crystal clear.
Really helpful and good post
Amazing information about RDS and Multi-AZ.
In point to remember no #1
In Multi-AZ, the data from the primary instance is replicated to a secondary instance.
So is it chargeable as data transfer cost?