MySQL & InnoDB (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is GTID (Global Transaction Identifier) in MySQL Replication?
senior LevelDatabases & SQLMySQL
In Simple Words: A GTID is a unique identifier assigned to every committed transaction across all replication servers:
- Format:
source_id:transaction_id(e.g.3E11FA47-71CA-11E1-9E33-C80AA9429562:23). - Advantage over File/Position Replication: Simplifies failover completely. If the primary crashes, a replica can be promoted and other replicas repointed without manually calculating binary log file offsets (
CHANGE REPLICATION SOURCE TO ... AUTOMATIC_POSITION = 1).