1

If my server was powered off, assuming all writes to disk succeeded, how many "confirmed" writes would I lose?

The answer for every question is: "it depends". So what does it depend on, and what are the defaults. It's not that one is better, I just need to know the differences :-)

Updated from comments below

Hey, there's a guy who does a blog on this. Spoiler alert: every database sucks Note that some of the articles are about previously released versions.

Michael Cole
  • 15,473
  • 7
  • 79
  • 96
  • MongoDB is closer to 30ms in reality. It is cataloged as that since that is max a file system can take to sync – Sammaye Apr 28 '15 at 08:53
  • MySQL can also lose data before the entire transaction binary is sent to the server (in which case MySQL jus drops the partial change), it isn't totally 0, plus if you have replication added it can be just as long as MongoDBs loss. – Sammaye Apr 28 '15 at 09:13
  • @Sammaye, do you have links with more info? – Michael Cole Apr 28 '15 at 09:33
  • 1
    About the 30ms, no; it is something picked up on here from 10gen employees. About the replication, hmm, really it is a case of reading MySQL documentation on replication types (default is async) and experience of actually having MySQL berak on me multiple times, in multiple cases. – Sammaye Apr 28 '15 at 09:48
  • Can't speak for the other DBs, but with MongoDB, you can reduce it to 0 by setting the write concern to `w:majority` or `w:2` in a replica set. And for production data, you want a replica set anyway. – Markus W Mahlberg Apr 28 '15 at 09:54
  • Voting to close as too broad because it's really a set of questions. What has been written here is debatable, for instance a *confirmed* write to MongoDB isn't lost, save for CAP-Consistency problems on network partitions w/ rollbacks (google 'Jepsen'), because the confirmation (`j : true`) will *wait* for the 16ms average. For a single machine, that was discussed at greater length at http://stackoverflow.com/questions/18488209/does-mongodb-journaling-guarantee-durability, but for clusters it's a CAP-consistency problem, not an ACID-durability problem which is completely overlooked here. – mnemosyn Apr 28 '15 at 13:24

1 Answers1

2

With the default RethinkDB configuration, you won't lose any writes you've received responses for even if the server is restarted.

mlucy
  • 5,249
  • 1
  • 17
  • 21