Live data from Hacker News

MongoDB queries don’t always return all matching documents

engineering.meteor.com

31–40 of 419 posts

Re: MongoDB queries don’t always return all matching documents

#31

Mongo, in one word: sucks. Couchbase, does not.

I use RethinkDB in most of my production things. I recommend it.

RethinkDB has been really mindful of its' consistency, has an in the box story for observable collections, and a really great UI out of the box. I really hope I get to use it for more than toying around with.

I'm not sure that I'd choose Mongo over alternatives these days, if I'm on AWS and can use RDS, I'd go PostgreSQL mostly, but RethinkDB, ElasticSearch, C*, and others also have their places.

Re: MongoDB queries don’t always return all matching documents

#32
post #4

I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors first day I've used the db which I've reported and they fixed it. It was 2015.. If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db…

PostgreSQL and jsonb might make it a more seamless migration that some may think:

https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_...

JSONB values are indexable and queryable, so there aren't very many downsides.

Re: MongoDB queries don’t always return all matching documents

#33
post #4

I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors first day I've used the db which I've reported and they fixed it. It was 2015.. If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db…

Even if you want NoSQL I'd use RethinkDB over Mongo any day. Way better query language, real-time support, and relational/regular SQL-like stuff.

https://rethinkdb.com/docs/comparison-tables/

Re: MongoDB queries don’t always return all matching documents

#34
The article is interesting, but title is fud. Besides, all this is not unexpected:

> How does MongoDB ensure consistency?

> Applications can optionally read from secondary replicas, where data is eventually consistent by default. Reads from secondaries can be useful in scenarios where it is acceptable for data to be slightly out of date, such as some reporting applications.

https://www.mongodb.com/faq

Re: MongoDB queries don’t always return all matching documents

#35
post #4

I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors first day I've used the db which I've reported and they fixed it. It was 2015.. If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db…

If you have a lot of relations in your data don't use mongo Why would you use Mongo if you have lots of relational data? Why would you not start with a relational database for that? I know Mongo has issues but it's never going to beat an RDBMS on relational queries.

I think this is a common pitfall though: people start off thinking they don't really have relational data and then realize they actually do. Now they have a pile of code integrated with a DB that doesn't do relations well and can't be ported easily and then encounter cool bugs like this. No bueno.

Re: MongoDB queries don’t always return all matching documents

#36
post #28

Does Meteor support a proper database system yet, a la. MySQL or Postgres?

Yes - with Apollo/GraphQL (currently available as a technical preview): http://docs.apollostack.com/apollo-client/meteor.html

I recommend you check out the Apollo Meteor Starter Kit: https://github.com/apollostack/meteor-starter-kit

Re: MongoDB queries don’t always return all matching documents

#37
post #22

While I love to hate on MongoDB as much as the next guy, this behavior is consistent with read-committed isolation. You'd have to be using Serializable isolation in an RDBMS to avoid this anomaly.

This is worse than read-committed because you're not even seeing the old state of the document. If an update moves a document around within the results, and it ends up in the portion you've already read, you just don't see it at all.

Re: MongoDB queries don’t always return all matching documents

#38
post #4

I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors first day I've used the db which I've reported and they fixed it. It was 2015.. If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db…

If you have a lot of relations in your data don't use mongo Why would you use Mongo if you have lots of relational data? Why would you not start with a relational database for that? I know Mongo has issues but it's never going to beat an RDBMS on relational queries.

We start our apps with mongo, and design them with a migration plan to postgres. We've found it's very easy to rapidly develop the application with mongo due to it's flexibility. Once we understand where or app is headed and what our relationships actually are, we pretty much pull the plug out of mongo and stick it in postgres. If you build a reasonably intelligent query wrapper it's fairly effortless. That being said, we're thinking of moving our early prototyping to Rethink now that it's made some strides.

Re: MongoDB queries don’t always return all matching documents

#39
post #5

Earlier quoted context omitted.

I use RethinkDB in most of my production things. I recommend it.

Agreed, I've had nothing but positive experiences with it.

I started with Mongo too, had some performance issues and started used RethinkDB when they first released it. It does get better with every update.

Re: MongoDB queries don’t always return all matching documents

#40
post #9
post #4

I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors first day I've used the db which I've reported and they fixed it. It was 2015.. If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db…

> don't use mongo, it's just hype I'm kind of curious as to where this hype is. I've almost never heard anybody say anything positive about mongodb. All I ever see is people saying it's terrible / hilarious for various reasons.

It was the hottest thing a 2-4 years ago. Hype is probably the biggest association anyone who lived through that and didn't drink the coolaid has.
Post reply on HN