Why I switched from MongoDB to PostgreSQL (Rasmus Porsager)
Вставка
- Опубліковано 25 сер 2024
- From the "JS Party" podcast. More 👉 jsparty.fm/
Subscribe for more! 👇
Apple: jsparty.fm/apple
Spotify: jsparty.fm/spo...
Android: jsparty.fm/and...
Overcast: jsparty.fm/ove...
Email: jsparty.fm/email
Twitter: / jspartyfm
#javascript #css #webdevelopment #webdev #opensource #softwaredevelopment #softwareengineering #js #frontend #backend #nodejs #podcast
he opted to swap ships because he discovered the beauty of SQL, which it is fine, flavors and colors are in the garden. Honestly, I thought he will talk about any technical limitation he found, for example, performance, scalability, etc. etc.
I've been using SQL since the the mid 90's. I've also been using MongoDB now for about five years. The moral of the story is horses for courses - use the right tool for the right job. When you have highly structured data SQL is more efficient. If however you want to build a system which has dynamic schemas at runtime MongoDB is hard to beat. A SQL schema is typically developed at design time and burnt into the binary. Changing a SQL structure can be a royal pain involving migration scripts. MongoDB allows you to store data in user defined structures. Often you still have a schema, but it is not imposed or enforced by Mongo. It is a runtime artifact which can be modified to suit the needs of users. Mongo isn't a drop in replacement for a SQL database, and if you use it that way you end up with the worst of both worlds.
you didnt answer why ...
Though I VERY MUCH prefer document databases like MongoDB over SQL databases like MySQL and Post, I think all developers need to know at least one of each, alongside knowing how to utilize MongoDB's JSON schema functionality for implementing schemas.
Also, when using MongoDB, dump Mongoose in favor of creating models via JavaScript classes. Each class/model should (obviously) feature find, post, delete, etc methods. Mongoose is one of those abstractions that is very unneeded, but just adds another layer of complexity.
Mongoose adds complexity? What about it make makes it complex? Even the official mongodb package has schema definition similar to mongoose
I'm an old school SQL guy but I'm currently learning MongoDB and it's got it's uses but they are very niche IMO.
The most I use mongo the more I have complete distain for it.
Ever tried Postgres? 😉
Lol we migrated from PostgreSQL to Mongo because its performing better. You shouldnt use mongoose, its a performance killer
Which tool you should prefer?
@@bahrambayramli4343 today after 10 years we used everything and if i have to choose: angular + net core + mongo are awesome
Do you use mongodb driver instead of mongoose?
@@drblahblah929 yes
@@drblahblah929 absolutely. ODM will have limitations as you scale. Good to use direct driver, as you have full control.
Apples vs oranges. Relational vs NoSQL should not be a preference.
They're tools. Use the best tool for the job.
Relational = relational data
NoSQL = non-relational data
You're going to lose out on a huge amount of performance if you can differentiate between the two.
There is no one size that fits all.
There are very few reasons to ever use noSql
@@krisnrg There are very few reasons to ride a unicycle but there are still valid reasons to.
Nonsense. He has no good reason for switching.
Did you encounter any performance issues?
Did you encounter any scaling problems?
No reasonable point. I just feel this is just meant to diss Mongodb.