Pagination or no pagination
Hi i cant decide to whether implementing pagination or not.
I understands that pagination serves the client a subset of data to offload the computing of the backend. While this is great when x amount of client are request data from a table. The problem lies when they need to do the filtering, the filtering only happens on the subset instead of on the whole table. So if the table consist of 1000 records and the subset is 10, filtering only happens on the 10 records. Do i have to implement a call to the backend for each every filtering that being applied? does this just lead to more database calls? So what is best serving the client a bigger set of data so the filtering can happens client-side or do the filtering on the backend side and ends up with more calls to the backend Thanks in advance
I understands that pagination serves the client a subset of data to offload the computing of the backend. While this is great when x amount of client are request data from a table. The problem lies when they need to do the filtering, the filtering only happens on the subset instead of on the whole table. So if the table consist of 1000 records and the subset is 10, filtering only happens on the 10 records. Do i have to implement a call to the backend for each every filtering that being applied? does this just lead to more database calls? So what is best serving the client a bigger set of data so the filtering can happens client-side or do the filtering on the backend side and ends up with more calls to the backend Thanks in advance
8 Replies
filtering, sorting, and pagination should all be done on the backend
that's
WHERE
, ORDER BY
, and OFFSET/LIMIT
, respectively
1:1 with your databaseWouldnt that increase the cost of the usage of database?
not really
Well, there's no other way, really
databases are built to do those things
and yeah, what's the alternative
Filtering and sorting must be done on the whole table
Either you do it database-side, or you load everything into the client
The former is preferable
this. sure, it's marginally more computation on the database, but it's way less bandwidth being used between the database, backend, and client
aight then i guess paginations it is then , and then implement database filtering on each properties
And thank you guys for sparring with me