In the client-side and server-side separation architecture, it is common to doubt who is responsible for doing some processing.
On the one hand, processing on the client-side can be beneficial to server-side performance, which will deliver the resource to be consumed, formatted and perhaps rendered on the front end.
On the other hand, the server-side. Placing server-side processing has the advantage of scaling and relying on features managed by the organization itself.
Contextualizing in REST
At the beginning of the REST architecture, the backend is responsible for delivering the resource, for example:
GET vnb.rs/api/produtos/1
{
"nome": "Caneca",
"variações": [
{
"cor": "azul",
"preço": 15.00
},
{
"cor": "vermelha",
"preço": 18.00
}
]
}
If I needed the minimum and maximum value of the variations (from 15.00 to 18.00 reais) of this mug, would it be the front-end or the back-end?
What defines what kind of data can be processed on the client side?