<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="replication-gtids">
      </a>
      19.1.3 Replication with Global Transaction Identifiers
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="replication-gtids-concepts.html">
       19.1.3.1 GTID Format and Storage
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-lifecycle.html">
       19.1.3.2 GTID Life Cycle
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-auto-positioning.html">
       19.1.3.3 GTID Auto-Positioning
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-howto.html">
       19.1.3.4 Setting Up Replication Using GTIDs
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-failover.html">
       19.1.3.5 Using GTIDs for Failover and Scaleout
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-assign-anon.html">
       19.1.3.6 Replication From a Source Without GTIDs to a Replica With GTIDs
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-restrictions.html">
       19.1.3.7 Restrictions on Replication with GTIDs
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-gtids-functions.html">
       19.1.3.8 Stored Function Examples to Manipulate GTIDs
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045146443104">
  </a>
  <p>
   This section explains transaction-based replication using
   <span class="firstterm">
    global transaction identifiers
   </span>
   (GTIDs). When using GTIDs, each transaction can be identified and
    tracked as it is committed on the originating server and applied by
    any replicas; this means that it is not necessary when using GTIDs
    to refer to log files or positions within those files when starting
    a new replica or failing over to a new source, which greatly
    simplifies these tasks. Because GTID-based replication is completely
    transaction-based, it is simple to determine whether sources and
    replicas are consistent; as long as all transactions committed on a
    source are also committed on a replica, consistency between the two
    is guaranteed. You can use either statement-based or row-based
    replication with GTIDs (see
   <a class="xref" href="replication-formats.html" title="19.2.1 Replication Formats">
    Section 19.2.1, “Replication Formats”
   </a>
   );
    however, for best results, we recommend that you use the row-based
    format.
  </p>
  <p>
   GTIDs are always preserved between source and replica. This means
    that you can always determine the source for any transaction applied
    on any replica by examining its binary log. In addition, once a
    transaction with a given GTID is committed on a given server, any
    subsequent transaction having the same GTID is ignored by that
    server. Thus, a transaction committed on the source can be applied
    no more than once on the replica, which helps to guarantee
    consistency.
  </p>
  <p>
   This section discusses the following topics:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      How GTIDs are defined and created, and how they are represented
        in a MySQL server (see
      <a class="xref" href="replication-gtids-concepts.html" title="19.1.3.1 GTID Format and Storage">
       Section 19.1.3.1, “GTID Format and Storage”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      The life cycle of a GTID (see
      <a class="xref" href="replication-gtids-lifecycle.html" title="19.1.3.2 GTID Life Cycle">
       Section 19.1.3.2, “GTID Life Cycle”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      The auto-positioning function for synchronizing a replica and
        source that use GTIDs (see
      <a class="xref" href="replication-gtids-auto-positioning.html" title="19.1.3.3 GTID Auto-Positioning">
       Section 19.1.3.3, “GTID Auto-Positioning”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      A general procedure for setting up and starting GTID-based
        replication (see
      <a class="xref" href="replication-gtids-howto.html" title="19.1.3.4 Setting Up Replication Using GTIDs">
       Section 19.1.3.4, “Setting Up Replication Using GTIDs”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      Suggested methods for provisioning new replication servers when
        using GTIDs (see
      <a class="xref" href="replication-gtids-failover.html" title="19.1.3.5 Using GTIDs for Failover and Scaleout">
       Section 19.1.3.5, “Using GTIDs for Failover and Scaleout”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      Restrictions and limitations that you should be aware of when
        using GTID-based replication (see
      <a class="xref" href="replication-gtids-restrictions.html" title="19.1.3.7 Restrictions on Replication with GTIDs">
       Section 19.1.3.7, “Restrictions on Replication with GTIDs”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      Stored functions that you can use to work with GTIDs (see
      <a class="xref" href="replication-gtids-functions.html" title="19.1.3.8 Stored Function Examples to Manipulate GTIDs">
       Section 19.1.3.8, “Stored Function Examples to Manipulate GTIDs”
      </a>
      ).
     </p>
    </li>
   </ul>
  </div>
  <p>
   For information about MySQL Server options and variables relating to
    GTID-based replication, see
   <a class="xref" href="replication-options-gtids.html" title="19.1.6.5 Global Transaction ID System Variables">
    Section 19.1.6.5, “Global Transaction ID System Variables”
   </a>
   . See also
   <a class="xref" href="gtid-functions.html" title="14.18.2 Functions Used with Global Transaction Identifiers (GTIDs)">
    Section 14.18.2, “Functions Used with Global Transaction Identifiers (GTIDs)”
   </a>
   , which describes SQL functions
    supported by MySQL 8.4 for use with GTIDs.
  </p>
 </div>
 <br/>
</div>
