DB Replication Behind The Scenes
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.
Answer
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 Questions
- → "failed to open stream" error when executing "migrate:make"
- → I can't do a foreign key, constraint error
- → Setting a default value on settings form return null in Octobercms
- → Eloquent Multitable query
- → "Laravel 5.1" add user and project with userId
- → Image does not go in database with file name only tmp name saved?
- → Database backup with custom code in laravel 5 and get the data upto 10 rows from per table in database
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → Setting the maxlength of text in an element that is displayed
- → laravel check between 2 integer from database
- → how to retrieve image from database in laravel 5.1?
- → relationship for database Column type object
- → Carousel in Laravel 4 does not show as expected