# Database Replication

> Live copies of a database kept on other servers. If one fails, the rest go on.

**Field:** Software Development  
**Category:** Databases  
**Also known as:** Replication, Primary-Replica Replication

## Think of it like

Think of it like a teacher writing on the board while kids copy it. If the board is wiped, the books still have it.

## Definition

Database replication keeps copies of a database on more than one server. One server, the primary, takes the writes. It sends each change to the others, called replicas, which apply it too. If the primary fails, a replica can take over. Replicas can also share the work of reading, which spreads the load.

## Example

Emma's shop runs one main server and two copies in other places. When the main disk dies, a copy takes over in under a minute.

## Why it matters

One server is one point of failure. Replication keeps the data safe and the app running.

## Common mistake

Treating copies as a backup. If someone deletes a table, the delete is copied to each one too.

## Three principles

- **One writes, many copy.** The primary sends each change.
- **Ready to take over.** A replica can become primary.
- **Not a backup.** Mistakes are copied too.

## Related terms

- [Read Replica](https://learn.benibix.com/term/development/read-replica)
- [Database Sharding](https://learn.benibix.com/term/development/sharding)
- [Database](https://learn.benibix.com/term/development/database)
- [Database Transaction](https://learn.benibix.com/term/development/transaction)
- [Write-Ahead Log (WAL)](https://learn.benibix.com/term/development/write-ahead-log)

## Told apart from

- [Replication vs Sharding](https://learn.benibix.com/compare/replication-vs-sharding): Replication puts a full copy of the data on each server. Sharding splits the rows, so each server holds just a part.

---

Source: https://learn.benibix.com/term/development/database-replication
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
