Synchronous vs Asynchronous Replication Explained
Q: What is the difference between synchronous and asynchronous replication?
- Data replication
- Junior level question
Explore all the latest Data replication interview questions and answers
ExploreMost Recent & up-to date
100% Actual interview focused
Create Data replication interview for FREE!
Synchronous replication and asynchronous replication are two methods of data replication used to maintain data consistency and integrity across multiple sources. Synchronous replication involves replicating data in real-time, while asynchronous replication replicates data at predetermined intervals.
The main difference between the two methods is that with synchronous replication, the primary and secondary servers are continuously synchronized and the secondary server has an exact replica of the primary server. The primary server will not commit the changes until the secondary server is updated. This ensures that both servers have the same data at all times.
On the other hand, asynchronous replication does not require the primary and secondary servers to be continuously synchronized. The primary server will commit the changes even if the secondary server is not updated. Asynchronous replication can put the secondary server out of sync for a period of time, but the data is eventually replicated and the two servers will be consistent.
Example:
Let’s say we have a database system with two servers, A and B.
• In synchronous replication, A and B are constantly exchanging data in real-time. This means that any changes made to A will be immediately applied to B, and vice versa. This ensures that both servers always have the same data.
• With asynchronous replication, A and B do not constantly exchange data. Instead, A will commit the changes to its own database and then replicate the changes to B at predetermined intervals. This means that B will not have the most up-to-date data until it is replicated from A.
The main difference between the two methods is that with synchronous replication, the primary and secondary servers are continuously synchronized and the secondary server has an exact replica of the primary server. The primary server will not commit the changes until the secondary server is updated. This ensures that both servers have the same data at all times.
On the other hand, asynchronous replication does not require the primary and secondary servers to be continuously synchronized. The primary server will commit the changes even if the secondary server is not updated. Asynchronous replication can put the secondary server out of sync for a period of time, but the data is eventually replicated and the two servers will be consistent.
Example:
Let’s say we have a database system with two servers, A and B.
• In synchronous replication, A and B are constantly exchanging data in real-time. This means that any changes made to A will be immediately applied to B, and vice versa. This ensures that both servers always have the same data.
• With asynchronous replication, A and B do not constantly exchange data. Instead, A will commit the changes to its own database and then replicate the changes to B at predetermined intervals. This means that B will not have the most up-to-date data until it is replicated from A.


