<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="replication-multi-source">
      </a>
      19.1.5 MySQL Multi-Source Replication
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="replication-multi-source-configuration.html">
       19.1.5.1 Configuring Multi-Source Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-provision-replica.html">
       19.1.5.2 Provisioning a Multi-Source Replica for GTID-Based Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-adding-gtid-master.html">
       19.1.5.3 Adding GTID-Based Sources to a Multi-Source Replica
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-adding-binlog-master.html">
       19.1.5.4 Adding Binary Log Based Replication Sources to a Multi-Source Replica
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-start-replica.html">
       19.1.5.5 Starting Multi-Source Replicas
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-stop-replica.html">
       19.1.5.6 Stopping Multi-Source Replicas
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-reset-replica.html">
       19.1.5.7 Resetting Multi-Source Replicas
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-multi-source-monitoring.html">
       19.1.5.8 Monitoring Multi-Source Replication
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045145327696">
  </a>
  <a class="indexterm" name="idm46045145326608">
  </a>
  <a class="indexterm" name="idm46045145325104">
  </a>
  <a class="indexterm" name="idm46045145323600">
  </a>
  <p>
   Multi-source replication in MySQL 8.4 enables a replica
    to receive transactions from multiple immediate sources in parallel.
    In a multi-source replication topology, a replica creates a
    replication channel for each source that it should receive
    transactions from. For more information on how replication channels
    function, see
   <a class="xref" href="replication-channels.html" title="19.2.2 Replication Channels">
    Section 19.2.2, “Replication Channels”
   </a>
   .
  </p>
  <p>
   You might choose to implement multi-source replication to achieve
    goals like these:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Backing up multiple servers to a single server.
     </p>
    </li>
    <li class="listitem">
     <p>
      Merging table shards.
     </p>
    </li>
    <li class="listitem">
     <p>
      Consolidating data from multiple servers to a single server.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Multi-source replication does not implement any conflict detection
    or resolution when applying transactions, and those tasks are left
    to the application if required.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Each channel on a multi-source replica must replicate from a
      different source. You cannot set up multiple replication channels
      from a single replica to a single source. This is because the
      server IDs of replicas must be unique in a replication topology.
      The source distinguishes replicas only by their server IDs, not by
      the names of the replication channels, so it cannot recognize
      different replication channels from the same replica.
   </p>
  </div>
  <p>
   A multi-source replica can also be set up as a multi-threaded
    replica, by setting the system variable
   <a class="link" href="replication-options-replica.html#sysvar_replica_parallel_workers">
    <code class="literal">
     replica_parallel_workers
    </code>
   </a>
   to a value
    greater than 0. When you do this on a multi-source replica, each
    channel on the replica has the specified number of applier threads,
    plus a coordinator thread to manage them. You cannot configure the
    number of applier threads for individual channels.
  </p>
  <p>
   MySQL 8.4 also supports replication filters on specific
    replication channels with multi-source replicas. Channel specific
    replication filters can be used when the same database or table is
    present on multiple sources, and you only need the replica to
    replicate it from one source. For GTID-based replication, if the
    same transaction might arrive from multiple sources (such as in a
    diamond topology), you must ensure the filtering setup is the same
    on all channels. For more information, see
   <a class="xref" href="replication-rules-channel-based-filters.html" title="19.2.5.4 Replication Channel Based Filters">
    Section 19.2.5.4, “Replication Channel Based Filters”
   </a>
   .
  </p>
  <p>
   This section provides tutorials on how to configure sources and
    replicas for multi-source replication, how to start, stop and reset
    multi-source replicas, and how to monitor multi-source replication.
  </p>
 </div>
 <br/>
</div>
