Sitemap

Member-only story

Previous page data refresh | System Design | iOS

2 min readJun 15, 2023

--

Press enter or click to view image in full size

The problem statement is as follows:

Consider scrolling to the fifth page, and we see that the first page’s data has been updated in server. What should we do about it?

Functional requirements:-
- Refresh paginated data

Non-functional requirements:-
- Battery optimization
- Smooth transition
- Network load

Refresh paginated data

We can use the 6 techniques to refresh our first page

  • When calling 3rd page API, just call 1st & 2nd page api’s in parallel. This is the most destructive thing we can do, calling every previous page API’s on the next page. Both the server and the frontend will suffer the worst performance impact.
  • The server should keep track of feed data for each user. The user will be notified if any feed data has been updated. Here the challenge is the server needs to keep track of user feed data, which will overload the server. The server needs to notify the end user, and the API must be called.
  • With each API call, the client sends the previous feedID’s/commentID’s and timestamp along with the next page request. This allows the server…

--

--

Shrawan K Sharma
Shrawan K Sharma

Written by Shrawan K Sharma

iOS App Developer - Frontend(ReactJS)