Skip to content
RED SAGSkills
easyDatabase Administrator interview question

What is database replication, and what is the difference between synchronous and asynchronous replication?

What the interviewer wants to hear

  • Replication copies changes from a primary to one or more replicas
  • It is used for high availability, read scaling and disaster recovery
  • Synchronous: commit waits for a replica to confirm, so no data loss but higher latency
  • Asynchronous: commit returns at once, replicas can lag and recent data can be lost on failover
  • Replication is not a backup, because mistakes replicate too

Model answer

Replication means keeping copies of a database on other servers by sending them every change from the primary, usually by streaming the write-ahead log or binlog. We use it for high availability, so a replica can take over if the primary fails, for read scaling and for copies in another region. With synchronous replication the primary waits until at least one replica confirms it has the change before telling the client the commit succeeded. That gives zero data loss on failover but adds network latency to every write. With asynchronous replication the commit returns immediately, so it is faster, but replicas can lag, and if the primary dies the last few transactions may be lost. Either way replication is not a backup, because a bad DELETE replicates in seconds.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Database Administrator questions