4 ms·
I feel like a lot of issues people have with NoSQL or MongoDB is that there trying to fit the Relational Model and SQL way of doing things into MongoDB. MongoDB
by DonnyV 9y ago
I feel like a lot of issues people have with NoSQL or MongoDB is that there trying to fit the Relational Model and SQL way of doing things into MongoDB. MongoDB is a document database. So the things you did in a RDBMS won't work in a document database. Time to think different.
Some of the things I'v seen people complain about.
JOINS - should be done in the application
SQL - one of the big issues I have with RDBMS is that application logic lives in the database and application, causing all kinds of brittle spaghetti code. If you need that code to live outside of the application then its time to build a web-service around it or just have a shared library all the apps use.
Reports - should be done in the application, could also create a view in Mongodb and pull report data from that.
Schemes - RDBMS schemes are a huge pain, the restrictiveness of it causes all kinds of pain when you want a dynamic data-store. The best thing about Mongodb's collections is that every document in a collection can have a totally different schema. If you want to do that in a RDBMS you end up hacking it by shoving json or xml data into fields. Your basically creating a document database but doing a horrible implementation of it.
ORMS - if your using an orm then your already going down the path of using a NoSQL database. ORMs are hacks for RDBMS because mapping your data model to SQL is a pain. With Mongodb this is all built into the driver and database. Thats why Mongodb Inc creates drivers for all major languages. Plus most drivers have attributes you can decorate your modals with that make it flexible when the structure changes. So nothing blows up.
- flavio81 9y ago> JOINS - should be done in the application Ok... Also tell me, transactions should be done in the application as well? Great! Next time, i'll do transactions and joins in the application, and discard the 35+ years of experience and performance improvements that any modern RDBMS has for joins and transactions. > The best thing about Mongodb's collections is that every document in a collection can have a totally different schema. In which sense is this a good thing? > ORMS - if your using an orm then your already going down the path of using a NoSQL database. ORMs are hacks for RDBMS because mapping your data model to SQL is a pain. The ORM simply allows easier interaction with the RDBMS when using an object-oriented programming language, mainly for moving data from tables to objects. The ORM is explicitely for RDBMS; the "R" in "ORM" stands for Relational.