Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If you see a college student or fresh grad using MongoDB stop them. They need help. They have been led astray.

I like this sentence way more than I should.



Fully agree. At that level, the justification for using MongoDB usually boils down to not wanting to deal with table schemas or SQL. In both cases, there are better alternatives.


> not wanting to deal with table schemas or SQL.

In most cases you're not even removing the concept of the schemas, your just moving them from your database to your application. Which in a sense is worse, especially if multiple applications needs to access the same database.

As for SQL, I have yet to see something solve the problem for querying a database in a simpler manor.


I’ve heard stuff like this from supposedly senior people - if we use mongo we can just store anything, we don’t need to think about a schema (also you can only store short strings in an SQL database)


Related

>Good programmers worry about data structures and their relationships

https://news.ycombinator.com/item?id=41268803


Good Lord the level of incompetence is terrifying


Most people dontgain competence until they learn from their mistakes


But typically, if you do spend some time to think about schema, and relationships, you only have to spend a small amount of time, and map that into the appropriate place, and then usually you don't have to mess with it again. It's worth the investment.


If we don’t think about it now we’ll really have to think about it way more later.


Hence, the birth of the dreaded 'technical debt'.


This sentence has no substance. It gives the reader nothing to understand why MongoDB has both happy customers some who have been disappointed.


The explanation is in the paragraph before it


except its factually incorrect when applied to Mongo[1].

[1] https://news.ycombinator.com/item?id=41273563


You can also shard with postgres, how is that a USP of Mongo?


I didn't say it is a usp for mongo. Only saying that there is a lack of substance behind the mongo criticism in the article.


I don’t. How are new grads supposed to learn the ups and downs of different choices they make? Just being told they’re led astray in a blog post isn’t gonna work - it’ll backfire.

I used node as a new grad for things it wasn’t meant for and that’s how I learned what it is good at and what it isn’t.


It's OK to use anything in personal or throw-away projects.

But if your choices might cause big losses, it's better to avoid experimental technologies.

"Nobody was fired for choosing IBM" is a known meme, but it's not just meme, it's actually solid advice (not specifically about IBM).


You are basically referring to the "Boring Technology Club" [1] by @mcfunley.

[1]: https://boringtechnology.club/


Out of curiousity what were the things you shouldn't have used node for?


I‘d also like to know. I have yet to run into anything Node can’t handle


Exactly, SSPL is such a trojan horse, and God knows how they will change the license in the future


Maybe it's just me, but I think it's purely rational?

A lot of these OSS projects provided a commercial offering in the form of SaaS. Yet AWS/GCP/Azure can just take the OSS project, not contribute anything, and reap all the profit.

AFAICS, these licenses are only intended to defend against the cloud providers, not against companies just using the product commercially and internally.


Amazon, Google, and Microsoft can do anything, snuffing out some mid company is the least of their crimes.

> not contribute anything, and reap all the profit

Yeah, it's called capitalism. What's their stance on Lina Khan breaking up the monopolies? Have they written letters criticising Reid Hoffman for pressuring Kamala?


That’s not remotely the point.


Me too.

I'll give you one counter-argument, though: maybe it's hard to appreciate all of the problems a traditional SQL RDBMS solves until you try and solve them without an RDBMS... and crash and burn badly.

But, if they're actually building a real product with real funding money and they only know MongoDB... yeah, it's intervention time.


I would not wish this on anybody.


> They have been led astray.

They haven't though. What's wrong with using a tool even if it might be bad? Especially as a fresh user. It's how we learn. From both good and bad experiences.

> They need help.

Sadly it's not the fresh grad, but the "experienced" that only keep their old experiences that need help. Is this comment from 2010? MongoDB has improved. Maybe not to the point of being the best but definitely not unusable.


> Especially as a fresh user. It's how we learn. From both good and bad experiences.

I'd do that, but a superior strategy is letting other people make mistakes and then learning from them. It is best to always be making choices that seem like they could be optimal, with very rare exceptions.


I agree. But unless you are at least tangentially involved, you are likely not to hear such „gone bad“ stories.

First, people are not nearly as self reflective or admit to failures at all. And second, a bad tech decision might not be directly observable (as you will then often see ppl fighting symptoms rather than change and identify the root cause).


> but a superior strategy is letting other people make mistakes and then learning from them

If this was a superior strategy that was so obvious no 1 would be making mistakes so how does this work? Not everything is strictly better.

And by that logic...

>> the superior strategy is letting other people comment (and make mistakes) and then learn from them

i.e. don't read the post until years later to ensure you have all the mistakes and learnings. Sorry, this thread is still live.


> If this was a superior strategy that was so obvious no 1 would be making mistakes so how does this work?

Either people aren't aware of an optimal strategy (if one exists) or they ignore it for various reason.

The latter is surprisingly common. People know they should exercise, get enough sleep, eat healthy, stay hydrated, tackle high priority tasks instead of procrastinating, etc. - and yet they still aren't doing those things (or as much as they should).

Knowing something is not enough.


> Either people aren't aware of an optimal strategy (if one exists) or they ignore it for various reason.

And my point was precisely that it often doesn't exist. What is an optimal strategy?

> People know they should exercise, get enough sleep, eat healthy, stay hydrated, tackle high priority tasks instead of procrastinating, etc. - and yet they still aren't doing those things (or as much as they should). > Knowing something is not enough.

Your example doesn't even support this. People know they have to get enough sleep but they also know they have to <insert something else>. It depends on what they are optimizing for. i.e. there is no singular optimal strategy.

You've just proved my point rather than yours.

I don't know if knowing is not enough, but clearly the people in your example don't know what the optimal strategy is. E.g. eating healthy is NOT the optimal strategy as it could make them unhappy (e.g. don't like the taste). It's not optimal unless it's strictly better.


> If this was a superior strategy that was so obvious no 1 would be making mistakes so how does this work?

I agree with duckmysick, and also please take note that having a strategy of not making mistakes will not avoid all mistakes. Outcomes and intent never match up perfectly. But that is why it is important to learn from others right from the start.


> I agree with duckmysick > But that is why it is important to learn from others right from the start.

It's important if you know what you're learning but...

What do you even agree with? i.e. what's the learning?

>> duckmysick claims people ignore the optimal strategy but could not even give an example of 1.

This proves it's better to try it yourself than to assume you're learning and make even worse mistakes.

> and also please take note that having a strategy of not making mistakes will not avoid all mistakes

Where is the strategy to begin with? 0 + 0 was 0 to begin with.


MongoDB salesdroids rely heavily on you having a low familiarity with other database tech to spin themselves as the only game in town. "Being led astray" isn't a passive, ambient occurence, and it makes sense to push back against it.


On the other hand I know of multiple databases where all tables had attribute_1, attribute_2,..., attribute_5 columns Just in Case™

But more seriously the one feature I like in MongoDB is the pipeline API, where you can express a complex query with multiple filters/aggregations/transformations/joins as a list of simple steps.

There are some use cases where it is very ergonomic (even if I suspect that mongo can easily lose indexes along the steps so pretty performance might not be super intuitive)


I forgot about what I hate about mongo, so I will rant here about it: its data model is close enough but different enough from json to be both annoying and dangerous.

The empty string is a valid json key but not a mongo document key.

Mongo uses $operator keys to serialize its datatypes to json but does not sanitise the result: which means that {"foo":100000000000000000} and {"foo":{"$longInteger":"100000000000000000"}} will have a collision with the json export format. (Even if you choose the fully explicit Canonical format as there is no $document operator to wrap ambiguous documents)

So if your plan is to dump json to mongo you should plan for that (also sometimes $operators are evaluated sometimes they are not, it depends on each method and the documentation does not tell you )

The official client (both csv and json) is unable to export a collection if a field is both a value field both an atomic value and an object, so a collection with two documents: {a:1} and {a:{b:1}} will cause problems of you try to export it.

My colleagues have other issues with the json DSL and how most operators exist in 2-3 different forms with different syntax or how the syntax {$operator:{arg1:..., arg2:...}} is unintuitive but I actually sort of like it.


It's honestly difficult to see how this is relevant. There's a difference between just not knowing any better and being misled for money.


Some people think it’s them and double down with using a bad tool for the job.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: