All jobs / Database administrator / High Availability
Database administrator interview question · 1–3 years
Synchronous versus asynchronous replication — how do you choose?
The strongest answer
Synchronous when losing a committed write is unacceptable and the standby is close enough that the extra commit latency is tolerable; asynchronous when latency or distance matters more than the last few transactions
Why it works
Exactly — it is a trade between durability guarantee and write latency, decided per system.
What a good answer covers
- Sync: no lost commits, higher latency.
- Async: fast, may lose recent writes.
- A slow sync standby slows the primary.
- Decide per system, not by fashion.
Answers that fall short
- Close, but not the strongest: Synchronous is always safer, so I would default to it
Synchronous makes every commit wait for the standby, and a sick standby can stall the primary. - Weak: Asynchronous is the modern default; synchronous is legacy
Neither is legacy; they answer different durability questions. - Red flag: They are the same in practice because the lag is tiny either way
Tiny lag still means lost commits on failover with async.
Who gets asked this
More High Availability questions
- Finance says the end-of-day report, which reads from a replica, is missing the last few minutes of orders…
- With replication and clustering available, when is log shipping still the right answer?
- There is a standby but nobody has ever failed over to it. What do you propose?
- A product needs high availability for its main relational database. How do you pick the topology?
- What can go wrong with automatic failover, and how do you guard against it?
- Analysts run heavy ad-hoc queries against the production primary and slow the application. What do you set up?
- The data platform wants a change feed from the database. Physical or logical replication, and why?
- How do you set up quorum and a witness, and why does the vote count matter?