Algorithms to replicate changes across nodes. [1]
Single Leader
Multi Leader
Leader-Less
Points to think?
synchronous vs async replication?
how to handle failed replicas?
What is Master(aka Leader) and Slave(aka followers) ?
How master-slave replication works ?
use of replication logs or change stream
What is sync and sync replica
Sync: when replication happen in sync call, i.e master sends an change update to slave and waits for the slave to respond with successful update.
Does master wait for the response from all the slave?
Nope, generally one of the slave is synchronous and others are asynchronous. So master depends on only one slave's response.
Okay, what if that synchronous slave goes down or becomes slow? This might lead to infinite block of write on master right?
In this case one of asynchronous slave become synchronous slave.
How do we do that in mysql?
What guarantees are promised by sync replication?
This guarantees that you have up-to-date copy of data on at least 2 nodes(master and one synchronous slave). This is sometimes called semi-synchronous.
Async:
Why
What about sync vs async replication?
How is it handled in mysql res?
Pros of sync
guaranteed and consistent updates in slave.
in case leader fails we can still rely on slave.
Cons of sysc
infinite block of write on master in case of no response from slave.
What are the circumstances under which followers might fall behind the leaders by few mins?
when a follower is recovering from failure.
when a system is operation at full resource usage.
network problem between nodes.
How this lag is configured in mysql and observed?