Multi-master replication
From Wikipedia, the free encyclopedia
Multi-master replication is a method of replication employed by databases to transfer data or changes to data across multiple computers within a group. Multi-master replication can be contrasted with a master-slave method (also known as single-master replication). Benefits of Multi-master replication :
- If one master fails, other masters will continue to update the database.
- Masters can be located in several physical sites i.e. distributed across the network.
Disadvantages of Multi-master replication :
- Most multi-master replication systems are only loosely consistent, i.e. lazy and asynchronous, violating ACID properties.
- Eager replication systems are complex and introduce some communication latency.
Contents |
[edit] Methods
[edit] Log-Based
A database transaction log is referenced to capture changes made to the database. For log-based transaction capturing, database changes can only be distributed asynchronously.
[edit] Trigger-Based
Triggers at the subscriber capture changes made to the database and submit them to the publisher. With trigger-based transaction capturing, database changes can be distributed either synchronously or asynchronously.
[edit] Implementations
Many directory servers based on LDAP implement multi-master replication. OpenDS implements "synchronization" instead.
[edit] Active Directory
For example, one of the more prevalent of multi-master replication implementations in directory servers is Microsoft's Active Directory. Within Active Directory, objects that are updated on one Domain Controller are then replicated to other domain controllers through multi-master replication. It is not required for all domain controllers to replicate with each other's domain controller as this would cause excessive network traffic in large Active Directory implementations. Instead, domain controllers have a complex update pattern that ensures that all servers are updated in a timely fashion without excessive replication traffic. Some Active Directory needs are better served by Flexible single master operation.
[edit] Oracle
Oracle database clusters implement multi-master replication using one of two methods. Asynchronous multi-master replication commits data changes to a deferred transaction queue which is periodically processed on all databases in the cluster. Synchronous multi-master replication uses Oracle's two phase commit functionality to ensure that all databases with the cluster have a consistent dataset.
[edit] MySQL
MySQL ships with replication support. Using features introduced in MySQL 5.0, it is possible to achieve a multi-master replication scheme.[1]
[edit] Postgres
Postgres offers multiple solutions for multi-master replication, including solutions based on two phase commit. There's Bucardo, PgPool and PgPool-II, PgCluster and Sequoia as well as some proprietary solutions. Another promising approach, implementing eager but asynchronous replication is Postgres-R. It's still in development.
[edit] Ingres
Ingres Within Ingres Replicator, objects that are updated on one Ingres server can then replicated to other servers whether local or remote through multi-master replication. If one server fails, client connections can be re-directed to another server. It is not required for all Ingres servers in an environment to replicate with each other as this could cause excessive network traffic in large implementations. Instead, Ingres Replicator provides an elegant and sophisticated design that allows the appropriate data to be replicated to the appropriate servers without excessive replication traffic. This means that some servers in the environment can serve as failover candidates while other servers can meet other requirements such as managing a subset of columns or tables for a departmental solution, a subset of rows for a geographical region or one-way replication for a reporting server. In the event of a source, target, or network failure, data integrity is enforced through this two-phase commit protocol by ensuring that either the whole transaction is replicated, or none of it is. In addition, Ingres Replicator can operate over RDBMS’s from multiple vendors to connect them.
[edit] DBReplicator
DBReplicator is a powerful open-source Java application for network-based multi-master heterogeneous database replication or filtered synchronization. Supported databases include: CloudScape / Apache Derby / JavaDB, DaffodilDB / One$DB, IBM DB2, Firebird (database server), MySQL, Oracle Database, PointBase, PostgreSQL, SQLServer, Sybase.
[edit] See also
- Flexible single master operation
- Active Directory
- Distributed database management system
- DNS zone transfer
- Optimistic Replication