1
I am making an application in nodejs, where constantly it is necessary to consult information in the database, for example: name, description of items and etc... A similar site would be Netflix, which queries such information each time the user hovers in a movie/series.
But I would like to know, if it is better to make a request to the database each time the user passes the mouse, or when loading the site, save the entire database in a Sesssion and call such data when the user passes the mouse, in case I would be using socket.io to speed up the response, but I do not know if such a practice requires much of the server. Then the question remains:
- Make a single select in the database or store everything in a Session?
or
- Send various requests each time needed (almost always)?
I will try to create something in between, or at least load as little data as possible when starting without having to make so many requests.
– Leo Letto