Live data from Hacker News

Jepsen Disputes MongoDB's Data Consistency Claims

infoq.com

171–180 of 416 posts

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#171

How is Cassandra as an alternative to MongoDB?

I mean, they are completely different. MongoDB is more-or-less a traditional RDBMS with automated failover and trying to staple on more advanced features. Cassandra is a masterless DynamoDB-ish database with features like hinted handoffs. You really need to know how consistency and distributed systems work if you're looking to pick Cassandra. It's a great implementation, you just can't compare it to MySQL/Postgres/etc like you can with Mongo

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#172

Earlier quoted context omitted.

DynamoDB conditional writes are strongly consistent. Defaulting to inconsistent reads was reckless and I would never defend that, but the worst case is non-repeatable stale results, never lost writes.

It’s clearly documented everywhere that reads are eventually consistent by default.

That's the right way to disclose a dangerous default, but defaults should be as safe as possible, and users should think very carefully about whether they can get away with opting out. Consistency failures can be very non-intuitive, and hard to clean up after.

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#173

"We found that due to these weak defaults, MongoDB’s causal sessions did not preserve causal consistency by default: users needed to specify both write and read concern majority (or higher) to actually get causal consistency. MongoDB closed the issue, saying it was working as designed, and updated their isolation documentation to note that even though MongoDB offers “causal consistency in client sessions”, that guara…

Kyle's point is that it's arguably valid but certainly unhelpful: the default settings are liable to lead to data loss. Moreover, he draws attention specifically to transactions as something which you would expect to make things safer, but in fact there's a rather arcane part of the documentation that notes that you need to manually specify both read and write concerns on every transaction individually if you want tr…

> the default settings are liable to lead to data loss

In Mongo's defense, the defaults are similar to what you would likely have with a replicated MySQL/Postgres cluster (single node accepting writes with slaves replicating from there; no concept of write concern). My assumption here is that he is assuming the primary dies before the writes have replicated to the secondaries; that is exactly how master-slave fails too. Maybe there are systems folks can use for having write concern in those databases, but in the companies I've worked for we didn't have them and we definitely didn't have automated failovers

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#174
post #107

Earlier quoted context omitted.

mysql's admin tools are still far superior than what's available for postgres

What tools are these? Curious as a Postgres user

I've probably tried a dozen or so.

For MySQL, I haven't found anything that beats SequelPro. For Postgres, I haven't found anything that comes close to parity, but my favorite is Postico.

I know people that swear by IntelliJ for their db stuff, it just never hit home for me personally though.

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#175
post #147

Earlier quoted context omitted.

MySQL does not scale better than PostgreSQL. I can tell you this emphatically as I spent 6 months trying to eke out performance with MySQL (5.6). PostgreSQL (9.4) handled the load much better without me having to change memory allocators or do any kind of aggressive tuning to the OS. MySQL has some kind of mutex lock that stalls all threads, it's not noticeable until you have 48cores, 32 databases and a completely un…

MySQL 5.6 was released in 2012. Postgres 9.5 was released in 2016, so this isn't really a fair comparison.

Whups, I meant 9.4, it's not possible that I could have tested 9.5 as the test was conducted in early 2015, both databases were the latest versions.

yes, I should run the test again, but it was 6 months of my life, and I don't see how much could have changed.

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#176
post #147

Earlier quoted context omitted.

MySQL does not scale better than PostgreSQL. I can tell you this emphatically as I spent 6 months trying to eke out performance with MySQL (5.6). PostgreSQL (9.4) handled the load much better without me having to change memory allocators or do any kind of aggressive tuning to the OS. MySQL has some kind of mutex lock that stalls all threads, it's not noticeable until you have 48cores, 32 databases and a completely un…

You comparing tech from 2 different eras... redo the benchmark today and I’ll be surprised if you come to the same results. PGsql even has a wiki page where they discuss implementing MySQL features and changing their architecture so they can scale. https://wiki.postgresql.org/wiki/Future_of_storage#MySQL.2FM...

> You comparing tech from 2 different eras...

They were both the latest and greatest at the time

> redo the benchmark today and I’ll be surprised if you come to the same results.

I would, but it was not just a benchmark, it was a deep undertaking including but not limited to: optimisations made in the linux kernel, specialised hardware along with custom memory allocators and analysing/tracing/flamegraphing disk/memory access patterns to find hot paths/locks/contention. (and at different scales: varying the number of connections, transactions per connection, number of databases, size of data, etc)

It was 6 months of my life.

> PGsql even has a wiki page where they discuss implementing MySQL features and changing their architecture so they can scale.

Just because mysql has some good ideas doesn't mean it scales better. I know for a fact that it didn't in 2015. I doubt that they have fixed the things I found, I could be wrong. But it would have to be a large leap forward for MySQL and PostgreSQL has had large performance improvements since then too.

also, I read that page and it talks nothing about scaling, just that some storage drivers have desirable features (memory tables are very fast, and PGSQL doesn't support it; archive tables are useful for writing to slower media, you can do this with partitioning but it's not intuitive)

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#177
post #128

In the circles I run in, MongoDB is regarded as a joke and the company behind it as basically duplicitous. For example, they still list Facebook as their first user of MongoDB on their website, for example, but there is no MongoDB use in Facebook hasn't been for years (it came in only via a startup acquisition). I had the misfortune to use MongoDB at a previous job. The replication protocol wasn't atomic. You would f…

I was floored by this comment yesterday from one of their Developer Relations people: > Did any of you actually read the article? We are passing the Jepsen test suite and it was back in 2017 already. So, no, MongoDB is not losing anything if you know what you are doing. https://twitter.com/MBeugnet/status/1253622755049734150?s=20 Can you imagine saying the phrase "if you know what you are doing," in public, to your u…

Firstly let me point out that this response is neither intended as a defence of MongoDB defaults which are atrocious, or of the company, who are arguably duplicitous.

However I can _quite easily_ see how a non-native English speaker could use the phrase “if you know what you are doing” to mean “if you are careful”.

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#178

Earlier quoted context omitted.

SQLite: I enjoy using reliable and correct databases even at the cost of scalability

SQLite has always intentionally failed to report this error: sqlite> create table foo (n int); sqlite> insert into foo (n) values ('dave'); sqlite> select count(*) from foo where n = 'dave'; 1

That is documented as a feature. https://www.sqlite.org/different.html under "Manifest typing".

SQLite does not use column typing except in integer primary keys.

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#179
All: we've changed the submitted URL from https://www.infoq.com/news/2020/05/Jepsen-MongoDB-4-2-6 to the work it is reporting on. You might want to read both, since the infoq.com article does give a bit of background.

Edit: never mind, I think the other URL - http://jepsen.io/analyses/mongodb-4.2.6 - deserves a more technical thread, so will invite aphyr to repost it instead. It had a thread already (https://news.ycombinator.com/item?id=23191439) but despite getting a lot of upvotes, failed to make the front page (http://hnrankings.info/23191439/). I have no idea why—there were no moderation or other penalties on it. Sometimes HN's software produces weird effects as the firehose of content tries to make it through the tiny aperture of the frontpage.

Re: Jepsen Disputes MongoDB's Data Consistency Claims

#180

Earlier quoted context omitted.

SQLite: I enjoy using reliable and correct databases even at the cost of scalability

I admit I was kind of thinking that, even though I appreciated the humor. :) I imagine an awful lot of web sites out there would do just fine with SQLite as their back end.

It's great for small, read-only websites that aren't quite simple enough to just be static HTML sites. Also for desktop app config/data DBs.
Post reply on HN