V
V
v1t3man2020-09-18 22:54:59
Data processing
v1t3man, 2020-09-18 22:54:59

What is the best way to implement statistics output?

There is a table with various query data that is made once an hour.
I want to plot this data on a date chart with the ability to change the time period (day, month, year).
At the moment, it is implemented as getting raw data from the database, via ajax, and already on the client, the data is summarized by the required period on js.

At the moment there is not much data, about 1500-2000 positions, all this works locally on the docker, but the request takes a long time, and the number of positions will only increase.

Therefore, the question arose whether it would be better to shift data preparation to the server and receive only the required number of elements for a given period, but then when changing the time period, you will have to make a request each time with the necessary indication of the desired time period, and then switching the time period on the client can slow down.
Or, as an option, on the server prepare data for the largest period at once, and on the client only display the desired period.
Or leave as is.

Which option is better to implement?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question