Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ORM for MongoDB [closed]

I've just started using MongoDB (My first NoSQL db experience). This is a project which will process large amount of data in the future. i'm writing the skeleton for data access. After a lot of thoughts, still i'm confused whether i should pick an ORM like morphia for MongoDB or should i use the provided interface from the MongoDB driver class and write the DAO from scratch. I know that there is a trade off between performance and ease of development here. At the same time, unlike relational databases, NoSQL databases doesn't necessarily need an ORM mapper in the most cases i guess. Please advice me on using ORM for MongoDB for big data startups?

like image 992
popcoder Avatar asked Mar 23 '23 10:03

popcoder


1 Answers

I would advice that if you are new to any sort of application, you try to use the lowest level APIs first. This makes you familiar with the product and you learn how to work with it. You get to know its strengths, you will learn how to use it in the most optimal way, and you get to know its weaknesses. You will never learn those things if you start hiding behind an ORM from the start on.

If you then get to know the system (in this case) MongoDB well enough, then you could consider using an ODM—we tend to call it an ODM, as the R stands for "Relational", whereas the "D" stands for "Document". But as you say, for dealing with MongoDB, or any NoSQL databases, having an ODM doesn't always make a whole lot of sense but it could improve developer productivity. But to start, I would avoid an ORM/ODM.

like image 175
Derick Avatar answered Mar 31 '23 20:03

Derick