Why MongoDB and not SQL databases?

Out of curiosity, why is MongoDB and Mongoose taught in the FreeCodeCamp curriculum, instead of SQL databases like PostgreSQL?

Long story short: now that I’m looking for a job as a web developer, it seems like every business in Spain wants you to know MySQL or any other SQL-based solution. So I started learning about SQL and I find it easier and more enjoyable to use.

Is there any benefit of MongoDB that makes it preferable in some situations?

2 Likes

Hello there,

I cannot speak much for why not, other than: freeCodeCamp teaches everything (to an extent) that it uses. If you have a look at the codebase, ~90% of it involves the tools taught in the curriculum.

So, seeing as MongoDB is used, it is taught, and seeing as it is taught, and there are resource constraints preventing an endless curriculum, SQL-based database solutions are not taught.

I will leave this for someone else to answer.

Do remember, you can find multiple multi-hour tutorials on the freeCodeCamp YouTube channel on SQL.

Hope this helps

3 Likes

Thanks @Sky020 ! In truth, the course materials were very well done and I enjoyed discovering the applications of tools like MongoDB. And although so far I find SQL easier… it’s just my subjective experience.

1 Like

Well, it has to each something. And NoSQL is common to pair with Node (the MEAN and the MERN stack). Perhaps it is because NoSQL is essentially storing JS objects so it is a little easier to swallow at first.

I assume that at some point FCC will teach SQL. But FCC is a non-profit, relying on a lot of volunteer work so these things take time.

As to when to use which, both have strengths and weaknesses. There are plenty of discussions, like here.

But I’m in the same boat as you. I am pretty handy with NoSQL but want to learn SQL. I have a vacation week coming up where I plan to do a deep dive into SQL, using the myriad of resources available on the internet.

In the long run, it’s probably nest to know both.

3 Likes

Hey there,

I think as a dev who wants to get a job,
you have to know SQL,
because most existing projects/products use SQL.

Actually doesn’t matter which one you use,
as long as you understand the basic concepts.
I mostly use PostgreSQL.

1 Like

Enables faster access of the data due to its nature of using the internal memory for the storage. Since, it is a NOSQL database, then it is obviously secure because no sql injection can be made. MongoDB can also be used as a file system, which helps in easier way of load balancing.

MongoDB is a powerful, scalable, free & open-source NoSQL based database. … scalable data storage service which makes it a popular choice in the performance-critical application. … Use-case: some applications require data to be structured. In such situations, it is better to use SQL based databases.

@nerdifico,
Just learn it. No complexity. I hope, you’ll find it easy.
You’re not allowed to change the platform of a company by comparing benefits where you don’t work for, the set of skills that allows you to get there- is the only thing you need first. But having other skills will expand your path.

It has the advantages (in the context of the FCC curriculum) of

  • being ridiculously easy to set up (cloud hosted). Relational dBs are very easy to set up locally, but not so much online
  • being free for the usecases on FCC (cloud hosted). For relational, not so easy to get free hosting in a cloud context
  • having it’s API primarily in JavaScript, obviously not the case for SQL dBs
  • conceptually, working in a way that is immediately understandable to people who have been learning JavaScript, obviously not the case for SQL dBs
  • finally [and this isn’t a positive, just more why it is/was so popular], appearing at the same time as Node really took off, and being extremely aggressively marketed by 10Gen (later MongoDB Ltd) as the answer to everyone’s problems.

As a generalisation, relational (SQL) dBs are much more widely useful. NoSQL databases normally optimise a specific aspect of a database, so normally a specific NoSQL dB will be [hugely] more performant for a specific task (different NoSQL dBs often have very little in common bar the confusing name). Here’s a good, thoughtful article on MongoDB that might be a good read for you. It’s a pretty good choice for the FCC curriculum anyway, because of the reasons above.

Re. learning SQL – it’s an extremely useful skill to have, it’s not likely to be wasted time at all. Having companion knowledge of Mongo and figuring out where there are advantages/disadvantages to its approach over a relational dB, that’s also really useful.

2 Likes