Mysql replication

From wikinotes
Revision as of 19:38, 17 September 2022 by Will (talk | contribs) (Created page with "Replication lets you mirror all data written to a database to one or more others.<br> Generally, this is used for read-optimizations, but it is possible to use as a write-optimization. {{ NOTE | much more information in my textbook, return as needed }} = Overview = <blockquote> Replication Types <syntaxhighlight lang="yaml"> logical: every sql statement is repeated on the slave database row: every row is replicated to the slave database </syntaxhighlight> Replicat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Replication lets you mirror all data written to a database to one or more others.
Generally, this is used for read-optimizations, but it is possible to use as a write-optimization.

NOTE:

much more information in my textbook, return as needed

Overview

Replication Types

logical: every sql statement is repeated on the slave database
row:     every row is replicated to the slave database

Replication works by:

  • recording a binary log of events on the master
  • copying the master's binary log to the slave's relay log
  • the slave replays events from it's relay log