TL;DR. I killed the primary 30 times per system and measured failover from the client: the gap between the last acknowledged write and the next one, and whether acknowledged writes survived. At shipped defaults, PostgreSQL with Patroni kept the client waiting a median 22.38 seconds, and almost none of that was promotion, which took about a tenth of a second. The wait was the dead leader key’s remaining ttl. Patroni also lost one acknowledged write in 2 of 30 runs. That part should not shock anyone: with asynchronous replication, a commit acknowledged in the primary’s final moments has nowhere to go. The outage number is the part worth knowing, because server-side promotion timestamps hide it. MongoDB waited 10.45 seconds, MySQL Group Replication 21.49, Redis with Sentinel 30.92, and none of those three lost an acknowledged write.
| System, at shipped defaults | Median client write outage | Acknowledged writes lost |
|---|---|---|
| PostgreSQL 17.12 + Patroni 4.1.5 | 22.38 s | 2 of 30 runs, one write each |
| MongoDB 9.0.8, replica set | 10.45 s | 0 |
| MySQL 8.4.13, Group Replication | 21.49 s | 0 |
| Redis 8.10.2 + Sentinel | 30.92 s | 0 |
| CockroachDB v26.3.6 | 4.27 s stall on one in-flight write | 0 |
CockroachDB is a different shape of system; its number is the stall of one in-flight write, not a failover outage, and it is not ranked against the others.

Most failover numbers are measured from the server side: when did the new primary get promoted, when did it start accepting connections. That is not what your application experiences. Your application experiences the gap between its last successful write and its next one, and it cares about a second thing the promotion timestamp never tells you: whether the writes it was told succeeded are still there afterwards.
So I measured it from the client. I ran five replicated database systems on one machine, each as a three-node cluster at its shipped settings: PostgreSQL 17.12 with Patroni 4.1.5, MongoDB 9.0.8 as a replica set, MySQL 8.4.13 Group Replication, Redis 8.10.2 with Sentinel, and CockroachDB v26.3.6. A probe issued uniquely numbered single-row writes. I killed the primary with kill -9, thirty times per system, and afterwards reconciled every acknowledged write against the data that survived. Each write ends up in one of three buckets: acknowledged and present, acknowledged and gone, or failed but actually committed.
The headline is the PostgreSQL result. When the Patroni agent died together with the postmaster, the median client write outage was 22.38 seconds, and in 2 of the 30 runs, one acknowledged transaction was gone after failover, out of 270,676 acknowledged writes in that cell. Replication was asynchronous, and the lost transactions look like commits the primary acknowledged in its final milliseconds, before they were shipped anywhere. Nothing exotic. Just the ordinary cost of an async acknowledgement meeting a dead primary.
Almost none of that 22 seconds is failover work. The logs show a survivor promoting itself at a median 22.29 seconds after the kill, PostgreSQL ready at 22.35, and the client’s first successful write at 22.38. Promotion and reconnection together took about a tenth of a second. The rest was waiting for the dead leader’s key to expire: Patroni’s default ttl is 30 seconds, and the survivors cannot act until it lapses. One caution on the exact figure: my harness killed the primary at a fairly constant point in the heartbeat cycle, so the tight range (most runs landed between 21.7 and 22.7 seconds) is partly an artifact. At an arbitrary moment in the cycle, expect roughly 20 to 30 seconds. I did not test that spread.
The other systems, briefly, because the pattern is the same. MongoDB’s outage was a median 10.45 seconds: its 10-second election timeout plus about half a second. MySQL Group Replication took 21.49 seconds, split into roughly 5.4 seconds to notice the member was unreachable and a near-constant 16 seconds to remove it from the group view, a phase I could not attribute to any named parameter. Redis with Sentinel took 30.92 seconds, which is its 30-second down-after-milliseconds plus about a second. None of those three lost an acknowledged write. For MongoDB and MySQL that is expected rather than impressive: an acknowledgement there already implies a majority agreed, and one process kill cannot undo that. Redis replicates asynchronously, so loss was possible in principle, but on loopback, with no replica lag to speak of, it did not happen. CockroachDB is a different shape of system and I am not ranking it against the others; the one in-flight write stalled a median 4.27 seconds, nothing acknowledged was lost, and in 29 of 30 runs the write that reported an error had in fact committed. If your client retries errors without an idempotency key, that is how you get duplicates.
Two more PostgreSQL cells are worth knowing about. Kill only the postmaster at defaults and there is no failover at all: the agent restarts PostgreSQL in place, because primary_start_timeout defaults to 300 seconds. Median outage 5.96 seconds, same node back. And with tighter timing (ttl 10, loop_wait 2, retry_timeout 3, primary_start_timeout 0) and a postmaster-only kill, recovery took a median 1.89 seconds and lost nothing. Do not read that as “tighten the ttl and the agent-death case gets fast too.” I ran four agent-death faults at ttl 10 on a synchronous cluster and they still took 19.5 to 20 seconds. I have not explained that, and it is the reason I would not quote the 22 versus 1.9 contrast without naming the fault alongside the settings.
What to check in your own Patroni setup
- Know your
ttl,loop_waitandretry_timeout. If the agent dies with the database, your write outage is roughly the remaining life of the leader key. At defaults, plan around 20–30 seconds, not around the sub-second promotion time. - Check
primary_start_timeout. At the default of 300 seconds, a postmaster crash is a restart in place, not a failover. That may be what you want. Make sure it is a decision and not a surprise. - Decide what an acknowledgement must mean. With asynchronous replication, a commit acknowledged in the primary’s last moments can be lost. It happened in 2 of 30 runs here. If that matters for a given workload, that is the argument for synchronous replication, made with a measurement instead of a hunch.
- Do not assume a smaller
ttlfixes every fault. It clearly helped the postmaster-only kill. The agent-death case atttl10 did not follow the arithmetic in my runs. - Measure from a client. Server-side promotion timestamps would have told me failover took a tenth of a second. The client waited 22.
Limits
Everything ran on a single host (a Mac, macOS 15.5) over loopback. There was no network latency, no packet loss, no partition, and replication lag was effectively zero, which flatters the asynchronous systems on the loss question. The workload was synthetic: one sequential writer issuing small single-row writes at up to 200 per second, no connection pool, no proxy. The only fault was a process kill; no disk faults, no host loss, no quorum loss. Thirty runs per cell supports a median and a range, not tail estimates. The Patroni cluster used a single-member etcd, so nothing here says anything about losing the coordination store. Treat the numbers as what these systems do at shipped settings on a quiet loopback host, not as production predictions.
The full write-up is on Zenodo at https://doi.org/10.5281/zenodo.24431584, and the probe, harness and reconciliation code are at https://github.com/Sajish85/client-observed-write-unavailability. The runs are small and the setup is deliberately plain. Reproduce it yourself, on your own settings, and see whether your cluster’s numbers match mine.