TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Never use MongoDB (2013)

131 pointsby mikecarltonover 4 years ago

27 comments

01acheruover 4 years ago
This article keeps coming up every once in a while and reminds me of all those “Why JS sucks”, “Never use PHP”, “Java is enterprise only”, “Ruby only works on hobby projects” etc...<p>But then in real life people built great software with all the above, so I’ll just say a great classic: pick something you know, use it well, build something good, end of story!<p>No tool will fix wrong assumptions or bad design, we can dive into philosophy here but I’m more of a practical person so... :)
评论 #25991528 未加载
评论 #25992669 未加载
评论 #25993473 未加载
评论 #25992036 未加载
评论 #25993906 未加载
评论 #25992812 未加载
评论 #25992721 未加载
评论 #25991563 未加载
评论 #25991606 未加载
评论 #25991555 未加载
axegon_over 4 years ago
Despite having used document oriented databases for many years(largely because they were shoved down my throat and I inherited someone else&#x27;s architecture), I never really managed to figure out why people find them so compelling. There has been a shift in the last two years and people have started running away from them. Specifically the web-dev crowd adored them and I guess it&#x27;s easy to fetch a document in the exact structure you need it but sooner or later you inevitably reach the point where you have to analyze data. And here mongo(and all the similar alternatives) become the biggest pain in the a...neck you can think of. Couchbase tried to tackle this issue with n1ql to a certain degree but at large scale it is still not particularly useful. To my mind, having a relational database which has a good architecture can&#x27;t be matched by any document oriented database. But getting a large system&#x2F;database right does take more effort. There are numerous ways to make relational databases incredibly scalable but again, it takes a lot more effort.
评论 #25992774 未加载
评论 #25991807 未加载
评论 #25994500 未加载
评论 #25992132 未加载
评论 #25992084 未加载
评论 #25993419 未加载
评论 #25994364 未加载
评论 #26019018 未加载
jonstaabover 4 years ago
&gt; On my laptop, PostgreSQL takes about a minute to get denormalized data for 12,000 episodes, while retrieval of the equivalent document by ID in MongoDB takes a fraction of a second.<p>What? Her database can&#x27;t possibly be indexed properly.
评论 #25991241 未加载
评论 #25993379 未加载
评论 #25992049 未加载
评论 #25991258 未加载
评论 #25992213 未加载
评论 #26000452 未加载
评论 #25991949 未加载
flowerladover 4 years ago
I use MongoDB in my application. The approach I took is to store data in flat documents (relational style) and only de-normalize when necessary for performance. The relational model was invented for a reason -- it is flexible and it is easy to update data in one place and so on. The downside of relational is that joins will kill you when you have very large tables. To avoid joins, I use lookups when possible, and de-normalize only to the extend needed. I get the best of both worlds.
评论 #25991826 未加载
petepeteover 4 years ago
I first read this article while working on a project where the company had basically written a RDBMS using MongoDB. It was so many different kinds of bad I lost count.
评论 #25991224 未加载
jasondcover 4 years ago
This article from 8 years ago highlights how far MongoDB has come: transactions, left outer joins ($lookup), etc.
评论 #25992141 未加载
评论 #25993675 未加载
nchaseover 4 years ago
This article appears here pretty frequently: <a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=false&amp;query=never%20use%20mongodb&amp;sort=byDate&amp;type=story" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=false&amp;qu...</a>
digitalsushiover 4 years ago
As a sysadmin that often gets the privilege of pretending to design the smallest of complex systems, one of my regular components has been CouchDB because of its built in http api.<p>I&#x27;ve never been anti-Mongo, but this one little piece has made CouchDB an affordable choice for people like me who are not equipped to otherwise defend the choice.<p>Is there a missing piece that could deal Mongo back in the next time I try to convince someone that there&#x27;s as straight a path to the sysadmin solutions I generally compose?
评论 #25991559 未加载
a13nover 4 years ago
We&#x27;ve used MongoDB at our SaaS and have grown to well over $1m ARR and never had an issue.<p>Maybe if you&#x27;re trying to build a massive ($B) company, starting with PostgreSQL makes more sense for you. For everything else, MongoDB works just fine.<p>Just use the technologies that you know and can move fastest with. Startups rarely succeed&#x2F;fail because of which technologies you choose to use.
评论 #25992846 未加载
offtop5over 4 years ago
Mongo and other nosql databases are still the absolute fastest way to get started particularly you don&#x27;t know what your data is eventually going to look like.
评论 #25991718 未加载
评论 #25991158 未加载
评论 #25991977 未加载
评论 #25991380 未加载
评论 #25991695 未加载
ashtonkemover 4 years ago
I&#x27;ll never ever use MongoDB again, because every single time I&#x27;ve ended up running a cluster it has always been the most troubled part of my stack. I&#x27;ve been burned <i>way</i> too many times to ever considering touching that stove again.
评论 #25991869 未加载
nojvekover 4 years ago
I think there are two separate aspects that get conflated into one.<p>1) Document database - rather than a strict rigid schema, you can store nested json documents in tables&#x2F;collections. Or the idea of soft schema where the whole database doesn&#x27;t need to be blocked for a schema change and you have some leeway in integrity.<p>2) Relational database - Ability to make complex sql queries that join data from multiple tables.<p>Mongodb has some support for joining but it doesn&#x27;t have a sql variant. If your data is mostly key:val store then it&#x27;s great. You can shard it, and have replicas. It&#x27;s easy to make a fast reliable backend with mongodb. Many popular sites run on mongodb backend.<p>However with new json types in MySQL and Postgres, it too has support for inserting documents and querying subkeys. It can be sharded and replicated (albeit with a bit more configuration).<p>Couchbase which is like mongo (in its document store capabilities) N1QL which offers agility of SQL and flexibility of JSON.<p>So like any tool, it has it&#x27;s tradeoffs.<p>Then again kudus to the author for evoking our reptillian brains: &quot;Never use MongoDB&quot; incites emotions and gets you on top of HN. If it was called &quot;When to use MongoDB&quot;, it wouldn&#x27;t get the same reaction.
cyxxonover 4 years ago
&gt; On a social network, however, nothing is that self-contained. Any time you see something that looks like a name or a picture, you expect to be able to click on it and go see that user, their profile, and their posts. A TV show application doesn’t work that way. If you’re on season 1 episode 1 of Babylon 5, you don’t expect to be able to click through to season 1 episode 1 of General Hospital.<p>That is exactly what I&#x27;d expect, and that is how small websites like IMDB work. I am on the page for a General Hospital episode, and via the actors in the episode or whatever other part I can click through to Babylon 5, or the other way around, or anywhere else.
lekeover 4 years ago
&gt; But there are actually very few concepts in the world that are naturally modeled as normalized tables. We use that structure because it’s efficient, because it avoids duplication, and because when it does get slow, we know how to fix it.<p>Urmmm...How?
dudeinjapanover 4 years ago
MongoDB + Ruby sparks joy for me. It&#x27;s come a long way since 2013 and latest features like transactions (though nowhere near SQL level of robustness) are enough for my use cases. To each his or her own.
andikleen2over 4 years ago
In the early tens we ran an engineering project to improve critical sections in applications using transactional memory. We had a PhD level intern applying our techniques to various open source projects. One target was MongoDB. After a few days of investigation of the Mongo source code, he had to give up because he couldn&#x27;t even find the critical sections in the source. They had locking, but it was extremely convoluted.<p>So yes I would agree with that. Never use MongoDB.
AtlasBarfedover 4 years ago
Jepsen review 2020:<p><a href="https:&#x2F;&#x2F;jepsen.io&#x2F;analyses&#x2F;mongodb-4.2.6" rel="nofollow">https:&#x2F;&#x2F;jepsen.io&#x2F;analyses&#x2F;mongodb-4.2.6</a><p>... not good.
dangover 4 years ago
If curious see also<p>2016 <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12290739" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12290739</a><p>Discussed at the time: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6712703" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6712703</a>
amir734jjover 4 years ago
I&#x27;m not a fan of MongoDb (although I have used it for many years) but it has its place in the market and there is need for it. &quot;Never use MongoDb&quot; is a clickbate title. I really wish I could down votes this post but I can&#x27;t. I can only upvote unfortunately.
eeccover 4 years ago
Ok, so besides the technical faults of Mongo within the context of its category, what is the ideal use-case of a document oriented store?<p>If you use metadata documents to model your relations you might get away with the most dangerous foot guns, but then why not jump straight into graph databases?
the_dukeover 4 years ago
I&#x27;m by no means a fan of Mongo, but the product has improved quite a lot over the years.<p>Mongo now supports multi-document (and multi-node) transactions, joins, and has a decent storage engine.<p>So you might even have a chance of keeping your data actually consistent.
eatwater123over 4 years ago
Unless you want to.
franklytover 4 years ago
SQL is a solution to a problem in the vein of prematurely optimizing for many use cases where mongodb is called for.
fortran77over 4 years ago
But it&#x27;s web scale!<p><a href="http:&#x2F;&#x2F;www.mongodb-is-web-scale.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.mongodb-is-web-scale.com&#x2F;</a>
alpineidyll3over 4 years ago
For the record we use mdb in production, and it&#x27;s been fine.
HelloNurseover 4 years ago
TLDR never use software architects who don&#x27;t realize how MongoDB is a really bad fit for their needs. Mistakes are possible, but not thinking about requirements is negligence.
manishsharanover 4 years ago
plot twist .. use MongoDB api &#x2F;drivers on Document Layer on FoundationDB ;-)