Failover
When the database server a company writes to fails, which keeps the company's writes better: MongoDB or PostgreSQL?
What it is.
The lab in plain words, and how it runs.
A company's apps keep writing to one main database server. If that server fails, are the writes it said were saved still there, and how soon can the company write again? This lab put that question to MongoDB and PostgreSQL.
We ran each database as a small group of servers. In 320 of the 334 counted runs we disrupted the main server on purpose in the middle of the work; in the other 14 we left it alone. Then we counted what happened.
A rule written down before anything ran decides each scenario. First, a database must keep every confirmed write and pass its other checks; if only one database does, that one fits. If both do, one fits only when its break in confirmed writes is clearly shorter (by at least a fifth, a margin fixed in advance) in at least 4 of 5 paired runs of a first round, and still shorter on the middle value of a second round of runs. Otherwise both fit.
Neither database lost a write it had confirmed, in any of the 334 counted runs. MongoDB fits 6 of 8 compared scenarios (4 on write outage, 2 on acknowledgement gap); PostgreSQL fits 2 of 8 compared scenarios (2 where only it passed the checks). There is no overall winner. Some questions stay open; the last lane below shows one of them, and the record's limits name the rest.
- 334 counted runs320 fault runs, 14 steady runs
- MongoDB and PostgreSQLthe same 8 compared fault scenarios, each repeated 5 times in each of 2 rounds
Were confirmed writes kept?
- 941,891 confirmed writescounted in 334 runs
- None loston either database
Which fits each compared scenario, by the rule fixed in advance
- MongoDB fits 6 of 84 on write outage, 2 on acknowledgement gap
- PostgreSQL fits 2 of 82 where only it passed the checks
- No overall winner8 compared scenarios
Still open
- 15,567 confirmed writes in 10 runsPostgreSQL in strict mode confirmed them while it named no standby copy
- Equal two-copy safety not establishedwhether a second copy existed then is unresolved
Where it stands.
Measured on one host; strict-ack and overlap limits remain.
A result is published. Read its record and limits before treating it as a finding.
What it tests.
We stop the main database server in the middle of a working session, on purpose, and check which writes it had confirmed are still there afterwards. Each side's advocate wrote down what they expect before anything ran.
Follow the work.
What you can check.
Use the linked plan and any later result record to check what was planned and what was measured. A plan alone is not a finding.