Live data from Hacker News

The growing irrelevance of MongoDB

itexto.com.br

61–70 of 114 posts

Re: The growing irrelevance of MongoDB

#61
post #9

I have seen many people try and shoehorn various problems into MongoDB, when in most cases a relational database would have been better suited. I have yet to see a real use case for Mongo unless you are building a Facebook clone. Can someone suggest when it is actually useful over a properly tuned relational database? I guess I kind of reached the irrelevance stage just thinking about the sort of problems it would be…

MongoDB is not at all good for Social networks or anything resembling a graph. You are better off with Titan (horizontal scaling) or Neo4j (vertical scaling). Neo4j offers this great ability to query by a path, which no other database offers.

Re: The growing irrelevance of MongoDB

#62
post #9

I have seen many people try and shoehorn various problems into MongoDB, when in most cases a relational database would have been better suited. I have yet to see a real use case for Mongo unless you are building a Facebook clone. Can someone suggest when it is actually useful over a properly tuned relational database? I guess I kind of reached the irrelevance stage just thinking about the sort of problems it would be…

I generally agree in regards to shoehorning data into MongoDB. I don't agree that a facebook clone fits appropriately. When thinking through a project, my mental model generally self-configures into third-normal form, which is to say I literally think in the manner of a relational database.

That said, I have found one specific use-case where it has incredibly worked well, which is as a JSON-based file system in which I can query into the document structure to find the records and data I need en-masse with very simple queries. A project I've been working on for a few years has its own custom schema that fits far better into a JSON hierarchy than a relational one. In this specific system there are very few records (compared to our primary RDBMS which has millions), and when not being explicitly maintained, the files are generally static. The single-collection database in question with a few hundred JSON objects would likely have to be split into at least 10 tables with thousands of records each.

When it comes to using said "files" in production, I index the objects into memory for quick retrieval. In order to populate said cache, MongoDB allows me to query into the JSON file structure and retrieve the necessary "files" very simply into however many indices I need. And that's where it has shined in my experience; Not as a live read-write datastore for production use, but as read-heavy storage for a relatively small amount of JSON data with a deep hierarchy that would require an annoying amount of joins and subqueries for otherwise simple queries.

I've also tried it out with our multi-system logging system using capped collections (JSON formatted messages transported and collected with rsyslog). But we grew beyond its limits almost immediately and ended up in far more manageable territory with kibana / elasticsearch.

Re: The growing irrelevance of MongoDB

#63

If transactions are the biggest problems, there are driver solutions like http://godoc.org/labix.org/v2/mgo/txn for that. I am not sure, how they compare to "real" transactions. Still missing "joining" in some cases though. Otherwise I am ok with MongoDB so far.

Jeez. Please do not mention client-library-managed transactions and then put "real" transactions in scare quotes. At least read the Wikipedia article first.

I just wanted to distinguish between the two. I wasn't scared in any way but read up on scare quotes now - so thanks for that. http://en.wikipedia.org/wiki/Scare_quotes

Re: The growing irrelevance of MongoDB

#64
post #47
post #39

Earlier quoted context omitted.

"I don't want to create a schema..." You are always going to end up creating a schema, whether it's explicit in your tables or implicit within your code. Otherwise you end up with completely heterogeneous data which is impossible to query in any useful way. This is a red herring.

Not really. Maybe some products have an attribute that others don't. Maybe you want to query by that attribute. The query won't turn up products without that attribute. Maybe that's ok. Like if you wanted to find all shoes with black laces you can just query for that. Tractors don't even have laces and so they don't come up in the results. In a sql db, every single thing needs to fit into a flat schema with nesting d…

I don't actually use Mongo at all, I prefer Postgres. But for loosely structured data, it has a use case. Just like dynamic vs typed languages, there are pros and cons.

Re: The growing irrelevance of MongoDB

#65
post #37

MongoDB will always be a relevant example of false advertising and over-marketing (to the point of 10gen probably opening themselves to litigation) and how we all need to stop drinking the kool-aid. There is LITERALLY no reason to use MongoDB today. If you're thinking of using MongoDB, for the love of god just try PostgreSQL.

this is a ridiculous comment.

we use a mongodb cluster for a multi-hundred GB document store that powers ~50 various worker instances, 2 sites and an API with sub 100ms response times. we have never lost data or experienced downtime worse than other dbs i've used in the past.

at the end of the day you just need to do your job properly and read the documentation, not blame the tool when you can't use it properly.

*disclaimer - this is not to say postgres isn't awesome.

Re: The growing irrelevance of MongoDB

#66

If transactions are the biggest problems, there are driver solutions like http://godoc.org/labix.org/v2/mgo/txn for that. I am not sure, how they compare to "real" transactions. Still missing "joining" in some cases though. Otherwise I am ok with MongoDB so far.

Jeez. Please do not mention client-library-managed transactions and then put "real" transactions in scare quotes. At least read the Wikipedia article first.

I didn't read it like that at all, I interpreted it as the gp distinguishing between the two.

Re: The growing irrelevance of MongoDB

#67
post #52
post #44

Earlier quoted context omitted.

I've used it and been happy. If you want something that's simple to use, know your schema partly but not entirely, and you don't mind losing a few writes, then mongo fits. Relational databases place such emphasis on reliability. Mongo is generally reliable but only two or three nines, and it's simple. For example, if you're collecting sub-cent line items for invoices, you might prefer to collect 99.x% of the line ite…

What? When would it ever be OK to lose parts of an invoice. Mongo apologists baffle me sometimes. To anyone considering MongoDB, don't be fooled, you probably want to stick with an RDBMS.

What are you talking about? We run a 800+ GB mongo cluster and have never lost data.

Re: The growing irrelevance of MongoDB

#68
post #47
post #39

Earlier quoted context omitted.

"I don't want to create a schema..." You are always going to end up creating a schema, whether it's explicit in your tables or implicit within your code. Otherwise you end up with completely heterogeneous data which is impossible to query in any useful way. This is a red herring.

Not really. Maybe some products have an attribute that others don't. Maybe you want to query by that attribute. The query won't turn up products without that attribute. Maybe that's ok. Like if you wanted to find all shoes with black laces you can just query for that. Tractors don't even have laces and so they don't come up in the results. In a sql db, every single thing needs to fit into a flat schema with nesting d…

In a sql db, every single thing needs to fit into a flat schema with nesting done by relations.

Nope, see Postgres (hstore and json).

Re: The growing irrelevance of MongoDB

#69

Actually, they posted thw wrong link. That article is not written by wwwdesigned, but by me. Here is the original text: http://www.itexto.com.br/devkico/en/?p=60

I actually came there via two other aggregators (Twitter and Prismatic) and thought that I had found the source. Will be more careful next time - sorry about that. In any case it was an interesting read.

Re: The growing irrelevance of MongoDB

#70
post #9

I have seen many people try and shoehorn various problems into MongoDB, when in most cases a relational database would have been better suited. I have yet to see a real use case for Mongo unless you are building a Facebook clone. Can someone suggest when it is actually useful over a properly tuned relational database? I guess I kind of reached the irrelevance stage just thinking about the sort of problems it would be…

> Can someone suggest when it is actually useful over a properly tuned relational database?

Maybe when developers don't want to bother to learn SQL?

On my CS degree we got proper introduction to SQL and the relational algebra behind it, so for me it is just a tool, not a scary monster.

I really love the data integrity options I have at my disposal with relational databases.

So for me this all NoSQL fad never made much sense. Then again, I never had to deal with a Facebook like scale problem, only daily reports from mobile network operators across their whole network elements.

Post reply on HN