Live data from Hacker News

Ask HN: Do you still use MongoDB?

news.ycombinator.com

111–120 of 243 posts

Re: Ask HN: Do you still use MongoDB?

#111
post #103

I've promised myself to never touch MongoDB again. Worked for a valley startup back in 2013 that picked Mongo as primary data store because the CEO liked the simplicity and was too busy with the future to learn anything more complicated. I only implemented a couple of features before I got out of that mess. But from my experience, compared to dozens of SQL and NoSQL databases I've worked with; it was definitely the w…

That was like what, 7 years ago? Do you think this has changed now about Mongo since then?

I had a similar experience around the same time - still don't feel like giving that widowmaker another chance.

Re: Ask HN: Do you still use MongoDB?

#112
I've actually never used it, and probably won't at this point. But, we do use Couchbase at my workplace, and it's worked well for us. The use case is very limited in scope, but it serves our purposes well.

I'd be curious to know how they compare from folks who have used both?

Re: Ask HN: Do you still use MongoDB?

#113
post #88

Earlier quoted context omitted.

> We're not going to be migrating terabytes of data You may have dramatically less 'real data' than mongo makes you think you do. I migrated one of our mid sized database out of mongo and into PG a couple years ago. The reduction in size was massive. One table in particular that was storing a small number of numeric fields per doc went from ~10GB to ~50MB. I wouldn't expect this with all datasets of course, but mongo…

Unless this has changed in recent years, the BSON format that Mongo uses is more or less JSON optimized for parsing speed and takes more or less as much space as storing your entire database in JSON. JSON is a great format for simplicity and readability but as a storage format it's hard to come up with one that's more bloated.

> but as a storage format it's hard to come up with one that's more bloated.

It's easy: xml.

Re: Ask HN: Do you still use MongoDB?

#114
I got familiar with Mongo because of a piece of software that we acquired last year. It was way out of date and step one was to bring it up to latest. Step two was to change the hardware configuration and indexes to something reasonable. After doing this it's tolerable, but still lacking in speed per cost in my view. We have tentative plans to migrate to a relational database.

There are probably good use cases for Mongo, but I haven't found one yet.

Re: Ask HN: Do you still use MongoDB?

#115
post #88

Earlier quoted context omitted.

> We're not going to be migrating terabytes of data You may have dramatically less 'real data' than mongo makes you think you do. I migrated one of our mid sized database out of mongo and into PG a couple years ago. The reduction in size was massive. One table in particular that was storing a small number of numeric fields per doc went from ~10GB to ~50MB. I wouldn't expect this with all datasets of course, but mongo…

This is (probably) an artifact of Mongo's schema-less nature; when you don't have tables with structure, every document you store has to detail its own schema inline. In a relational database, you have columns with names and types, and that info is shared by all of the rows. In Mongo, every cell has to specify its name and type, even if that layout is shared by every other cell in the document. Mongo's way is more fl…

/caveat i know nothing about how mongo is storing data and haven’t used it since 2010

it doesn’t really have to approach the schemas that way. one would think it would be optimized for repeat schema in the same way one might create the schema definition and then reference it in packing and unpacking the data. seems like if there was schema overhead taking up storage unnecessarily that could be optimized relatively easily.

having schema references also might be a good management tool to understand which records vary potentially due to an application evolving it’s needs.

Re: Ask HN: Do you still use MongoDB?

#116
I only use it on one legacy website I maintain. It's used as a more advanced Redis to cache JSON structures and extract just the data that's needed. This use case has proved to be mostly useless. It would have been better to just use Redis which is already used for caching other data.

Re: Ask HN: Do you still use MongoDB?

#117

MongoDB is a pretty good database IMO. I've used it at several companies in the past and wouldn't mind using it again. My favorite DB is RethinkDB. It's a shame that the company behind it fizzled out and was absorbed by Stripe. I still cannot wrap my mind around why it's not more popular. It's similar to MongoDB but much better. It's the perfect database. It adds constraints which improve the quality of your code. Al…

long time postgres user.

the hype about postgres is that there is no hype. it's one of those systems that have been working for decades. they have their flaws but they are well known and as long as you aware of them it does exactly what it is supposed to do.

Re: Ask HN: Do you still use MongoDB?

#118
post #68

Earlier quoted context omitted.

Yep, just regret and misery. Back in 2010 when the MongoDB hype was high, the well-known company where I was working at the time decided to build the next version of the product using MongoDB. I was on the analytics team and had to code a whole bunch of intricate map-reduce jobs to extract summary data out of Mongo. I'd repeatedly head to the product team and ask them to explain the edge cases I was seeing in the dat…

While there are many people here who are sharing their bad experience with MongoDB, just curious if you all find the experience with DynamoDB similar? Since they are both of the NoSQL family.

DynamoDB is a completely different beast and would use no other data store unless I had to. It can pretty much handle any transactional workload I need.

It's cheap, its fast and it scales super high. Don't need much more

Re: Ask HN: Do you still use MongoDB?

#119
post #112

I've actually never used it, and probably won't at this point. But, we do use Couchbase at my workplace, and it's worked well for us. The use case is very limited in scope, but it serves our purposes well. I'd be curious to know how they compare from folks who have used both?

I used CouchDB for a project back in 2012 when all of these things were fairly new. The reason was to embed the DB on an Android device. This turned out to not work as well as advertised. I have no idea what's happened with Couch since, but started got pretty familiar with Mongo in the last 12 months. It's OK, but it's expensive to make it performant. As other commenters here have mentioned, the primary use case for these Object/Document storage solutions seems to be to remove knowledge of Relational DB as a requirement for developers.

I think it's probably excellent for prototyping, but I wouldn't want it running a heavily used product in production.

Re: Ask HN: Do you still use MongoDB?

#120
post #72
post #53

Yes. We have applications running on both PostgreSQL and MongoDB and I find that working with MongoDB is just more pleasant. I think it mostly boils down to my preference of document databases as opposed to relational ones. It feels much more natural to me to embed / nest certain properties within a document instead of spreading it across several tables and then joining everything together to get the complete data. M…

I'm curious, any chance you remember some of those json/jsonb update hassles? (not arguing, just curious - when things get hairy in JSON, I give up on SQL and [1] I write a user defined function (CREATE FUNCTION) in JS (plv8) or Python (plpython). [1] assuming the update code needs to run inside the database, e.g. for performance reasons... otherwise just perform your update in the application, where you presumably h…

I don't remember the specific case (it's been a few years) but I do remember it had something to do with updating an array member. I googled around and found this [0] (the second question) which looks very similar. It's as simple as it gets - find an array member with "value" equal to "blue" and decrease its "qty". In MongoDB you can do that pretty easily and the update should be atomic. The SQL version looks complicated and it's not even the form that you should use (notice the note about the race condition). Then again, maybe there's already a way to do that in PostgreSQL in a more elegant way, I assume the support has improved over the years.

[0] https://dba.stackexchange.com/questions/193390/update-nth-el...

Post reply on HN