Live data from Hacker News

Does everyone hate MongoDB?

blog.serverdensity.com

31–40 of 159 posts

Re: Does everyone hate MongoDB?

#31
My problems were to do with data-loss and unrecoverable corruption. I didn't write a blog-rant, but maybe I should have.

I have since learned that I could have changed some configuration options to make MongoDB less likely to corrupt and/or lose data. I'm still wary though - the fact that the default configuration was prone to unrecoverable data loss suggests that any time I use MongoDB, I must carefully research the feature I'm using to make sure I don't do it in a way that causes data loss.

I believe dangerous configurations should never be the default, and dangerous features should be clearly labeled. The default method for writing data should not fail silently, for example. The fast, fire-and-forget write should be called something like "unchecked_write".

Re: Does everyone hate MongoDB?

#32
post #6

Earlier quoted context omitted.

I wish you would write about some of these issues that you faced so we all can keep them in mind when using MongoDB in the future.

They're not particularly exciting. Example: we accidentally left detailed logging enabled on a secondary server and weren't monitoring the space left on the drive for logs. The disk got full and the secondary failed. Annoying that it failed but it was our fault for not monitoring that space and also leaving detailed logging on!

+1 to share your experience. Kiip and other companies do that, and if you need to decide on a certain technology for your upcoming development, these are really exciting and far-from-boring posts.

Re: Does everyone hate MongoDB?

#33

We've been using MongoDB in production for our main content store at Conversocial for over a year now. We've gone from 1.8 to 2.0 to 2.2 and we're happy. We have ~400gb of data, 220 million documents all on Amazon's SSD instances. We have definitely had our moments where we've screamed that we hate Mongo and are going to rip it out. That's normally where we've overlooked a detail of how it works... and we've had this…

Could you elaborate on the things that MongoDB brings to the table versus a database like MySQL? If you assume that the entire dataset fits in memory for both MongoDB and MySQL, as well as SSD backing for both, what particular advantages does MongoDB have for you in production?

its not the entire set (use Redis then), it is the working set: data being accessed.

Re: Does everyone hate MongoDB?

#34
post #28
post #2

hell no, it's been a breath of really fresh air for us, we've been building all sorts of things, no problems so far. (including logging several millions of requests per day and performing distributed map reduce for all sorts of statistical models on a tiny 3 machine "cluster" we run on AWS, I hope I never have to go back to modifying schemas again, so much simpler to run and build with this mindset)

> I hope I never have to go back to modifying schemas again Honest question. Do you actually leverage the schemaless nature of MongoDB? Not 'worrying' about managing schemas is one thing, but actually leveraging the fact that your objects can have different fields is another. I have worked on projects that did need to store objects with different fields together but it seems to be a rare case. From what I've seen, mo…

Flexibility is useful in development. Once you deploy then things will change less frequently so the real benefit is when you do have to change something, you're not running a big ALTER statement.

Re: Does everyone hate MongoDB?

#35
post #34
post #28

Earlier quoted context omitted.

> I hope I never have to go back to modifying schemas again Honest question. Do you actually leverage the schemaless nature of MongoDB? Not 'worrying' about managing schemas is one thing, but actually leveraging the fact that your objects can have different fields is another. I have worked on projects that did need to store objects with different fields together but it seems to be a rare case. From what I've seen, mo…

Flexibility is useful in development. Once you deploy then things will change less frequently so the real benefit is when you do have to change something, you're not running a big ALTER statement.

In the enterprise world (at least in the Microsoft world) we have tools to manage these sorts of things. The one I'm currently using even for my small pet projects is called SQL Server Data Tools[1]. You basically just have to modify the original table creation scripts (add a column or whatever) and it actually generates all the change scripts for you. Even if the change is complex it handles making temp tables and transferring the data into the new table. It also notifies you and lets you handle cases where the change may lead to data loss.

I guess my point is that the SQL world is still innovating but it doesn't get that much attention. Unless I have a specific use-case for storing similar entities together with different fields then a schemaless DB is not the right tool for the job.

[1]http://msdn.microsoft.com/en-us/data/tools.aspx

Re: Does everyone hate MongoDB?

#36

I think a lot of the "hating" is a side effect of MongoDB being consistently oversold in terms of its capabilities and architecture. Many people who are not experts on databases discover this the hard way later. If the claims about it were qualified a little better and the limitations acknowledged more openly by its proponents it would help to mitigate this outcome. I am indifferent to MongoDB but I do caution people…

> I think a lot of the "hating" is a side effect of MongoDB being consistently oversold in terms of its capabilities and architecture.

Agreed, though I think its also coupled with just a lack of understanding of what MongoDB does beyond just "its NoSQL!". So many people are used to working with RDBMS. They just seem to make incorrect assumptions about MongoDB based on what they thought were universal rules about databases.

Mongo's a tool. Its not right for all situations and it definitely has some maturing to go still, but its good to use in certain situations, provided you're properly informed about it.

Re: Does everyone hate MongoDB?

#37
post #28
post #2

hell no, it's been a breath of really fresh air for us, we've been building all sorts of things, no problems so far. (including logging several millions of requests per day and performing distributed map reduce for all sorts of statistical models on a tiny 3 machine "cluster" we run on AWS, I hope I never have to go back to modifying schemas again, so much simpler to run and build with this mindset)

> I hope I never have to go back to modifying schemas again Honest question. Do you actually leverage the schemaless nature of MongoDB? Not 'worrying' about managing schemas is one thing, but actually leveraging the fact that your objects can have different fields is another. I have worked on projects that did need to store objects with different fields together but it seems to be a rare case. From what I've seen, mo…

What I like is not the absence of a schema (because as you say there usually is one), but not having to fit it into the 2D SQL table model. An obvious case in when you have a many-to-one field that only ever contains a small number of values (e.g. a person's nationality); in a traditional SQL database my choices are make a separate table for it, or use a database-specific custom datatype (which never seem to be fully supported). In something like mongoDB I can just put a list in that field of the document.

Re: Does everyone hate MongoDB?

#38
Headline problem: Deployed on 32 bit server so was limited to 2GB database. Writes were being silently discarded.

Mistake: Deployed to 32 bit servers without knowledge of the limit. Did not use safe writes and didn’t check for errors after writes.

Sorry, I just do not see eye-to-eye with anyone who thinks this problem was the mistake of the user. This attitude, though detestable, is prevalent in our industry, and it's wrong.

The database was silently throwing away writes. I don't know what else to say.

I mean, I'm sure that MongoDB is really great for some people, and that it's doing a really awesome job storing their data. That is, until one day their writes start silently failing, because they neglected to check a priori every instance in which Mongo would silently fail. Which would make it their fault, naturally. I'd rather not find myself in that situation, but different strokes I guess.

Re: Does everyone hate MongoDB?

#39

We've been using MongoDB in production for our main content store at Conversocial for over a year now. We've gone from 1.8 to 2.0 to 2.2 and we're happy. We have ~400gb of data, 220 million documents all on Amazon's SSD instances. We have definitely had our moments where we've screamed that we hate Mongo and are going to rip it out. That's normally where we've overlooked a detail of how it works... and we've had this…

With 400GB of data I'd imagine you are going to be ripping your hair out at some point or another regardless of what database you use ... there is no way to completely avoid tech issues over the lifetime of a product/service.

Re: Does everyone hate MongoDB?

#40
post #31

My problems were to do with data-loss and unrecoverable corruption. I didn't write a blog-rant, but maybe I should have. I have since learned that I could have changed some configuration options to make MongoDB less likely to corrupt and/or lose data. I'm still wary though - the fact that the default configuration was prone to unrecoverable data loss suggests that any time I use MongoDB, I must carefully research the…

It's not just that the defaults are dangerous, but that if you change the default, you give up much of the performance benefit of choosing Mongo in the first place.
Post reply on HN