Is server side pagination where the pagination script calculates the number of entries in a database then make the links? All I know is server side is faster and better if there is alot of data and client side is using javascript?
What makes a pagination script server or client side?
Also, right now I am planning to use this pagination which is like digg-style. Can someone tell me if that is server-side pagination? (sorry if my terminology is off)
Client-side pagination is for a small amount of data and is primarily for presentation purposes. Server side pagination handles large amount data, and provides stability and scalability.
Operations and Engineering Dashboards supports server side pagination grid. Server side pagination is considered useful for large-sets of data as the amount of data that is transferred to the client is much smaller than the data handled by the client.
Client Side Pagination means that when a query is made, the server returns to the client all the data in one big chunk. Client Side Pagination is more like going to a restaurant and ordering one of everything on the menu. The time it takes the kitchen to produce all that food is going to be significantly longer.
Client-side means that the processing takes place on the user's computer. It requires browsers to run the scripts on the client machine without involving any processing on the server. Server-side means that the processing takes place on a web server.
Server side pagination:
The server takes a number of parameters from the user (current page #, ordering, etc) and performs whatever search required to get just the relevant records. These are sent to the client, along with links to more pages, etc.
Each time the user clicks a link, you get a page refresh showing the new data.
Useful when:
Not so great because:
Client side pagination:
The server sends all available records to the client, and using Javascript, these results are split into pages and rendered client-side. Changing pages or item ordering is as good as instant, and requires no server interaction. This makes it much easier to cache the results on the server side.
Useful when:
Not so great because:
A Blended approach
Write your application to fully use server-side pagination. Once that is working, use javascript to intercept all links which change the page or the ordering, and send those requests via AJAX. Adapt your server-side script to return just the HTML necessary for any given page, and none of the page chrome around it when it is responding to an AJAX request.
Benefits:
Client side is when you pull all the data down and then the client segments the data into pages.
Server-side is usually done by the client providing a key that is passed to the server and then the server only selects out that "page" of data. For example if you were displaying people by last name, the first page might be created by telling the server that you want people with the last name of 'A' and that you want 10 rows returned.
The server would do something like:
SELECT ssn, fname, lname
FROM people
WHERE lname like 'a%' and rownum <= 10 ORDER BY lname, ssn;
If the last/10th record has a last name of 'abbot' with an SSN of 555555555, then the next page could be retrieved by the client passing those values back to the server which would then do something such as:
SELECT ssn, fname, lname
FROM people
WHERE lname >= 'abbot' and ssn > 555555555 and rownum <= 10 ORDER BY lname, ssn;
Server-side is considered better for large-sets of data as the amount of data transferred to the client is far smaller than if all the data is pulled down and "paged" by the client. It also lowers the memory required for the client side as well as taking advantage of the strong capabilities of databases to sort data or use existing sorted indexes to speed selection.
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