database design - Query-first approach for MongoDB? -


i'm beginning design brand new mongodb database project surely have lot of concurrent access. i'm choosing mongodb know how scalable , how fast queries be.

i know, however, using mongodb, sake of performance, should try hit database few times possible.

i know apache cassandra, nosql database, advocates "query-first" approach, means should think of queries first, , organize data structures according them.

now, i'm wondering if same principle applies mongodb.

i didn't find related discussion on web far.

for organizing , modeling data in mongo, word want learn , search on denormalization. think of queries first when working mongo. not modeling, indexing well.

a rule heard @ mongo conference how denormalize:

  1. if data static, go ahead , denormalize/embed data in document.
  2. if data changes quite often, make reference document.

i've seen true after year of production mongo work. embedding data changes has caused lot of pain.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -