![]() |
|
11.19.08 MySQL Replication By Jay Fougere Replication is a way to run several SQL servers so that all of them have a current copy of a database or databases. Keep in mind that replication is not the same as clustering and should not be confused as such, even though replication can solve many of the same problems that clustering resolves; albeit in a different manner. Replication can be handled in one of a few ways, however the most popular methods use a master-slave, master-master or a circular relationship. A master-slave relationship is where the master machine receives writes to the database which are then replicated to the slaves with very small delays. There will be no changes made to the database(s) on the slave(s) directly as the slave(s) will receive all changes from the master. A master-master relationship is a little misleading by name. In this situation all of the machines in the group act as both master and slave machines. This can be a bit trickier to set up than the traditional master-slave scenario. Master-master replication works well with two machines, however if your needs exceed the capabilities of two machines you may consider circular replication. Lastly, you can set up circular replication, which is similar in some ways to both master-master and master-slave. The best way to describe circular replication is with an example. Let's suppose you have three machines; Moe, Larry, and Curly. Moe runs MySQL as a slave to Larry but as master to Curly. Larry, as mentioned, is master to Moe but is a slave to Curly. That leaves Curly as master to Larry but slave to Moe. This way a change on any one machine replicates across all machines. See below:
![]() One thing to keep in mind when considering replication is the location of the individual servers. Servers should be in the same physical location and would ideally even be located on the same network switch. Due to the nature of the Iinternet I cannot recommend trying to replicate over the internet and I would not even consider it unless the database in question is a very low volume database with regard to write transactions. Continue reading this article. About the Author: Jay Fougere is the IT manager for the iEntry network. He also writes occasional articles. If you have any IT questions, please direct them to Jay@ientry.com. |
|
| ||
| --
SQLProNews is an iEntry, Inc. publication -- iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 2008 iEntry, Inc. All Rights Reserved Privacy Policy Legal advertising info | news headlines | free newsletters | comments/feedback | submit article |