sorry, but does this make sense? the ORM means: Object Relational Mapper, and here, there is Relational, and NoSql is not RDBMS! so why the use of an ORM in a NoSql solution? because i see updates of ORMs for Python!
-
because 1- it's the lonly language i know 2- because the orm is made for a specific language?! – Abdelouahab Nov 08 '11 at 14:12
3 Answers
Firstly, they are not ORM (since they don't have any relations among them), they are ODM (Object Document Mapper)
Main usage of these ODM frameworks here same as the some common feature of ORM, thus
- providing the abstraction over your data model. you can have your data modelled in your application irrespective of the target software.
- Most ODM's build to leverage the existing language features and use the familiar pattern to manipulate data instead to learn new language syntax's of the new software.
When i use mongoid (Ruby ODM for mongo), i can query mongo the way i do it in active model (mostly).
Since they don't have the relation among them, these ODM's provide the way to define the relations in your models and simulate the relationships. These are all abstracted from the developer so they can code the same way they do with the relational data.

- 64,778
- 30
- 169
- 213
-
but about the second point: "Most ODM's build to leverage the existing language features and use the familiar pattern to manipulate data instead to learn new language syntax's of the new software." it is the job of the Driver no? – Abdelouahab Nov 08 '11 at 14:25
-
1No, drivers just provide a backbone to call the underlying engine to access the data. Java driver to the mysql and hibernate ORM are totally different right? same way its different in Non sql too..Mongoid ODM uses Ruby mongodb driver to talk to mongodb.. – RameshVel Nov 08 '11 at 14:31
-
am confused here, because the driver uses the same language and can do the MongoDB stuff in the language's way (pymongo will use python's insctruction to use the database, for example the Dictionnary) – Abdelouahab Nov 08 '11 at 14:37
-
2there is nothing to get confused here, you can still use driver to access the data, there is no problem with that. Assume in a relational word before the ORM drivers, we use legacy drivers (in any language) to access the data from the databases by passing the string query(its a sql synatx). Same way when you are using driver you have to pass mongodb queries as string input to your drivers. But when you use ODM, its all taken care for you – RameshVel Nov 08 '11 at 14:41
-
1so now i'll start with MiniMongo http://slacy.com/blog/2011/01/announcing-availability-of-minimongo-a-micro-orm-for-mongodb-in-python/ – Abdelouahab Nov 08 '11 at 14:44
Interesting question. Although NoSQL databases do not have a mechanism to identify relationships, it does not mean that there are no logical relationships between the data that you are storing. Most of the time, you are handling & enforcing those relationships in code manually if you're using a NoSQL database.
Hence, I feel that ORMs can still help you here. If you do have data that is related, but need to use a NoSQL database, an ORM can still help you in maintaining clean data.
For Example, I use Amazon SimpleDB for the lower cost, but my data still has relationships, which need to be maintained. Currently, I'm doing that manually. Maybe an ORM would help me as well.

- 3,708
- 5
- 29
- 48
-
so that's used for inheritance? but if the NoSql solution has the tool to identify relations, will it be useful to use the ORM? – Abdelouahab Nov 08 '11 at 14:19
ORM is an abstraction layer. Switching to a different engine is much easier when the queries are abstracted away, and hidden behind a common interface (it doesn't always work that well in practice, but it's still easier than without).

- 125,936
- 27
- 200
- 224