Live data from Hacker News

Call Me Maybe: MongoDB Stale Reads

aphyr.com

131–140 of 150 posts

Re: Call Me Maybe: MongoDB Stale Reads

#131
post #96

From 2009 to 2012 I had a distributed database startup that competed with MongoDB. We used Paxos for replication and built the database with on-disk consistency guarantees --- like the ones this article looks for and rightly obsesses over --- in mind. https://github.com/scalien/scaliendb Outcome: you've never heard of ScalienDB; MongoDB brilliantly won by winning the hearts and minds of hackers and coders who don't c…

we actually evaluated scaliendb extensively (even contributed patches) but decided against it because it was immature and notoriously instable. Somewhat later, the open source repo scaliendb got pulled only to resurface years later. What happened?

Do you mean Keyspace, the tech we had before ScalienDB?

Anyway, the reason it was unstable was because we were early in the lifecycle, and as I described in the post, we couldn't get traction, so we also couldn't get investment, so it was just the two co-founders working on it. That's not enough, you need more manpower to do extensive testing of a distributed database which has its own storage engine, esp. when all of it is written in C++ for high-performance. Eg. we only had money to buy 3 servers, we used virtualization to test, but a virtualizated env. is _not_ a proper way to test a database.

Re: Call Me Maybe: MongoDB Stale Reads

#132
post #89

So what should users of MongoDB do? I'm asking because it is the main database used in Meteor and I'm very interested in Meteor. Should the general advice just be "store in MongoDB everything that doesn't require consistency and use Postgresql for everything else"?

Simply put, make sure your app can handle inconsistent data.

Re: Call Me Maybe: MongoDB Stale Reads

#133
post #117

I must admit, I always feel like I am missing something in these discussions. Like I didn't get some memo... I just don't expect a DB like MongoDB to guarantee consistency. The whole story around NoSQL and the likes was to enable crazy horizontal scaling needed for the web. Phrases like "eventual consistency" flew around. It seems so logical - you lose consistency, gain scalability. But somehow, people simply started…

> if MongoDB now claims to be consistent in any way, that deserves scrutiny. And these analyses are always a really interesting read. But the general tone in the developer community about MongoDB seems a bit irrational.

It has been sold that way. People believe with write-concern majority, they can use mongo replicas for primary data stores and not lose anything. Embed your relational data and use it for everything.

Re: Call Me Maybe: MongoDB Stale Reads

#134
post #97
post #89

So what should users of MongoDB do? I'm asking because it is the main database used in Meteor and I'm very interested in Meteor. Should the general advice just be "store in MongoDB everything that doesn't require consistency and use Postgresql for everything else"?

The general advice should be: use PostgreSQL in case you are uncertain what to use. Watch some Youtube video's with Michael Stonebreaker (2014 Turing Award winner) and start getting disillusioned by the NoSQL hype. Then, try to understand the mess Edgar Codd tried to fix in the '60s and '70s.

Do you have any specific videos we should watch?

Re: Call Me Maybe: MongoDB Stale Reads

#135
post #97

Earlier quoted context omitted.

The general advice should be: use PostgreSQL in case you are uncertain what to use. Watch some Youtube video's with Michael Stonebreaker (2014 Turing Award winner) and start getting disillusioned by the NoSQL hype. Then, try to understand the mess Edgar Codd tried to fix in the '60s and '70s.

Do you have any specific videos we should watch?

In the top-hit on Youtube, Michael starts to discuss the solution-space @31m15s (https://www.youtube.com/watch?feature=player_detailpage&v=OY...)

Re: Call Me Maybe: MongoDB Stale Reads

#136
post #96

From 2009 to 2012 I had a distributed database startup that competed with MongoDB. We used Paxos for replication and built the database with on-disk consistency guarantees --- like the ones this article looks for and rightly obsesses over --- in mind. https://github.com/scalien/scaliendb Outcome: you've never heard of ScalienDB; MongoDB brilliantly won by winning the hearts and minds of hackers and coders who don't c…

I don't know, I got started with Mongo because ... it was so easy to start with, but come deployment time got bitten by a LOT of issues (which essentially negated any advantage in using Mongo). As a result of this experience I almost exclusively use PostgreSQL, and I've never EVER been burned by taking this approach. Sometimes I do use another DB but there has to be a seriously good reason for it.

Same thing. I was a software dev, then I went to the back end with MongoDB and NodeJS, and I learnt what ACID means...

Also about MySQL, many people forget it isn't ACID compliant either and just look at benchmarks or use MySQL "because Facebook uses it". I am sure that if any startup would use PostgreSQL it would avoid many problems on the road.

Re: Call Me Maybe: MongoDB Stale Reads

#137
post #112

Since Postgres added a JSON type and Docker made running it simple in development, I haven't had a need for anything else. Call me old school, but I prefer starting with a relational database and changing when it's no longer appropriate.

Old school? It's the best thing to do in my opinion. An ACID relational database that can do even more than that! I think it's one of the best DB for startups.

Re: Call Me Maybe: MongoDB Stale Reads

#138
post #89

So what should users of MongoDB do? I'm asking because it is the main database used in Meteor and I'm very interested in Meteor. Should the general advice just be "store in MongoDB everything that doesn't require consistency and use Postgresql for everything else"?

Have a look at ToroDB (https://github.com/torodb/torodb). It's open source, MongoDB-compatible database which uses PostgreSQL to store data. In a relational way (i.e., no jsonb, no blobs). It's still under heavy development, but worth a look (ToroDB dev here)

Re: Call Me Maybe: MongoDB Stale Reads

#139
post #136

Earlier quoted context omitted.

I don't know, I got started with Mongo because ... it was so easy to start with, but come deployment time got bitten by a LOT of issues (which essentially negated any advantage in using Mongo). As a result of this experience I almost exclusively use PostgreSQL, and I've never EVER been burned by taking this approach. Sometimes I do use another DB but there has to be a seriously good reason for it.

Same thing. I was a software dev, then I went to the back end with MongoDB and NodeJS, and I learnt what ACID means... Also about MySQL, many people forget it isn't ACID compliant either and just look at benchmarks or use MySQL "because Facebook uses it". I am sure that if any startup would use PostgreSQL it would avoid many problems on the road.

I think that PostgreSQL is, in almost every aspect, a superior product to MySQL.

But MySQL not being ACID compliant is flat out wrong (assuming that you're using InnoDB)

Re: Call Me Maybe: MongoDB Stale Reads

#140

Maybe we should listen to Larry Ellison when he say "gimme my money!"

Has Oracle been run through this test battery? Or would publishing the results of doing so bring down an army of Larry's lawyering henchmen? "You violated the EULA, now you must pay! You will only wish you were dead when we are done with you, bwahahhahahaha!"

I guess the first rule of "Benchmark Club" is that we don't talk about Benchmark Club?

Now off to deface a piece of corporate art... :-)

Post reply on HN