I am making an API call from the client (Angular v10) to server-side (NodeJs v12). This API call performs calculations on a very large set of data that takes up around 7-10 min to get completed.
The objective here is to somehow reduce response time to make it efficient and return response faster to clients. The calculation algorithm does contain lots of for loops which consume most of the time.
Some of the alternatives I have are -
Is there any other approaches/technology that i should look upon in advance to avoid performance concerns later?
It's not so easy to give you an advice, because to do that I should have some more specific information about the implementation. So below i'm going to list some tips related to the information that you gave and some more topics that you could study more deeply to achieve your goal.
for loops are computationally expensive, so you should have the to reduce if possible some of this. One good approach could be treat the information by query (what database are you using?)
Do you have a monolithic API? Maybe you could split it in micro services take a look at that
AWS lambda is a good ideia, but for me you are not resolving your problem using that.
If you are facing problem retrieving a massing bunch of data, may be you could consider use a memory database as Redis to make cache follow this link
You also have the possibility to apply an old fashioning way to improve your calculus using memoization take a look at that