Search⌘ K

What Is Replication in Databases?

Learn about database replication, a process of copying data across multiple nodes to enhance availability, distribute load, and reduce latency. Discover different replication types including full, transactional, snapshot, merge, and key-based incremental replication. Understand replication challenges and how replication logs like WAL shipping and logical replication maintain data consistency. This lesson equips you with knowledge of replication strategies and their impact on distributed database systems.

Introduction

Replication is copying data from a host machine to multiple destination machines connected via a network. Basically, replication is the process of storing data in more than one place. Every node that stores a copy of the data is called a replica.

These are the advantages of replication:

  • High availability: By storing the copies of data in multiple host machines, the database is resilient to individual host machines' failures and can safely redirect the reads and writes to live host machines.

  • Load distribution: The database can redistribute the read and write queries to multiple host machines, thus preventing the load on single host machines.

  • Reduced latency: The replicated host machines can be placed geographically closer to the user, thus reducing the latency on the end user.

Types of replication

There are a number of different types of replication:

  • Full replication

  • Transactional replication

  • Snapshot replication

  • Merge replication

  • Key-based incremental replication

Full replication

Full replication is where we replicate the complete data from one host machine to another. This ...