A recursive algorithm. On which side it is better to implement?

Task:
Select data recursively from the external resource and to present them in a more convenient way.

Question:
What to do? To do it on a slender server when the number of queries to the resource may be up to 4000 (respectively long time), or implement it on the client side, using js libraries?
October 8th 19 at 03:10
3 answers
October 8th 19 at 03:12
Choose the server and cache.
at the moment on the server side and implemented so far, however, without caching, but it is in the plans. - Haven commented on October 8th 19 at 03:15
but if it is necessary for the client? - Haven commented on October 8th 19 at 03:18
idea!!! will do so:
On the client side before running is checked, the availability of data in the cache if they are not, but the search is performed on the client side, the completion and Assembly of all data, they are sent to the server in the cache. The data in the cache will be stored for an hour, this will ensure the relevance of data and performance of big Colva requests within the hour. - Haven commented on October 8th 19 at 03:21
You cannot trust the data received from the client. You Takashimaya some nonsense or intentionally changed the content and will give it to other customers. It is not safe. - Kayley_Legros46 commented on October 8th 19 at 03:24
yeah there is salt in your words! - Haven commented on October 8th 19 at 03:27
October 8th 19 at 03:14
I am for the implementation on the server. Only me, "recursive algorithm" is confusing. Better through the line.
— frontend (communicates with the client, if necessary, informs about the progress through SSE/WS)
— queue (tasks, sharing of goals)
— backend (parallel work)
— storage (for storage of results + report)
well and caching, of course.
very interesting! It will be necessary to think in this direction. Thank you. - Haven commented on October 8th 19 at 03:17
October 8th 19 at 03:16
If the data is not large, it is easier and more convenient to do everything on the client (à La carte to build in a tree view, a small data to show) But if the data for the recursion is large, it really will be easier once work on them and cache the result.

Find more questions by tags PHPClient-serverRecursionJavaScript