Database Replication

Database replication is a process of synchronization in which data added to one database is automatically copied to the other. Replication should not be confused with clustering, as they serve different purposes: cluster databases are made of several self-sufficient nodes, each of which can act as a standalone server, while replication configuration suggests that each server makes its own part of the work.

There are two main methods of database replication: statement-based replication (SBR) and row-based replication (RBR). Both of them suggest that you start with identical contents of your databases and enable logging on the Master Server. In statement-based replication, the system saves all client queries that somehow modify the Master database and then issues the same queries to Slave databases. Row-based replication tracks changes on row level: whenever a client application adds or modifies a row in a table of the Master database, the same row is added or modified in the Slave database.

Since replication expects Master and Slave databases to be identical, you need to synchronize their contents before enabling it. This can be done with Handy Backup, which features a number of plug-ins designed for backup and recovery of different database management systems. If your applications are based on MySQL, please see MySQL Replication.

Master-to-Master Database Replication

Besides Master-to-Slave database replication, there is also a Master-to-Master scheme which is more tricky. In this configuration, each server acts as a Master and a Slave at the same time. This approach is more complicated in setup and maintenance, but provides faster database recovery in case of disaster.

Master-to-Master replication is not the same thing as clustering, because it doesn’t expect the servers to share one configuration. A target use for using this type of configuration is geographical distribution of the database.

Database Replication and Backups

Another common use for database replication is backing up. The matter is that exporting all data from a database may slow down the server so much that it will effectively hang. The most effective solution for it is setting up a Slave replication server that will automatically receive all latest updates, and use it for backup purposes. If you are using MySQL DBMS, you can read more at the MySQL Backup feature page.



Learn more:

  • Foreign Key
    "Foreign key is a field in a “child” table of a database that is used to refer to a record in a “parent” table of the same database. For example, if there…"
  • MySQLDump: What is Mysqldump used for? Alternative Solution
    "The mysqldump utility is a free software allowing "logical" backup of any MySQL database by saving it to a text sequence of SQL queries. Originally…"
  • MySQL Clustering
    "MySQL clustering is a technology that allows distributing the MySQL database across multiple independent nodes, to eliminate every possibility of failure.…"


Backup Terms Glossary

Who uses Handy Backup?