3 ms·
> > Having a database enforce these relationships can offload a lot of work from your application, and therefore from your engineers. > I've never seen anyone u
by Jean-Philipe 8y ago
> > Having a database enforce these relationships can offload a lot of work from your application, and therefore from your engineers.
> I've never seen anyone use MongoDB without also using something like Mongoose where you get all this for free. Zero work for your engineers.
For me, Mongoose is actually another argument against MongoDB. It's basically trying to add basic functionality on top of MongoDB, that most RDMS already have.
And no, it does actually not "all of that", just some of it. Just an example: Mongoose would still let you delete a user, while all of the related posts are remain with broken references to that user.
> Can you give an example of something that you realistically would want to do in SQL that you can't with a JSON query?
Sure everything can be done, it's just clunky and hard to get right. This graphic perfectly summarises the horror of writing simple queries in MongoDB: http://twiki.org/p/pub/Codev/TWikiPresentation2016x07x14MongoDB/mysql-vs-mongodb-900.png http://twiki.org/p/pub/Codev/TWikiPresentation2016x07x14Mong...
I've been using Mongoose in production for several years, 2011-2014 and again for the last 12 months, within teams of 4-8 developers. The amount of engineering, bug fixing and testing was definitely higher in MongoDB than with MySQL or Postgres.
Once I got to work with MySQL and Postgres after 2014, I found it so much easier to query for the data I'm looking for and to ensure data strong consistency, mind you, even without any use of a library!