When it comes to laying out tables in transact SQL databases, like SQL-Server and Sybase, the classic approach to relational modelling is well established. (The authority being Halpin's book)
- Establish your use cases
- Establish your entities
- Determine the attributes of the entities
- Determine the relationship between the entities
- Layout the tables with the joins to satisfy the use cases in the query
- Refactor the tables to nth normal form as required.
(or some variation thereon).
For Cassandra databases - this pattern is slightly modified, in that you have to start with your use cases, and then design for zero joins at query time. (The authority for this approach is the datastax training documentation).
You could say that you leave your tables fully denormalised at the level of the query for your use-case. So the pattern is more similar to:
- Establish your use cases
- Establish your entities
- Determine the attributes of the entities
- Determine the relationship between the entities
- Layout the tables denormalised to satisfy the use cases in the query
Now MongoDb is a document based database with the ability to do joins.
My question is: What is the canonical pattern for database design with MongoDB?