What is replication in SQL?
Replication in SQL is the process of copying data from one database server to another.
It's used to:
- improve reliability, if the primary server fails, the data survives on the copy;
- spread the load, the primary server handles writes, while the copies (replicas) handle read requests;
- speed up access, users in different regions can reach the nearest replica.
There are usually two types:
- Synchronous replication, changes get written to the replica immediately (slower, but safer).
- Asynchronous replication, data is saved on the primary server first and then copied to the replica (faster, but with a possible delay).
Replication helps a database run faster, more reliably, and more safely.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.