Answer the question
In order to leave comments, you need to log in
How to get rid of the extra request? Is it worth leaving it?
Hello dear friends. During development, a small issue arose. In general, the site displays some information from the database in a tabular view without refreshing the page:
For example:
Name ---- Coefficient ---- Number 1 ----- Number 2 ----- Number 3
Something -- --------------1.2----------2-----------4.1----------- 5.3
Something 2 ---------------0.7 ---------- 1.3 ----------- 3.2 ------ ------ 1.2
Roughly speaking, this is how the data is displayed, the list can be long.
Coef. - this is an input, when changing which the initial data of this "something" is taken from the database, divided by the initial coefficient. and multiplied by this data from the input (new coefficient). Yes, everything is fine, everything works, in theory it suits me. Those. The functionality is executed, everything is as I intended. Initially, I wanted to do without a query to the database, I kept the previous value, but it did not work correctly, and when the coefficient. you set it to empty or 0, everything is lost and does not change at all, i.e. all wrong. So. Is it right to leave the current version? Where to look to build on this initial value without accessing the database, provided that there can be many such rows with data and coefficients. can be changed by the user frequently in one view? There are not many requests.
Answer the question
In order to leave comments, you need to log in
Let's put it this way, if you have only one person working with the database through your application, then you can get rid of unnecessary requests to the database by saving the data during the initial connection, and then simply process them if necessary.
If several people work with the database at the same time, and with the same data, then I don’t see another way out, leave it as it is, especially if it’s not social. network with millions of users, then the load on the database will not be large.
Your whole system of frequent calls only additionally slows down users when working with your application, but does not slow down the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question