DBPedias

All your database knowledge are belong to you

MySQL

Replication - Circular Setup

Strengths of Circular:

  • Most robust setup, death of a slave does not affect other slaves.

Weaknesses:

  • Difficult to set up.
  • Requires complex checking on the application side.

Recommended Environment:

  • This setup is not recommended.
RPC 66.gif

The circular set up is used by some because once it is up, any failure can be easily recovered from because the rest of the replication array is still intact.

While it appears that this setup would cause an infinite loop, the server_id of each machine is written into the binary log, and any server will ignore a statement in the log with its own server_id.

The complication comes in because the array is very easy to corrupt. Imagine inserting a row into a table on server 10 from client A while server 12 gets a write from client B to the same table before the write to server 10 is replicated. If auto_increment is set, then it is likely that the primary keys for the same row will be different. This will first cause minor errors that will likely not be noticed but will eventually corrupt large portions of data. This setup is not recommended. Use NDB and MySQL Cluster instead.