Paginating the data while loading from a database or from an API
Pros : Reduces the Database maintainence and pricing of the database
Imagine you are having an app which is having about 100K+ downloads and 10K+ daily users everyday and users perform read operations in order to load data. when an app having 10K+ daily users will perform 100K+ to 1Million reads per day and it again deponds on how optimally you have developed the app.
So, in order to reduce the database maintainence, Developers can use pagination in your app which reduces the reads and loading the amount of data which is required for the user.
So, Enough intro, let's start coding
In this context we are not actually loading the data from database or API, So we actually performed a pagination example considering numbers as a data elements from a server or API