I'm using a Spring Boot Java backend and a Javascript frontend. The backend needs to fetch data from a db and provides it to the frontend.
The latest top hits on google provide me with tutorials which all propose the same: use a Spring REST API backend and provide the data to the frontend as a JSON via http get against your backend.
I don't understand why this is the favored approach. The idea of JSON is to provide a "human-readable text" (Wiki). For what does my backened need that?!
As a result, the JSON generated in my case is nearly 800kb, as all fields and values are human readable. If I change the structure and use placeholder values, the size would shrink to 100kb and my frontend could totally work with that.
But by doing so, I break the whole idea of using JSON as a transfer objects.
So why does this seem to be such a favored approach by the community? Is there something I missed? Do you perhaps know of a better approach or should I just deal with it?