DEV Community

Beatrice Akaeme
Beatrice Akaeme

Posted on

AMAZON RELATIONAL DATABASE READ REPLICA

WHAT IS AMAZON RELATIONAL DATABASE(AMAZON RDS)
It is a type of web service which is used to set up a relational database easily on the AWS Cloud. This is one of the web services provided by AWS. Amazon RDS can support a display of database engines to store and organize data. Amazon relational database manages time consuming administrative tasks giving the client time to focus on more important tasks.
Amazon RDS supports and gives you access to MariaDB, Oracle, MySQL, PostgreSQL, SQL server and Amazon, Aurora.

             WHAT IS A READ REPLICA
Enter fullscreen mode Exit fullscreen mode

This is the process of creating a particular data from the primary(master) database to another database. This copy is called the 'Slave' which is a non editable copy of the master database. This replication is asynchronously done and automatically all the data updates that occurs at your primary database will be replicated in the slave database.
Read Replica is very necessary especially for those modules that are more read intensive in an application.

    HOW CAN WE CREATE AMAZON RDS READ REPLICA? 
Enter fullscreen mode Exit fullscreen mode
  • To create a Read Replica using the Amazon Web services(AWS) management console:
  • If you don't have an account create one here:
  • Then log on to your AWS management console account and select services, then RDS
  • You need to specify an already existing Database instance to be the source
  • Ensure that you enable automatic backups on the source Database instance by setting the backup retention period to a value other than 0.
  • After that, a snapshot is created by Amazon RDS from the source.
  • Next, from the snapshot, a read-only instance is created using the RDS.
  • From actions choose Read Replica and manually configure your instance according to the requirements and start the replication process by clicking "Create Read Replica".

    FEATURES OF AN AMAZON RDS READ REPLICA
    
  • AWS allows creation of only a maximum of 5 Read Replicas which are created one after the other,

  • Read Replica is asynchronously created and all the updated in the master Database will be pushed to the Slave Database. Though write can only happen in the primary Database.

  • Only one snapshot is taken and used to create all the Read Replicas

  • A secure communication channel is established by Amazon RDS between the source Database instance and the Read Replica if they are both not in same AWS region.

  • A Read Replica can be promoted to a stand alone source Database thereby breaking the replication link between the Source Database and the Read Replica.

  • Amazon RDS Read Replicas can be made in the same Availability Zone as that of the primary Database or in another region(MULTI- AZ).

     WHY MULTI - AZ REPLICATION REPLICATION
    

    Creating the primary database(Master) in one region and maintaining a copy(secondary) in another region, if the first region goes down due to a natural disaster such as ; flood, earthquake, fire outbreak etc., or if primary instance fails or the Database instance is undergoing software patching, you can switch over to the copy(replica) Database in the second region.
    Once you switch to the secondary Database, your Read Replica becomes fully functional Database. Now it can support both read and write like the primary Database.

            BENEFITS OF READ REPLICAS
    

    With Amazon RDS Read Replica, it is easy to scale out beyond the capacity constraints of a single Database instance for read heavy database loads

While creating your replica from the master you create in two different regions in order to ensure availability of data in case of any disaster or if the primary database fails
Read replicas helps in routing the queries that require read only traffic from the primary database.

Amazon RDS Read Replica helps to free up the data the primary DB through read - only traffic

Yo can have up to 5 read replicas each with its own DNS endpoint.

It is possible to create in two different regions, same A-Z, Across A-Zs.

Supports multi - Az deployment, in order to enhance fault availability and fault tolerance

Amazon RDS read replicas provides enhanced read replicas helps to maintain a copy of the data bases in a different region for disaster recovery performance and durability for RDS

When the need arises RDS Read replicas can become stand alone instance

           ADVANTAGES OF RDS READ REPLICA
Enter fullscreen mode Exit fullscreen mode

AVAILABILITY: RDS ensures that our database is always available even when disaster or failure of the primary database occurs. IN this case the read replica is promoted as a stand alone database to replace the failed primary database.

SECURITY: Having a highly secure environment to operate is one of the main concerns of AWS. As read replicas is being created encryption of the data is done by RDS using public keys so as to ensure that the data is in a secure domain

PERFORMANCE: Read replicas handles all the read load to enhance overall performance by routing all the read queries traffic from the primary database to itself. Creating read replicas in more than one region can also enhance performance.

          READ REPLICA DELETION AND FAILOVER
Enter fullscreen mode Exit fullscreen mode

To clearly delete a Read Replica, you must use the same mechanisms that you used while deleting Database instance.

Each read replica gets promoted to a single stand alone AZ Database instance when the source Database instance gets deleted without getting rid of the replicas.

IF and when the source instance of a Multi-AZ deployment fails over to the standby, any corresponding Read Replicas are redirected to use the secondary database as their replication source.

Top comments (0)