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?
As others have noted, there are quite a few good reasons to prefer processing on the back end:
One other big advantage to processing the API response on the back-end is that you can choose the structure you send to the front end. That way, if the API you are consuming changes over time (or you change which service you're using to retrieve data) you can handle that change on the back end without it ever affecting the front-end code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With