patternsqlMinor
Is MySQL master-slave replication in sequential consistency pattern?
Viewed 0 times
slavereplicationsequentialmysqlmasterconsistencypattern
Problem
I am learning different patterns of consistency, say, strict/sequential/causal/eventual consistency.
I find the master and slave cluster of MySQL (use InnoDB as the default Engine) seems to be one implementation of sequential consistency: the master of MySQL defines the global sequence of transactional changes with the help of global transaction ID and keeps the Binlog and Redolog in the same order thru the use of grouping commit.
Could someone help me judge the correctness of my understanding?
I find the master and slave cluster of MySQL (use InnoDB as the default Engine) seems to be one implementation of sequential consistency: the master of MySQL defines the global sequence of transactional changes with the help of global transaction ID and keeps the Binlog and Redolog in the same order thru the use of grouping commit.
Could someone help me judge the correctness of my understanding?
Solution
Single-threaded MySQL replication is sequentially consistent. On the source instance, events are written to the binary log in the order they are committed. The replica replays them in exactly the same order, whether that's necessary for data integrity or not.
Multi-threaded MySQL replication has a little more flexibility. It can apply events using multiple threads, which can apply changes in parallel only if they are not causally related. So this is more like causal consistency.
Multi-threaded MySQL replication has a little more flexibility. It can apply events using multiple threads, which can apply changes in parallel only if they are not causally related. So this is more like causal consistency.
Context
StackExchange Database Administrators Q#310303, answer score: 4
Revisions (0)
No revisions yet.