We all aware about Multi AZ and read replica RDS services offered by AWS. Did you ever had a confusion when to use it or where to use it? In this article let me explain the major difference between the two.
Read Replica:
Read replica feature of rds will provide high performance and durability to rds databases. The main benefits of using read replica are:High performance: As the read replica will allows the read queries to be distributed among them it will helps to improve the performance. If our application produces lots of database look-ups for reporting purposes, it may make sense to pass some of those reads to a slave server, allowing our master to stay in performance. Suppose we have an e-commerce website and it can have large number of read queries.In such cases having read replica will be greatly useful since it will help to distribute the read queries.
High Availability: As we have multiple read instances the availability will be automatically high. So along with improving performance availability will also increases.We can also have read replicas of read replica. Amazon allows a maximum of five read replicas.
Minimizing downtime: We can say to a certain extend that read replica will help us for disaster recovery. If we have only data backup as a part of data recovery plan and if our master fails suddenly, the quick option we can do is to promote the slave to master. Read replica give us an option for that
Multi-AZ:
Multi-AZ is better option given by Amazon for disaster recovery. We can configure our instance with Multi-AZ at the time of creation itself. Here data is distributed synchronously, so all instances under Multi-AZ will have same data on a given time. If we have configured with Multi-AZ, if one of our instance fails Amazon will automatically points the DNS to standby RDS instance on other zone. Here no manual action is needed. In case of database maintenance, db failure or availability zone failure this will be useful. Here we can’t use the standby to offload reads from an application. The standby is only there for fail over.
So while creating RDS instances we have to choose RDS read replica or Multi-AZ or both based on our need.If disaster recovery is our primary requirement we must definitely go with Multi-AZ and for better performance we must choose read replica.