Thursday 9 March 2017

Multi-AZ Deployment And Read Replica's for Amazon RDS

RDS has eased the life of a Database administrator in terms of handling and management of a database. RDS is easy to set-up and scale as per the load and storage requirements.It comes with some features that reduce tedious tasks with a traditional database and makes things easier like management of backups, software patching, failure detection and also auto-recovery.

RDS provides with two features/ways in which we can provision replica’s of the primary:
  • RDS Read Replica’s
  • RDS Multi-AZ

But then, in which scenario should one go for a Multi AZ feature and when for a Read Replica ?
Let’s explore a bit!
RDS Multi-AZ Deployment

RDS Multi-AZ is an feature available for high availability and it is not a scaling option.RDS gives an option for Multi-AZ when launching a db instance. When you opt for a Multi-AZ deployment, Amazon RDS would create a secondary DB (standby replica) which has synchronous replications  from primary DB. The secondary DB would be in another availability zone making the DB highly available in case of any failure of primary DB. A automatic fail-over to the standby is performed in such case, and endpoint remains same so operations can be resumed without any human intervention.

When can Multi-AZ come to your rescue ?
  • If Availability Zone goes down
  • Primary db instance fails / connectivity or host failure
  • Manual forced fail-over(reboot)
  • Software patching

Architecture :

Deploy RDS in Multi-AZ Environment :

  1. Navigate to : Amazon RDS → Launch DB Instance 
   2. Select the engine and then Go for Multi-AZ Deployment option

  • For high availability, When software patching or any updates are to be done for Multi AZ deployment, first it is applied to standby instance before an automatic fail-over.
  • Instances are not affected by this I/O suspension since the backup is taken on the standby.
  • No human intervention is required for fail-over.

Read Replicas

Read replica is a scaling technique which can be used for distributing heavy read load from the primary Database. Once a write is done to the database, read operation for the same can be more often. Read-heavy behavior is a common observation in many applications. Read throughput can be increased by employing solution using read replicas which provide a asynchronously replicated copy of the primary database. CloudWatch provides a replica lag metric for information on how much the replica instance lags from the source DB instance. Read replicas are available in Amazon RDS for MySQL, MariaDB, and PostgreSQL. When you initiate the read replica process a snapshot is created of the source Database and a read only instance is created.

When should you use read replica :

  • Application with heavy read workloads
  • Source dB unavailable, Read replica can serve traffic
  • Data warehousing scenarios
*Note: Read replica can be in same Availability Zone, Different AZ or even in different AWS region.

Creating Read Replica :

Read replica can be created using API’s command line tools or using the AWS management console.
  1. Select the instance you want to create read replica.
Navigate to Instance Actions → Create read replica

  1. Configure the details.Instance type, region for replica deployment can be configured.

  • Workload for a database with heavy reads can be minimized, enhances the DB performance
  • In case of failure of source database, read replica can be promoted to master.
  • Read replicas can be across regions and be a part of Disaster Recovery Strategy.

  • If you are looking to use replication to increase database availability while protecting your latest database updates against unplanned outages, consider running your DB instance as a Multi-AZ deployment.
  • Read Replicas help you to scale beyond the capacity constraints of a single DB Instance for read-heavy database workloads.

No comments:

Post a Comment

Maximizing Content Delivery Efficiency: Optimizing Performance in AWS CloudFront

  Unleash Blazing-Fast Content Delivery: Your Guide to CloudFront Optimization Introduction: AWS CloudFront stands as a cornerstone of moder...