Answer the question
In order to leave comments, you need to log in
Which database model will be more efficient in terms of performance?
Good day, I have a Post model that has an author field .
So, what will be faster and more correct to use?
Answer the question
In order to leave comments, you need to log in
The first option doesn't work at all. See docs.mongodb.org/master/MongoDB-data-models-guide.pdf
You can also consider a ("hardcore") option (may be suitable for some cases):
We store the author's identifier in the post, sends the post to the client as is, and on the client we substitute the author from the cache, if not in the cache, then load it from the server.
As they said above, it's too early to optimize, so for starters, I would take option 2.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question