Live data from Hacker News

Ask HN: Should I not use MongoDB?

news.ycombinator.com

1–10 of 28 posts

Ask HN: Should I not use MongoDB?

#1
Hi guys, I'm a mostly front end dev who's built some mildly popular applications where Mongo has worked fine as a data store. By mildly popular we're talking maybe 1 query/s. Today, I just launched a product (www.bliss.flights), and it's unexpectedly gone viral, we have more signups than I could have ever imagined.

I peruse HN a lot so I've read a lot of the recent articles about how Mongo has failed a lot of startups as a production DB. Now that we're figuring out the technology stack for this, I don't want to do work that is going to have to be redone later.

Unfortunately, I've only ever used Mongo, so I'm used to mongoose and it's syntax. Would you guys use a different datastore for something like this, and if so, what? I've written maybe a few lines of SQL in my entire life so not so bullish on learning something new as it will really slow us down!

Really appreciate it.

Re: Ask HN: Should I not use MongoDB?

#2
HN skews very anti-mongo, but it can be a good fit for certain apps -- I would stick with what you know until you think you've outgrown what you can do without sharding. I'd probably never shard mongo, but if you can vertically scale it for awhile, I'd do that.

If you're on ec2, the i3 instances have very fast nvme instance storage at a reasonable (cloud) price.

Re: Ask HN: Should I not use MongoDB?

#3

HN skews very anti-mongo, but it can be a good fit for certain apps -- I would stick with what you know until you think you've outgrown what you can do without sharding. I'd probably never shard mongo, but if you can vertically scale it for awhile, I'd do that. If you're on ec2, the i3 instances have very fast nvme instance storage at a reasonable (cloud) price.

I agree with the sentiment. Don’t refactor unless it’s failing you. Just be mindful you might refactor someday and backup your data.

Re: Ask HN: Should I not use MongoDB?

#4
The hatred and fear of Mongo is justified. That doesn't necessarily mean you need to switch right now.

If you're just using a document DB instead of a relational DB, you won't have a hard time moving away from Mongo. There just isn't that much to learn.

Even better, there are various databases that actually have Mongo compatibility[1][2], but internally will be more reliable and scalable.

If you have the dev bandwidth, look into switching now and maybe give it a try in your dev environment.

1. https://www.torodb.com/

2. https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-int...

Re: Ask HN: Should I not use MongoDB?

#5
post #4

The hatred and fear of Mongo is justified. That doesn't necessarily mean you need to switch right now. If you're just using a document DB instead of a relational DB, you won't have a hard time moving away from Mongo. There just isn't that much to learn. Even better, there are various databases that actually have Mongo compatibility[1][2], but internally will be more reliable and scalable. If you have the dev bandwidt…

Great. I haven't built anything yet so I could just start out with one of these from the start. Thank you so much!

Re: Ask HN: Should I not use MongoDB?

#6
post #3

HN skews very anti-mongo, but it can be a good fit for certain apps -- I would stick with what you know until you think you've outgrown what you can do without sharding. I'd probably never shard mongo, but if you can vertically scale it for awhile, I'd do that. If you're on ec2, the i3 instances have very fast nvme instance storage at a reasonable (cloud) price.

I agree with the sentiment. Don’t refactor unless it’s failing you. Just be mindful you might refactor someday and backup your data.

Sounds good to me. I looked into sharding in the past but never took the leap as it added tons of complexity. Thanks so much!

Re: Ask HN: Should I not use MongoDB?

#7

HN skews very anti-mongo, but it can be a good fit for certain apps -- I would stick with what you know until you think you've outgrown what you can do without sharding. I'd probably never shard mongo, but if you can vertically scale it for awhile, I'd do that. If you're on ec2, the i3 instances have very fast nvme instance storage at a reasonable (cloud) price.

What would you suggest instead of mongodb for large scale production db? Our DB size is growing on daily basis and currently near to 200GB on a dedicated machine.

Re: Ask HN: Should I not use MongoDB?

#8
"Now that we're figuring out the technology stack for this, I don't want to do work that is going to have to be redone later."

You're worrying about problems that you don't yet have and at scales you may never reach. I'd say stick with what you know and see if you can get initial traction with your users.

If your data is highly relational then yes it's not a great fit but it's still passable if you're happy to give up transactions and the ability to force data consistency etc.

Where I work we have a production API serving thousands of websites that uses Mongo, don't sweat the details too much early on.

Re: Ask HN: Should I not use MongoDB?

#9
hey there, i am a person from mdb:

one thing i should express, many of the negative sentiments of mongodb are related to outdated facts or commentary. review some of the new features to ensure you're getting all the benefits mongodb has produced since the days of 2012.

Re: Ask HN: Should I not use MongoDB?

#10
MongoDB is definitely ready and capable of handling your traffic. There are best practices to follow, however, as is the case with any deployment. I would concur with mattbillenstein that HN definitely skews anti-mongo.

There are many, many companies using MongoDB very successfully. I have found that "issues" being reported with MongoDB are based on old versions and information, or an improperly configured and tuned environment. I recently wrote a blog post covering some topics around this. I'd encourage you to read it: https://www.kenwalger.com/blog/nosql/mongodb/mongodb-perform...

I think you'll find that MongoDB will meet, and exceed, your expectations for performance.

Post reply on HN