For example I have 3 tables and on frontend I need to show table with Users, their Positions and Departments.
I have the following tables in Database and can get it via REST API:
Users id, name, position_id (foreign key), department_id (foreign key)
Positions id, name
Department id, name
Is it better to join data to show in Users instead of position_id position name on Front-End during table generation or on Backend? What is the good practice?
I have Backend on PHP Laravel and Frontend on Vue.
Thank you very much in advance
In the backend of course, because of two important reasons:
you can write a query to fetch and combine the only needed data from those databases or provide GraphQL API in the backend.
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