Read replicas

The second way to get more performance out of our cluster is to introduce read replicas. With typical relational databases, the read-to-write ratios are usually in favor of reads by a factor of a few. Typical access patterns could be as high as 80% read and 20% write, or even as high as 90-10 or more. By introducing read replicas, we allow the application to distribute the reads to the read replicas and relieve the master or primary instance of the reads.

With the MySQL, MariaDB, and PostgreSQL engines, the read replicas can be created within the same region or another region and are done with the engine's native asynchronous replication capabilities. This means that the data in the read replicas might see a bit of a lag and serve stale data, so we need to handle this in the application we are deploying. This can be useful for business intelligence (BI) or analytics platforms that need to perform end-of-day analysis on our data and project that into reports. If your application cannot handle stale data, then introducing caching (discussed in Chapter 12, Introduction to ElastiCache) will be the appropriate option with these database types.

With Amazon Aurora, the read replicas are essentially built into the cluster and retrieve data from the shared backend volume, meaning there is no replication at the instance level required and the data delivered from the read replicas is never stale.

Oracle and Microsoft SQL RDS instances do not support read replicas.
  1. To add read replicas, navigate back to the databases section in the RDS management console and select Actions and then Create read replica:

  1. In the read replica dialog, we can select the destination region and availability zone, and we can also configure whether we would like to make the read replica publicly available:

  1. We can also encrypt the database, select an instance size for the replica, configure Multi-AZ, the database settings, monitoring, logging, and the maintenance window, just like we did when we created the initial database. After we are satisfied with our selections, we can click Create read replica:

  1. When replica creation starts, we will see another instance in our list of databases in the RDS management console: 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.138.104