Schema Design in MongoDB

27 views
Skip to first unread message

Ronnie

unread,
Apr 19, 2012, 1:09:56 AM4/19/12
to mongodb-user
Hi,

I am moving from RDBMS to MongoDb.

I understand that MongoDB is schemaless like any other Nosql store.
But I am dilemma of creating collections and designing.

Suppose initially I had 8 - 10 tables in the RDBMS (which included a
lot of mapping tables).

Now I am trying to create collections and populate documents as
required keeping in mind the mapping option , for future query use.

Is it the right way?

Could any one suggest on this, how to design the collections so that
future querying is very easy.

And one more thing , if I am wright Mongo db does not support join
like other Nosql stores.

Can I query from 2 different collections ?



Thanks and Regards,

Ronnie.

Andreas Jung

unread,
Apr 19, 2012, 1:26:22 AM4/19/12
to mongod...@googlegroups.com
http://www.mongodb.org/display/DOCS/Schema+Design

There are also various slides and videos available.
Google "MongoDB schema design"

The question is too broad and generic (and answered
a trillion times).

And no: you can query only one collection at a time - NO JOINS.

-aj

--
ZOPYX Limited | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope & Plone
D-72070 T�bingen | Produce & Publish
www.zopyx.com | www.produce-and-publish.com
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


Sam Millman

unread,
Apr 19, 2012, 3:24:24 AM4/19/12
to mongod...@googlegroups.com
To add to Andreas:


"
Suppose initially I had 8 - 10 tables in the RDBMS (which included a
lot of mapping tables).

Now I am trying to create collections and populate documents as
required keeping in mind the mapping option , for future query use."

Like in an RDBMS creating "views" or "mappings" in the DB side is not good for future proof querying. I would recommend you use either a mapping layer in Java (many exist for mongo, I think Morphia even has one) or you make your own in Java, either way future proof querying is always easier from client side than server side.

D-72070 Tübingen        | Produce & Publish

www.zopyx.com           | www.produce-and-publish.com
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Reply all
Reply to author
Forward
0 new messages