Multi-master replication
![]() | This article includes a list of general references, but it lacks sufficient corresponding inline citations. (May 2012) |
Multi-master replication is a method of database
Multi-master replication can be contrasted with
Multi-master replication can also be contrasted with failover clustering where passive replica servers are replicating the master data in order to prepare for takeover in the event that the master stops functioning. The master is the only server active for client interaction.
Often, communication and replication in Multi-master systems are handled via a type of
The primary purposes of multi-master replication are increased availability and faster server response time.[1]
Advantages
- Availability: If one master fails, other masters continue to update the database.
- Distributed access: Masters can be located in several physical sites, i.e. distributed across the network.
Disadvantages
- Consistency: Most multi-master replication systems are only loosely consistent, i.e. lazy and asynchronous, violating ACID properties.
- Performance: Eager replication systems are complex and increase communication latency.
- Integrity: Issues such as conflict resolution can become intractable as the number of nodes involved rises and latency increases.
Implementations
Directory services
Many directory servers are based on Lightweight Directory Access Protocol (LDAP) and implement multi-master replication.
Active Directory
One of the more prevalent multi-master replication implementations in directory servers is
CA Directory
CA Directory supports multi-master replication.
OpenDS/OpenDJ
OpenLDAP
Database management systems
Amazon Aurora
Amazon Aurora is composed of writer nodes, which replicate redo records, and 6 storage nodes. The writer node sends change to each storage node, each of which checks for conflicts then reports confirmation or rejection of the change.[2]
Apache CouchDB
Each document contains a revision ID, so every record stores the evolutionary timeline of all previous revision IDs leading up to itself—which provides the foundation of CouchDB's MVCC system. Additionally, it keeps a by-sequence index for the entire database. "The replication process only copies the last revision of a document, so all previous revisions that were only on the source database are not copied to the destination database."[3]
The CouchDB replicator acts as a simple HTTP client acting on both a source and target database. It compares current sequence IDs for the database, calculates revision differences, and makes the necessary changes to the target based on what it found in the history of the source database. Bi-directional replication is the result of merely doing another replication with the source and target values swapped.
ArangoDB
ArangoDB is a native multi-model database system using multi-master replication. Clusters in ArangoDB use the CP master/master model with no single point of failure. When a cluster encounters a network partition, ArangoDB prefers to maintain its internal consistency over availability. Clients experience the same view of the database regardless of which node they connect to. And, the cluster continues to serve requests even when one machine fails.[4]
Cloudant
eXtremeDB Cluster
eXtremeDB Cluster is the clustering sub-system for McObject's eXtremeDB embedded database product family. It maintains database consistency across multiple hardware nodes by replicating transactions in a synchronous manner (two-phase commit). An important characteristic of eXtremeDB Cluster is transaction replication, in contrast to log file-based, SQL statement-based, or other replication schemes that may or may not guarantee the success or failure of entire transactions. Accordingly, eXtremeDB Cluster is an ACID compliant system (not BASE or eventual consistency); a query executed on any cluster node will return the same result as if executed on any other cluster node.
Oracle
Microsoft SQL
Microsoft SQL provides multi-master replication through peer-to-peer replication. It provides a scale-out and high-availability solution by maintaining copies of data across multiple nodes. Built on the foundation of transactional replication, peer-to-peer replication propagates transactionally consistent changes in near real-time.[5]
MySQL / MariaDB
At a basic level, it is possible to achieve a multi-master replication scheme beginning with MySQL version 3.23 with circular replication. Departing from that, MariaDB and MySQL ship with some replication support, each of them with different nuances.
In terms of direct support we have:
MariaDB: natively supports multi-master replication since version 10.0, but conflict resolution is not supported, so each master must contain different databases. On MySQL, this is named multi-source available since version 5.7.6.
MySQL: MySQL Group Replication, a plugin for virtual synchronous multi-master with conflict handling and distributed recovery was released with 5.7.17.
Cluster Projects:
MySQL Cluster supports conflict detection and resolution between multiple masters since version 6.3 for true multi-master capability for the MySQL Server.
There is also an external project, Galera Cluster created by codership Archived 2011-09-27 at the Wayback Machine, that provides true multi-master capability, based on a fork of the InnoDB storage engine and custom replication plug-ins. Replication is synchronous, so no conflict is possible.
Percona XtraDB Cluster also is a combination of Galera replication library and MySQL supporting multi-master.
PostgreSQL
Various options for synchronous multi-master replication exist. Postgres-XL which is available under the Mozilla Public License, and PostgresXC (now known as Postgres-X2) which is available under the same license as PostgreSQL itself are examples. Note that the PgCluster (Archived 2017-07-05 at the Wayback Machine) project was abandoned in 2007.
The replication documentation for PostgreSQL[6] categorises the different types of replication available. Various options exist for distributed multi-master, including Bucardo, rubyrep and BDR Bi-Directional Replication.
PostgreSQL BDR
BDR is aimed at eventual inclusion in PostgreSQL core and has been benchmarked as demonstrating significantly enhanced performance[7] over earlier options. BDR includes replication of data writes (DML), as well as changes to data definition (DDL) and global sequences. BDR nodes may be upgraded online from version 0.9 onwards. 2ndQuadrant has developed BDR continuously since 2012, with the system used in production since 2014. The latest version BDR 3.6 provides column-level conflict detection, CRDTs, eager replication, multi-node query consistency, and many other features.
Ingres
Within
See also
- Flexible single master operation
- Active Directory
- Distributed database management system
- DNS zone transfer
- Optimistic replication
References
- ^ Postgres-XC Archived 2012-07-01 at the Wayback Machine under What Is Postgres-XC?:
Write-scalable means Postgres-XC can be configured with as many database servers as you want and handle many more writes (updating SQL statements) compared to what a single database server can not do
- ^ "Build highly available MySQL applications using Amazon Aurora Multi-Master". 8 August 2019.
- ^ "Apache CouchDB Replication". Apache Foundation - Apache CouchDB Project.
- ^ "ArangoDB Cluster Architecture". ArangoDB - ArangoDB Architecture.
- ^ Peer-to-Peer Transactional Replication
- ^ Comparison of different replication solutions for PostgreSQL As found in PostgreSQL 9 documentation. Retrieved 2012-05-08
- ^ BDR Performance Petr Jelinek, 2ndQuadrant. Retrieved 2014-07-10
External links
- Active Directory Replication Model
- Terms and Definitions for Database Replication
- SymmetricDS is database independent, GPL) and commercial licenses.
- Daffodil Replicator is a GPL-licensed) versions.
- DMOZ Open Directory Project - Database Replication Page