9 ms·
I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors
by lossolo 10y ago
I've just migrated one project from mongo to postgresql and i advise you to do the same. It was my mistake to use mongo, after I've found memory leak in cursors first day I've used the db which I've reported and they fixed it. It was 2015.. If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db do it for you.
- Joeboy 10y ago> don't use mongo, it's just hype I'm kind of curious as to where this hype is. I've almost never heard anybody say anything positive about mongodb. All I ever see is people saying it's terrible / hilarious for various reasons.
- api 10y agoIt's massively successful in the entry level web coding world due to a combination of good marketing and the belief that it gives you unlimited scale 'for free' and everything 'just works.' Not saying those are impossible goals but so far no database has managed to deliver that. Building a large-scale endlessly-scalable database is still very hard and very detailed and easy to screw up.
- tim333 10y agoTheir website is quite hype prone: >The Standard for Modern Applications >MongoDB 3.0 features performance and scalability enhancements that place MongoDB at the forefront of the database market as the standard DBMS for modern applications. >Also included in the release is our new and highly flexible storage architecture, which dramatically expands the set of mission-critical applications that you can run on MongoDB. >These enhancements and more allow you to use MongoDB 3.0 to build applications never before possible at efficiency levels never before attainable.
- 010a 10y agoThe people who wrote that are not the same people who write the database.
- partycoder 10y agoThe standard for the golden age of crap. Hang out on the freenode room for mongo and you will see that most people, working on production software, make inquiries that reflect a complete lack of knowledge, common sense and leave you facepalming with no hope in humanity at a large.
- lucasmullens 10y agoThe HN crowd tends to insult it, but outside of HN people hype it up. People keep talking about how much they love the MEAN stack. It's huge in the hackathon crowd, due to them sponsoring many of them, and its low learning curve. I wish people would stop using acronyms and realize Express/Angular/Node is just as good with something other than Mongo.
- sotojuan 10y agoI can confirm. On HN, meetups, Twitter, etc. no one talks about MEAN stack any more because of Mongo and the Angular 1/2 split (and React's popularity). In the last hackathon I went to, like most "corporate sponsored" ones, you got a special prize for using it.
- cloudjacker 10y agothanks for spelling that out for me great incentive to dive into React further and ditch Mongo
- vonklaus 10y agoif you are just messing around you might be interested in vuejs & rethinkdb. found it a pretty intuitive stack, much easier than react for me
- zeemonkee3 10y agoAre people using React starter kits? The major issue I'd see with React at hackathons is the large amount of configuration you typically need to do before you get started. I dislike starter kits due to the additional complexity overhead, but I can imagine for a throwaway project they'd be fine.
- zeeshanm 10y agoI think this is part of the reason who RoR, MEAN and other such frameworks are so popular. They tend to be easier to setup and many developers love it. My own theory is there are so many bad devs out there so that contributes to the hype because so may devs end up adopting it. Take it with a grain of salt...
- davidw 10y agoIt got pretty hyped a few years back when it was new, and 'NoSQL' stuff was just coming out.
- brokentone 10y agoIt was the hottest thing a 2-4 years ago. Hype is probably the biggest association anyone who lived through that and didn't drink the coolaid has.
- stevecalifornia 10y agoWhen it first came out it was hyped big time. Every other article was about how great Mongo was. About a year later the fallout started bubbling up. Digg went down for one or two weeks because of switching over to Mongo-- Reddit saw an influx of users and now is what it is.
- simtel20 10y agoI recall that Digg moved at least some part of their site to cassandra. Did they in fact do both?
- throwaway420 10y agoLike with any online community, Hacker News can be kind of an echo chamber where groupthink reigns and alternative points of view aren't encouraged. MongoDB hype has died down here, but there are still some people that are fans. There are some things MongoDB does fairly well: * MongoDB is really easy to use * Document databases can be great and flexible solutions for some kinds of projects * Documentation is fairly good so learning the basics isn't too hard even if you know nothing about it * scales fairly well at the initial stages * arguably quicker to get a project off of the ground with than traditions RDBMs, which might be the most important consideration for any startup even if a complete rewrite would eventually need to take place That being said, I've used MongoDB significantly before and it wouldn't be my first choice for most types of new project: PostgreSQL probably would be
- vonklaus 10y agoIdk about hype, but for node.js virtually every tutorial uses it. I think the stereotype is that postgres locks you into a data model but your needs vary drastically. I suspect mongo is harder to retool the schema than it is widely claimed, while pg/msql is slightly easier than is often claimed. I doubt they meet in the middle, but both have great use cases. scaffolding out a quick isomorphic js app is great for mongodb for example. pg is faster and more robust. its just tech, depends what you are optimizing for
- partycoder 10y agohttps://xkcd.com/937/ https://xkcd.com/937/
- chaostheory 10y agoAbout the only thing I agree with is how great their docs are. * Mongo is only easy to learn. Beyond simple demos, it gets harder and harder to use as projects evolve i.e. you have to do a lot of work yourself imo this is a common problem with nosql datastores that isn't exclusive to Mongo * "Document databases can be great and flexible solutions for some kinds of projects": Postgresql has been able to work directly with JSON for some time now. There are also other document datastores that are more reliable than Mongo * Scaling with Mongo is difficult, specifically the crazy setup. Even if you set it up properly, the results don't tend to match the marketing https://aphyr.com/posts/322-jepsen-mongodb-stale-reads https://aphyr.com/posts/322-jepsen-mongodb-stale-reads * "arguably quicker to get a project off of the ground with than traditions RDBMs" unless you're using Meteor, I'm also going to disagree here. Most frameworks target a relational database by default. Developing by convention tends to get you off the ground much faster than using something more specialized and niche
- threeseed 10y agoThe hatred for MongoDB mostly comes from the PostgreSQL supporters camp. The rest of us are just using whatever tool makes sense. MongoDB is the fastest database I've ever used. The easiest to get running, stable and scaled out. The best documentation by far and has excellent integration e.g. Spark, Hadoop. If you are doing Big Data it's a great tool in the arsenal.
- orthecreedence 10y agoIt's fast because it doesn't actually save your data when you ask it to. It saves it later, when it feels like it, maybe. Also, the hate I have for Mongo is from first-hand experience with the wretched thing. The scaling is insane. The next jump after your first server is like 9 servers (2 repsets w/ 3 servers each w/ 3 config nodes). I don't have that kind of cash laying around for servers, especially when instance-for-instance, Postgres can handle easily 10x the write load of mongo.
- SmirkingRevenge 10y agoRethinkDb does all of this better, and with good engineering and API design behind it.
- rco8786 10y ago> If you have a lot of relations in your data don't use mongo Perhaps you should have been using a relational database from the get go. Sounds more like your issue, not mongo's.
- pluma 10y agoContrary to what the name implies, most relational databases don't handle querying relation-heavy data well. If you need to hit plenty of relations in your queries, instead consider something that is optimized for that, like a graph database (or multi-model including graph).
- mikegioia 10y agoIf you have a lot of relations in your data don't use mongo Why would you use Mongo if you have lots of relational data? Why would you not start with a relational database for that? I know Mongo has issues but it's never going to beat an RDBMS on relational queries.
- jsemrau 10y agoBecause then you start moving your RDBMS logic in the application layer. And AFAIK, this is not the place for it.
- lossolo 10y agoIt will never beat it in non relational queries also. To answer why - it was suggested by someone that said it's new modern db standard, that NOSQL is clear winner then showed me comparison on their site with SQL queries, all looked like it was substitution for RDBMS but it's not.
- gleenn 10y agoI think this is a common pitfall though: people start off thinking they don't really have relational data and then realize they actually do. Now they have a pile of code integrated with a DB that doesn't do relations well and can't be ported easily and then encounter cool bugs like this. No bueno.
- lloyd-christmas 10y agoWe start our apps with mongo, and design them with a migration plan to postgres. We've found it's very easy to rapidly develop the application with mongo due to it's flexibility. Once we understand where or app is headed and what our relationships actually are, we pretty much pull the plug out of mongo and stick it in postgres. If you build a reasonably intelligent query wrapper it's fairly effortless. That being said, we're thinking of moving our early prototyping to Rethink now that it's made some strides.
- danneu 10y agoMeanwhile, normalized data is what gives me so much flexibility when using Postgres at the start of an app. I just store my data as generically as possible and usually all I need to change under churn is the queries. Denormalizing on day 1 (Mongo) has you making guesses about your data access patterns at the worst possible time instead of just thinking about the data itself.
- Zikes 10y agoPostgreSQL and jsonb might make it a more seamless migration that some may think: https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.4#JSONB_Binary_JSON_storage https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_... JSONB values are indexable and queryable, so there aren't very many downsides.
- sotojuan 10y agoEven if you want NoSQL I'd use RethinkDB over Mongo any day. Way better query language, real-time support, and relational/regular SQL-like stuff. https://rethinkdb.com/docs/comparison-tables/ https://rethinkdb.com/docs/comparison-tables/
- williamstein 10y agoAnd the use case of this post is exactly what RethinkDB does better: "One of our services periodically polls the database and reads the list of running containers with the query..."
- rtnyftxx 10y agoArangoDB in contrast to MongoDB is a ACID document store also with graphs.
- hinkley 10y agoI still want to know how anybody is making money off of data that doesn't have a bunch of relationships in it.
- smanuel 10y ago> If you have a lot of relations in your data don't use mongo, it's just hype. You will end up with collections without relations and then do joins in your code instead of having db do it for you. So... you are not against MongoDB but against NoSQL in general? I've used MongoDB and I've never ended up with lots of joins in my code. But I guess it all depends on the use case and how you've structured your data. Document databases are not a silver bullet.