Replication
Replication stores data copies on multiple nodes, improving read availability and fault tolerance, in synchronous, asynchronous, and semi-synchronous modes.
Purpose
To design high-availability and read-scaling solutions and understand replication lag versus consistency trade-offs.
Mechanism
Synchronous: the primary waits for all replicas to acknowledge (strongly consistent but slow); asynchronous: the primary returns immediately and replicas catch up (eventually consistent, fast); semi-synchronous: at least one replica acknowledges. Primary failure requires failover.
Use cases
- High availability design
- Read scaling
- Fault-tolerant architecture