What Is Data Replication? {Replication Types and Schemes Explained}

June 17, 2021

Introduction

One of the greatest threats to modern databases is data loss due to hardware failure or ransomware. Distributed databases offer a solution by replicating data in different physical locations.

Database replication allows to distribute parts of a database across multiple nodes.

In this tutorial, we will cover how data replication works, when to use it, different replication types and schemes, and tools that help replicate a database.  

What is database replication?

What Is Database Replication?

Database replication is the process of copying data and storing it in different locations. Performing data replication ensures there is a consistent copy of the database across all the nodes in a distributed system. This serves to make the data widely available and protect from data loss.

The replicated data can be a full or partial snapshot and it can be stored on-site, off-site, or in a cloud environment. In case of downtime, organizations recover data and maintain business continuity by restoring from a backup location.

Note: 90% of businesses without a disaster recovery plan close after a major disruption. Eliminate this risk with industry-leading Disaster-Recovery-as-a-Service (DRaaS) solutions.

Data is replicated either synchronously or asynchronously:

  • Synchronous replication. Data is written simultaneously to the primary database and all its replicas.
  • Asynchronous replication. Data is written to the primary database first and then copied to the replicas later.

Database Replication Types

There are several different methods to replicate a database. Organizations should choose a technique based on the purpose of the replicated data and how they intend to access it.

Snapshot Replication

Snapshot replication copies a "snapshot" of the database - precisely as it appears the moment the replication process starts. It does not monitor for changes or updates to the data.

Snapshot replication is useful when the data doesn't change frequently, but also if there are significant changes over a short time. Any change to the database makes a snapshot outdated until a new one is replicated.

Note: Snapshots and backups are not mutually exclusive. Read up on the main concepts and differences between these two solutions in our post Snapshot vs Backup.

Transactional Replication

Transactional replication creates a full copy of the database, with new data coming in as the database changes. Data is copied in real-time in the order of changes made, which ensures consistency.

It is best to use transactional replication for ensuring incremental, real-time changes to data. This improves performance and decreases latency while providing a high volume of read, write, and delete activity.

Merge Replication

Merge replication combines data from several sources into a single database. Using merge replication allows multiple users to change the data and have all the changes applied to the new replica.

Merge replication helps quickly discover and address conflicting changes. It also allows users to make changes offline before synchronizing with the server.

Heterogeneous Replication

Heterogenous replication is used to replicate data between servers supplied by different vendors. For instance, it allows you to copy data from an SQL server to a non-SQL server.

Peer-to-Peer Transactional Replication

Peer-to-peer replication is based on transactional replication. It allows all participating users and servers to send data to each other so that the updates happen in near real-time.

Peer-to-peer replication is especially useful for web applications. Its flexibility helps scale the number of users without affecting performance. It also makes the system more robust, allowing servers to shut off for maintenance.

Note: Refer to our article Backup vs Replication to learn about the main differences and benefits.

Database Replication Schemes

The following replication schemes are used for database replication:

Full Replication

Performing a full replication means copying the complete database to every node of the distributed system. This approach maximizes data redundancy, increases global performance and data availability. Data is available as long as one node is functional.

An example diagram of full database replication

In the example above, all parts of the original database (P1, P2, P3) are fully replicated to all sites.

Full replication takes longer to perform as the update needs to be replicated to all sites. Furthermore, the costs of storing full data snapshots at multiple locations can add up.

Partial Replication

Copying only certain parts of a database is partial replication. This is usually decided by how important it is to have the data available at each location.

An example diagram of partial database replication

In the example above, only certain parts of the original database (P1, P2, P3) are replicated to a single node.

When using a partial replication scheme, the number of copies for each part of the database can range from one to the number of total nodes in the distributed system.

No Replication

With no replication, each node in a distributed system only receives a copy of one part of the database. This replication scheme is the fastest to perform, but it tends to lower data availability and leaves the database vulnerable to data loss. However, concurrency is easy to achieve.

An example diagram of no database replication

In the example above, only a single fragment of the original database is replicated to a specific node.

Database Replication Software and Tools

Many database management tools offer ways to perform database replication. There are also third-party replication tools that provide the same features.

Third-party tools may even be more flexible since most allow you to replicate across multiple types of databases. Here are some of the most popular examples:

  • phoenixNAP Data Backup and Restore. phoenixNAP offers multiple backup options and solutions, including Veeam integration, cloud database backup, managed backup for Office 365, and DRaaS (Disaster Recovery as a Service).
  • Veeam Backup & Replication. Veeam works with different types of databases, including cloud databases, virtual, Kubernetes, and physical distributions. It offers continuous data protection, advanced replication and failover for disaster recovery, and instant recovery for popular database managers, such as NAS, Microsoft SQL, and Oracle.
  • Acronis Cyber Backup. Acronis supports over 20 database platforms and offers advanced security features, such as AI-based ransomware prevention.
  • NAKIVO Backup & Replication. NAKIVO offers features like support for live apps, file and object-level recovery, global deduplication, and automatic reports. It can replicate data locally, on a remote server, or in the cloud.
  • Carbonite Safe Backup. Carbonite is geared towards smaller businesses. It offers automatic cloud and hard drive backup, image backup and bare-metal restore, and database replication at higher tiers.

Note: Learn everything you need to know about disaster recovery, the types and how it works in our post What is Disaster Recovery?

Advantages of Data Replication

Using database replication helps:

  • Ensure business continuity with a Disaster Recovery Plan. In case of hardware failure or a ransomware attack, having data replication as part of your disaster recovery plan ensures there's an off-site copy of the system. That enables organizations to restore data and maintain business continuity.
  • Improve performance. Having the same data in multiple locations means a user can retrieve data from the nearest server, reducing network latency and increasing performance.
  • Improve multi-user support. Data replication helps with query execution, especially when multiple users are accessing the database.
  • Improve analytics. Having a separate, complete copy of a database allows a team to perform analytics without affecting performance.
  • Improve availability. Several users can access and manage data in a distributed database without getting in each other's way.

Disadvantages of Data Replication

Data replication poses several challenges:

  • It can require a lot of storage space, especially for full replications. This can create high costs or reduce performance if many replicas need to be updated simultaneously.
  • Maintaining data consistency is difficult when using methods like merge or peer-to-peer replication.

Conclusion

After reading this article, you should have a solid knowledge of what database replication is and all the methods and replication schemes you can use to perform one.

You should also have a good starting point for choosing a database replication solution that will provide an easy and effective way to replicate data.

Was this article helpful?
YesNo
Aleksandar Kovačević
Aleksandar Kovacevic is an aspiring Technical Writer at phoenixNAP. With a background in both design and writing, he aims to bring a fresh perspective to writing for IT, making complicated concepts easy to understand and approach.
Next you should read
What Is a Distributed Database?
May 6, 2021

Distributed databases are a solution for various issues that arise when using a centralized database. Learn about distributed databases and their advantages and disadvantages.
Read more
Database Types
May 13, 2021

There are many different types of databases currently available. The wrong choice can have a great impact. Whether you're looking to learn about the different database types or looking into how to make a choice, this article gives
Read more
What Is a Database Server & What Is It Used For?
May 31, 2021

A database server is a machine used to store the database and to manage data access and retrieval. Read this article to learn more about database servers, how they work, and to see some examples of database servers.
Read more
What Is a Relational Database?
June 10, 2021

Relational databases provide a structured and consistent way of storing data. This guide covers the definition of relational databases, the way they organize data, and the pros and cons to using them.
Read more
  • © 2021 Copyright phoenixNAP | Global IT Services. All Rights Reserved.