Home > Enterprise >  DB replication behind the scenes
DB replication behind the scenes

Time:02-13

Tried searching a lot on internet, but could not find any satisfactory information. We create DB replicas so that the Primary DB instance does not have to deal with load of read queries, and the replica instances does not have deal with load from write queries. But, eventually the primary DB instance will have to somehow send write queries to replica instances. So does these replication write queries not increase load on replica instances? I know that it does not, but why not? Secondly, since that our primary DB instance is now also responsible for replicating data across replica instances, does that not increase load on primary DB instance? I am coming from AWS background, dealing with RDS instances and read replicas.

CodePudding user response:

Does these replication write queries not increase load on replica instances?

Yes, they are write operations, but that is how they stay sync'd - the read replica's are replicating on the WAL (check the note disclaimer below as not all replication is from the WAL) of the primary writer node, so their replication is merely a shadow of what the writer node has already experienced.

If the primary node has a long standing query, the replica sizing is not reflecting the storage sizing of the primary, etc... You might be become a victim of Replication Lag

Since that our primary DB instance is now also responsible for replicating data across replica instances, does that not increase load on primary DB instance?

Sure - any I/O operation is a computing cost, but the replication activities are managed by AWS off the primary node. That's what you are paying for when using the managed DBMS, the low level storage volume that the primary (writer) is using also being read and replicated by AWS

The DB cluster volume is physically made up of multiple copies of the data for the DB cluster. The primary instance and the Aurora Replicas in the DB cluster all see the data in the cluster volume as a single logical volume.

take a read of the replication documentation provided by AWS

Note: The type of DB you are running also effects the replication method - AWS doc

  • Related