Replication Levels

Database replication is a hot topic these days. However, I have not yet seen a careful writeup of the different replication alernatives possible. This is an attempt to describe and name them.


Replication can mean different things to different people. This is because different applications require different levels of sophistication. Consider the following three applications:

The List

Lets try to explore these a little more thoroughly, and give them names.
Master Mirroring
This is the easiest form of replication to implement. There is a single master copy, and all changes are made to it. After changes have been made, the database is taken off-line, a backup is made, and copies of the back are installed on the mirror machines. Of course, if a database supports hot, on-line, consistent backups, then the copies can be made without taking the master offline.

Any good system administrator can do this, and this reqires no special consideration from the database designers. This strategy is fairly robust: if the master copy is lost, the mirrors can still operate, and the master can be reconstructed from the mirrors.

The drawbacks of this style of replication should be obvious: this model does not support distributed transactions. Transaction processing can only be done on the master, and thus the master is a critical componenet, and is also a bottleneck. The mirrors can be used only for viewing (reading).

The advantages of this style should also be obvious: by installing mirrors (which may be geographically separated by thousands of miles) performance for viewing is radically improved, since one machine does not have to handle all the load. The strength of this scheme is it's simplicity.

Peer Mirroring
The next level above Master Mirroring is Peer Mirroring. In this scheme, database updates can be performed on multiple "masters". Synchronization is acheived by having changes propagated from one mirror to another through journal logs. Consistency should be verified monthly or weekly by comparing the contents of each of the peers.

The disadvantage of this system is that it does not support transactions. There is no record locking during updates, and race conditions exist.

Under Construction
Version 0.1 September 1996 Linas Vepstas

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included at the URL, the web page titled "GNU Free Documentation License".
Return to the Linux Enterprise Computing Page