There are three participants: Client, Server, Database.
First scenario
- Client makes a
GET /productsrequest to the Server - Server verifies whether Client is authorized to make this request
- Server confirms Client is authorized and makes a request to the Database to fetch all products
- Database returns 100 products to the Server, along with a pagination token to retrieve 100 more tiems
- Create a loop between Server and Database, where Server fetches 100 more products with the pagination token provided by Database until there are no more products to be fetched
- Server returns response to the Client
