I have a table with transactions in my DB, here is an example.
# id, user_id, type, eur_amount, usd_amount, convert_currency, convert_currency_amount, eur_exchange_rate, usd_exchange_rate, payment_source, table_source, table_source_id, package_id, package_name, deleted, date_elem, date_added, date_modified
2, 1803, membership, 60.19, 59.82, EUR, 60.19, 1.000000, 0.993912, website, users_transactions, 2, 103, 1 Monat, 0, 2022-08-22, 2022-08-22 13:03:50, 2022-11-07 11:43:25
The user can use a filter to get the amount of payments by day.
For example he can request the data between two dates.
On the server I can just select all the data between two dates and return the object array to the frontend. The frontend then has to loop over the objects and create the analyics by adding the eur_amount into one total value for each day.
I could also do all the work on the server with a groupBy etc., so the frontend does not have to do any calculations.
What is the better practise? What has better performance?