<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="replication-implementation">
      </a>
      19.2 Replication Implementation
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="replication-formats.html">
       19.2.1 Replication Formats
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-channels.html">
       19.2.2 Replication Channels
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-threads.html">
       19.2.3 Replication Threads
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replica-logs.html">
       19.2.4 Relay Log and Replication Metadata Repositories
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-rules.html">
       19.2.5 How Servers Evaluate Replication Filtering Rules
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045138569168">
  </a>
  <p>
   Replication is based on the source server keeping track of all
    changes to its databases (updates, deletes, and so on) in its binary
    log. The binary log serves as a written record of all events that
    modify database structure or content (data) from the moment the
    server was started. Typically,
   <a class="link" href="select.html" title="15.2.13 SELECT Statement">
    <code class="literal">
     SELECT
    </code>
   </a>
   statements are not recorded because they modify neither database
    structure nor content.
  </p>
  <p>
   Each replica that connects to the source requests a copy of the
    binary log. That is, it pulls the data from the source, rather than
    the source pushing the data to the replica. The replica also
    executes the events from the binary log that it receives. This has
    the effect of repeating the original changes just as they were made
    on the source. Tables are created or their structure modified, and
    data is inserted, deleted, and updated according to the changes that
    were originally made on the source.
  </p>
  <p>
   Because each replica is independent, the replaying of the changes
    from the source's binary log occurs independently on each replica
    that is connected to the source. In addition, because each replica
    receives a copy of the binary log only by requesting it from the
    source, the replica is able to read and update the copy of the
    database at its own pace and can start and stop the replication
    process at will without affecting the ability to update to the
    latest database status on either the source or replica side.
  </p>
  <p>
   For more information on the specifics of the replication
    implementation, see
   <a class="xref" href="replication-threads.html" title="19.2.3 Replication Threads">
    Section 19.2.3, “Replication Threads”
   </a>
   .
  </p>
  <p>
   Source servers and replicas report their status in respect of the
    replication process regularly so that you can monitor them. See
   <a class="xref" href="thread-information.html" title="10.14 Examining Server Thread (Process) Information">
    Section 10.14, “Examining Server Thread (Process) Information”
   </a>
   , for descriptions of all
    replicated-related states.
  </p>
  <p>
   The source's binary log is written to a local relay log on the
    replica before it is processed. The replica also records information
    about the current position with the source's binary log and the
    local relay log. See
   <a class="xref" href="replica-logs.html" title="19.2.4 Relay Log and Replication Metadata Repositories">
    Section 19.2.4, “Relay Log and Replication Metadata Repositories”
   </a>
   .
  </p>
  <p>
   Database changes are filtered on the replica according to a set of
    rules that are applied according to the various configuration
    options and variables that control event evaluation. For details on
    how these rules are applied, see
   <a class="xref" href="replication-rules.html" title="19.2.5 How Servers Evaluate Replication Filtering Rules">
    Section 19.2.5, “How Servers Evaluate Replication Filtering Rules”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
