0

I use Axios to get a response from an endpoint and then I input that response into a variable in the form of an object. The response I get from the server has more than 10000 data.

My question is :

  1. How to process the data so it doesn't take up memory and can insert it into a table?
  2. Is there a request handler that can process that response better?
  3. Or is there a method to partially download the response so that it can be partially consumed by the user from the frontend?
3
  • It's 10000 columns or 10000 rows? If it's columns maybe narrow down the columns to only the ones you need initially, and then get the others when they're needed. If it's rows, maybe use pagination Commented May 18, 2022 at 4:37
  • @yainspan Oh yes, sorry it's a row Commented May 18, 2022 at 4:39
  • Change the endpoint so you can get smaller batches of data at a time. Or, show us exactly what the data looks like as it comes in so we can offer ideas on whether it can be streamed and processed as it comes in rather than collecting it all before processing any. Commented May 18, 2022 at 4:56

1 Answer 1

1

There are many things to look at here:

  1. Every site has a memory limit ( Assigned by the browsers ) and the site crashes if the memory exceeds.
  2. The short and ugly fix would be... taking all those and storing only some part of it (Ugly fix).
  3. The right and correct fix would be making a kind of pagination and limiting the number of data per request. in this case, You'll have proper data and a good user experience with the help of Tabs/pages with limited scroll. And most important, the site's memory will be optimized.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.