DEV Community

Discussion on: Mongodb-native over mongoose?

rpajf profile image
Raphael Portela

Thank you so much for such a complete and elucidating answer. I started programming in june of 2019, im focused on node, ReactJS(using hooks) and React Native, I use sequelize in the backend, and yes, on MVC when your controller is getting too big, the creation of aditional services is required. I started learning mongoose this week and i saw that the comands were not so different from the ones on MongoDB itself, unlike sequelize(the most known ORM), and then i landed on this page. I saw your code on gitlab, its very different from what im used to do, i will gitclone and explore this example, but what do you suggest me doing? stick to mvc a bit? learn mongo, learn pure SQL, maybe flutter in the end of 2020?

Thread Thread
yentsun profile image
Max Korinets • Edited on

Surprisingly I'm doing some frontends right now and use React Hooks too :) I'd say Hooks is a beautiful piece of technology (rarely seen nowadays) and I'm really excited about it!

My advice will probably be:

  • if you joined an existing project - you won't have the luxury to get away from MVC in near future as employers consider it a standard and you will have to do it
  • don't forget that there is something else, try non-MVC on a pet project
  • dig CQRS + Event Sourcing (until you fully understand what it is, seriously) - this will be a revelation, also altering your mindset a bit
  • after digesting CQRS/ES, you will likely discover that MongoDB (in its initial state, no schemas) is an ideal read-only 'projection' storage rather than general data storage. It looks like being under pressure by the industry, so it tries to be a general data storage. Emerging of Mongoose is probably the result of this pressure too :)
  • Postgres (or other flavours of SQL-based storages) on the other hand, is a better general data storage - schematize your data to your heart with the variety of types
  • haven't tried Flutter but I have strong confidence in React Team, I'd probably prefer their stuff. I haven't touched mobile development yet though :)