Table of contents
Definition
Pagination is the process of presenting large datasets or information in chunks instead of all at once.
Use Cases and Examples
A very good example of this in action is Google search results. If you ever happen to scroll down to the bottom you will find a numbered list that you can click to see more results.
Also, most information displayed in a tabular form will usually be paginated. Additionally, some applications will also provide you with navigation buttons to move through the dataset.
Pagination is also used with APIs [→]. Depending on the purpose of the API, sometimes it will have to return data and this could be a large data set so pagination is applied.
There are different ways to paginate large data sets. In cursor-based pagination, a set number of records are returned and the user can trigger a next function to get the next set of data.
There is also the offset and limit or size based pagination which provides the requester with a more granular way to get data back. With this type of pagination, the requester sets the number of records to return which is the limit or size but also specifies an offset which specifies the number of records to skip before applying the limit or size.
So for example in a data set of A,B,C,D,E,F
a limit or size of 2
and an offset of 3
will get you D,E
Summary
Pagination makes it possible to return a reasonable amount of data at a time to end consumers.
Here is another article you might like 😊 What Is Pixel Tracking?