What is Database Replication?

Turkish: Replikasyon

Database replication copies data across multiple servers to improve availability, redundancy, and read capacity without moving the primary workload.

What is Database Replication?

Database replication is the process of copying changes from one database server to one or more other servers. The goal is to reduce dependency on a single machine, distribute read traffic, and recover faster when infrastructure fails.

In an e-commerce system, order writes may go to the primary database while reporting screens or product listing queries read from replicas. This keeps heavy read traffic from consuming the primary write capacity.

Types of Replication

  • Primary-replica: Writes happen on the primary server; replicas are used for reads and redundancy.
  • Synchronous replication: A change is not considered complete until the replica confirms it, improving consistency but adding latency.
  • Asynchronous replication: The primary responds quickly and replicas may lag slightly; this is common in web applications.
  • Multi-primary: More than one node accepts writes, which makes conflict handling harder.

Business Use

In databases such as PostgreSQL, replication is not a replacement for backups. If data is accidentally deleted, that delete can also be replicated. Snapshots, point-in-time recovery, and access controls must be designed separately.

Sharding scales by splitting data into partitions, while replication creates copies of the same data. Large systems may use both, but application code must understand read-write routing and possible replica lag.