MySQL Parallel Replication Strategies
MySQL Parallel Replication Strategies
MySQL Version 5.5
- The official MySQL 5.5 version doesn’t support parallel replication.
- Table-based Distribution Strategy: If two transactions update different tables, they can be parallelized.
- Row-based Distribution Strategy: Transactions can be parallelized on the replica if they don’t update the same row.
MySQL Version 5.6
- Official MySQL 5.6 supports parallel replication but only at the database level.
- Its efficiency depends on the workload distribution across different databases.
MariaDB’s Parallel Replication Strategy
- Transactions that can be committed in the same group on the primary won’t modify the same row.
- Transactions that can run in parallel on the primary can also run in parallel on the replica.
MySQL Version 5.7
- Introduced a strategy controlled by
slave-parallel-type:DATABASEreplicates using the MySQL 5.6 database-level strategy.LOGICAL_CLOCKis a strategy similar to MariaDB’s, but optimized.
MySQL 5.7.22
- Introduced a new parallel replication strategy based on
WRITESET. binlog-transaction-dependency-trackingcontrols the new strategy.COMMIT_ORDER: Strategy based on the simultaneous preparation and commit phases.WRITESET: Strategy based on row hashes. Transactions can be parallelized if their writesets don’t overlap.WRITESET_SESSION: Similar toWRITESET, but also considers the order of transactions on the primary.
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.