Replication is the synchronisation of data between multiple database servers. There is a primary server and one or more replicas. Replicas receive changes from the primary and duplicate them locally.
Why it is needed
Read scaling — SELECT queries are distributed across replicas; the primary handles writes only
Fault tolerance — if the primary fails, a replica is promoted to primary (failover)
Backup — backups are taken from a replica, not from the primary
Synchronous vs asynchronous
Synchronous — the primary waits for acknowledgement from the replica. No data loss, but higher latency
Asynchronous — the primary does not wait. Lower latency, but risk of losing the most recent writes on failover