|
|
|
|
|
by metamemetics
5672 days ago
|
|
I am investigating replacing MySQL with MongoDB in my model layer for my next prototype. My mind is still thinking in 3NF though. I understand dernormalization and avoiding joins will be useful from a performance standpoint. However I am unsure when to either go ahead and include a foreign key, retrieve it and perform a second query from the application layer, and when to go ahead and duplicate\embed all the field data. I'm leaning towards just making 2 simple sequential key lookup queries, the 2nd on the retrieved foreign key, rather than duplicating fields everywhere and keeping track of massively cascading changes. Instead of performing 1 MySQL Join. Although I usually think in terms of minimizing roundtrips to the database server. Wondering if anyone has a heuristic for this or suggested reading? |
|
Outside of this, you need to switch the question you ask from "what data do I need to capture?" to "what questions do I need to answer?"