Quick revision
The short answer
Two decades of HA have taught that correct failover is a distributed systems problem, and home-grown scripts kept causing split brain and data loss; consensus protocols such as Paxos and Raft made automated failover safe and now sit inside managed services and distributed SQL. Buying moves the operational toil to a provider at the price of cost, lock-in and less control, while building on Patroni or Group Replication with Kubernetes operators gives control but needs a skilled platform team. For a new platform I would decide by team capacity, regulation, scale and cloud strategy, and usually choose a managed standard engine while keeping exit paths open.
What to remember
In this answer, we saw that database HA moved from shared disks to asynchronous replicas to consensus and managed services, and that each step taught the same deeper lesson: failover is a distributed systems problem, and home-grown solutions to it fail. Consensus made automated failover safe, and it now lives inside both managed services and open-source tools. Buying trades money, lock-in and control for less toil; building gives control but needs a skilled platform team. For a new platform, we decide by team capacity, regulation, scale and cloud strategy, usually buy a managed standard engine, and keep an exit path open.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Two decades of HA have taught that correct failover is a distributed systems problem, and home-grown scripts kept causing split brain and data loss; consensus protocols such as Paxos and Raft made automated failover safe and now sit inside managed services and distributed SQL. Buying moves the operational toil to a provider at the price of cost, lock-in and less control, while building on Patroni or Group Replication with Kubernetes operators gives control but needs a skilled platform team. For a new platform I would decide by team capacity, regulation, scale and cloud strategy, and usually choose a managed standard engine while keeping exit paths open.
Why this question is asked
This is a judgement question. There is no single correct product to name, and the interviewer is listening for whether we can turn experience into a decision method that a company can rely on. At this level we are expected to explain what changed in the industry, why, and how it shapes a decision for a team that has to live with it for years. In this answer, we will walk through the eras of database HA and the lesson each one taught, compare buying and building on today's terms, and then make a concrete recommendation with the conditions that would change it.
1What Each Era of HA Taught Us
Shared-disk clusters came first. Two servers were connected to the same storage array, and cluster software decided which server mounted the disk. When it worked, failover lost nothing, because there was only one copy of the data. But the storage array was itself a single point of failure, the hardware was expensive, and when the cluster software misjudged a failure, both servers could mount the disk and corrupt it. The industry learned the word fencing the hard way.
Asynchronous replicas were next. Cheap servers, a primary, a few replicas, and scripts or tools to promote one. This was flexible and cheap, and it is still everywhere. The lesson of this era was that the failover decision is the hard part. Scripts that checked one server from one place promoted replicas during network blips, created two primaries, and lost the last seconds of transactions that had not reached the replica. Many teams discovered this only after an incident.
Consensus-based systems changed the picture. Paxos and Raft give a group of servers a way to agree on a leader and on the order of changes, so that only a majority can make a decision and a minority side cannot act. That made automated failover safe enough to trust, and it is now embedded in tools like Patroni (which stores its leader lock in etcd or another consensus store), MySQL Group Replication, distributed SQL databases, and the control planes of managed cloud databases.
| Era | How failover worked | What went wrong | Lesson |
|---|---|---|---|
| Shared-disk clusters | Cluster software moves the disk | Costly storage, double mounts | Fencing is mandatory |
| Async replicas + scripts | Script promotes a replica | Split brain, lost tail of writes | Failover is a distributed problem |
| Consensus systems | Majority elects a leader | Operational complexity | Quorum makes automation safe |
| Managed cloud databases | Provider runs the control plane | Cost, lock-in, less control | Toil can be bought |
2Why Home-Grown Failover Keeps Failing
It is worth being precise about why scripts fail, because the same reasoning decides build versus buy. A correct failover has to answer three questions under uncertainty: is the primary really gone, which replica has the most data, and how do we make sure the old primary cannot accept writes. Each answer depends on information that may be stale or missing during a partition. Getting all three right in every timing combination is the same problem that consensus protocols were designed to solve, and those protocols took researchers years to get right.
So when a team writes its own failover, it is effectively writing its own consensus protocol without the proofs, and testing it only in the failure modes it thought of. My experience is that this is the single most common source of serious database incidents in companies that self-manage databases. The lesson is not that teams are careless; it is that this is a problem to reuse, not to reinvent.
3Buying: What a Managed Service Really Changes
A managed database such as Amazon RDS or Aurora, Google Cloud SQL or AlloyDB, or Azure Database for PostgreSQL and MySQL moves the operational toil to the provider: failover, backups, patching, replacement of failed hardware and much of the monitoring. For a team of ten engineers building a product, that is often the difference between having database expertise on call every night and not needing it.
The costs are real, and a senior answer names them. Price is higher than raw compute, often by a factor of two or more for the same hardware, and it grows with storage and I/O. There is lock-in, especially with proprietary storage layers or features. And there is less control: we cannot always choose the exact minor version, install every extension, tune every parameter, or control when maintenance happens. We also inherit the provider's failure modes, such as a regional control plane problem that we can only wait out.
4Building: Open-Source Tools on Kubernetes Operators
Building today does not mean writing scripts. It means assembling proven open-source pieces: Patroni for PostgreSQL, Group Replication or InnoDB Cluster for MySQL, often deployed through Kubernetes operators such as CloudNativePG, Crunchy PGO or the Percona operators. These give us full control over versions, extensions, placement and cost, and they work the same way on every cloud and on premises.
The price is people. Someone must understand how the consensus store behaves, how to upgrade the operator without an outage, how to restore from backup at 3 a.m., and how Kubernetes storage behaves when a node disappears. In my experience that needs a platform team of at least three or four engineers who know databases deeply, so that on-call is sustainable. Without that team, building is cheaper only on paper.
5Making the Decision for a New Platform
The decision method I use weighs four things. Team capacity comes first: do we have, or will we fund, a platform team that can own databases? Regulatory needs come second: data residency, audit, or a requirement to run on premises can rule out some services. Scale is third: at a few terabytes, managed services are excellent; at hundreds of terabytes with heavy I/O, the cost difference can pay for a platform team. Multi-cloud strategy is fourth: a company that must run in two clouds benefits from the same engine and tooling everywhere.
For a typical new platform, a product company in one cloud with a small team, I would buy: a managed PostgreSQL or MySQL service with multi-zone HA. I would deliberately choose a standard engine rather than a proprietary one, keep schemas and SQL portable, and make sure logical replication out of the service works, because that is the exit path. If we ever need to move to another provider or to self-managed Patroni, logical replication lets us migrate with minutes of downtime instead of days. I would revisit the decision when cost or a regulatory change crosses a threshold we wrote down in advance.
- Regulation forbids managed services?YesBuild on open-source toolsNoContinue
- Platform team of 3+ database engineers?YesBuilding is an optionNoBuy a managed service
- Cost or control gap large at our scale?YesBuild with Patroni or operatorsNoBuy a managed service
- Keep the exit pathstandard engine, portable SQL, logical replication
4 steps in order. Play them, or step through them one at a time.
Team capacity and regulation usually decide before cost does.
6Follow-up questions
Would you ever recommend distributed SQL for a new platform?
Yes, when the data or write volume clearly exceeds what one primary can handle, or when we need multi-region writes with strong consistency. Distributed SQL embeds consensus and handles failover by design. But it brings higher write latency and different performance behaviour, so I would choose it for a measured need, not by default.
How do you know your managed service failover actually works?
We test it. Most providers let us trigger a failover on purpose, and we do that in staging and occasionally in production during a quiet hour, while measuring how long the application sees errors and whether connection pools recover. A failover we have never triggered is an assumption, not a capability.
What does keeping an exit path cost day to day?
Very little if we decide early. It means avoiding proprietary features unless they give a clear benefit, keeping a tested logical replication or dump-and-restore procedure, and documenting the extensions we depend on. It becomes expensive only when we discover the dependency years later.
7Conclusion
In this answer, we saw that database HA moved from shared disks to asynchronous replicas to consensus and managed services, and that each step taught the same deeper lesson: failover is a distributed systems problem, and home-grown solutions to it fail. Consensus made automated failover safe, and it now lives inside both managed services and open-source tools. Buying trades money, lock-in and control for less toil; building gives control but needs a skilled platform team. For a new platform, we decide by team capacity, regulation, scale and cloud strategy, usually buy a managed standard engine, and keep an exit path open.
Open with
The biggest lesson for me is that correct failover is a distributed systems problem. Shared-disk clusters taught us fencing, asynchronous replicas with scripts taught us that the promotion decision is where split brain and lost writes come from, and consensus protocols like Raft and Paxos finally made automated failover safe.
Then, if they want more
That consensus is now inside the tools we use: Patroni, Group Replication, distributed SQL, and the control planes of managed cloud databases. So I would never write our own failover again. The real choice today is between buying a managed service and building on proven open-source tools.
Buying moves the toil to the provider, but it costs more, adds lock-in and gives less control over versions, extensions and maintenance windows. Building with Patroni or the MySQL operators on Kubernetes gives full control and portability, but it needs a platform team of several engineers who really know databases.
For a new platform I would decide on four things: team capacity, regulatory constraints, scale and multi-cloud strategy.
For most product companies in one cloud, I would buy a managed PostgreSQL or MySQL with multi-zone HA, stick to a standard engine, keep SQL portable and keep logical replication out of the service tested, so leaving is a migration and not a rewrite. I would write down the cost or regulatory thresholds that would make us revisit it.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Over 20 years, database HA has moved from shared-disk clusters to asynchronous replicas...": https://scrivio-interview-library.netlify.app/databases/replication-and-ha/9bc11187be/