1 · MongoDB · SOLUTION
Embedding or referencing: decision table
QUESTION ABOUT THE DATA
ANSWER
DECISION
Are they read together?
yes
invest
Are they replaced together, in a single procedure?
yes
invest
Is it the "consists of" or "belongs to" relationship?
yes
invest
Are they removed along with the parent?
yes
invest
Is the cardinality on the child side high?
yes
take out
Does the array grow without an upper limit?
yes
take out
Is the daughter living without a parent?
yes
take out
Are they written at different times? Are the posts frequent?
yes
take out
Is it difficult to manage discrepancies between copies?
yes
take out
This is a heuristic.
First, invariants and growth limits; then, reads and writes, indexes, concurrency, and acceptable latency.