DBMS Topics
Replication in Distributed Databases
Last Updated : 21 May, 2026
Replication is maintaining identical copies of data fragments or entire relations at more than one site in a distributed database system.
Definition
Replication is maintaining identical copies of data (fragments or entire relations) at more than one site in a distributed database system.
Why Replication?
| Problem 1 | Availability |
| If data is at only one site and that site fails | data unavailable. |
| Problem 2 | Performance |
| Users in Chennai querying data stored only in Delhi | slow (network latency). |
| Replicate frequently-read data near users | fast local access. |
Replication Models
Synchronous Replication (Eager)
All replicas are updated simultaneously as part of the same transaction.
Transaction UPDATE Employee WHERE emp_id = 101:
1. Update replica at Site A
2. Update replica at Site B ← must complete before commit
3. Update replica at Site C ← must complete before commit
4. COMMIT (only if ALL sites confirm)
Advantage: All replicas always in sync (strong consistency)
Disadvantage: High latency; transaction blocked if any site is slow/downAsynchronous Replication (Lazy)
The primary site is updated first; replicas are updated later in the background.
| Transaction commits at primary site | DONE |
| Background process propagates update to replicas (delay | milliseconds to minutes) |
| Advantage | Fast commit; high availability |
| Disadvantage | Replicas temporarily stale (eventual consistency) |
| Used in | MySQL replication, read replicas in cloud databases |
Replication Topologies
| Used in | MySQL, PostgreSQL streaming replication |
| Used in | CouchDB, Cassandra, MySQL Group Replication |
| Used in | Cassandra (replication factor N) |
Conflict Resolution
In multi-master replication, two sites may update the same record simultaneously:
| Site A updates Employee E001 salary: 75000 | 80000 |
| Site B updates Employee E001 salary: 75000 | 78000 (simultaneously) |
| - Last-Write-Wins (LWW) | timestamp determines winner |
| - Application-level | application logic decides |
| - Manual | DBA resolves conflicts |
| - Vector clocks | track causal order of updates |
Replication in SQL (MySQL Example)
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Replication in Distributed Databases.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this DBMS topic.
Search Terms
dbms, database management system, database notes, sql, unit, replication, replication in distributed databases
Related DBMS Topics