Should I process a JSON in the frontend or Backend, which is faster?

Danish Xavier :

I am getting a response from an API as a json response. I am coding in python for backend.

The frontend team needs information from the raw json response for populating a UI so we have to order the json and make it more easier for them to fetch information.

Now I can order the json in a specific format and push to the frontend team or I can pass the raw json response*to the frontend team and let them handle ordering the json and further use for their UI.

Remember my json file size is 15MB.

Which is faster and a better design principle?

Process in the backend then push to frontend or process in the frontend?

Rahul Goyal :

Ideally if the file size is 15 mb it will be loaded to the browsers memory which will make it slow, I would suggest to do the operation in backend only.

You can also go through this link for reference. Difference Between python and Javascript and what to use

  1. One important aspect is that JavaScript is difficult to debug. You might notice that despite your code being error-free, the program won’t work (fail silently).

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=6884&siteId=1