ravendb - Basic NoSQL document design question -


i trying figure out how best implement system...and head out of rdbms space now...

a part of current db has 3 tables: show, showentry, , entry. showentry many-to-many joining table between show , entry. in rdbms thinking it's quite logical since changes show details can done in 1 place, , same entry.

what's best way reflect in document-based storage? i'm sure there no 1 way of doing can't think if document-based storage appropriate case @ all.

fyi, considering implementing ravendb. while discussions on general nosql design more ravendb focused 1 fantastic!

thanks, d.

when modelling many-to-many relationship in document database, store collection of foreign keys in 1 of documents. document choose largely depends on direction intend traverse relationship. traversing 1 way trivial, traversing other way requires index.

take shopping basket example. it's more important know items in particular basket baskets contain particular item. since we're following relationship in basket-to-item direction, makes more sense store item ids in basket store basket ids in item.

you can still traverse relationship in opposite direction (e.g. find baskets containing particular item) using index, index updated in background won't 100% accurate. (you can wait index become accurate waitfornonstaleresults, delay show in ui.)

if require immediate 100% accuracy in both directions, can store foreign keys in both documents, application have update 2 documents whenever relationship created or destroyed.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -