Senior
What is replication in databases?
sobes.tech AI
Answer from AI
Replication in databases is the process of copying and maintaining an up-to-date copy of data from one server (master) to other servers (replicas). This helps increase data availability, distribute read load, and ensure fault tolerance.
Main types of replication:
- Master-Slave (one primary, multiple secondary) — all writes go to the master, replicas receive updates asynchronously or synchronously.
- Multi-Master — multiple primary nodes that can accept writes, with more complex synchronization between them.
Example: in PostgreSQL, streaming replication can be configured, where the replica receives WAL records from the master and applies them, remaining synchronized.