Hi, let me explain the scenario first.
Say, I have a DB with -
a) 10,000 Records
b) 20 Records/page (pagination)
c) 100 attributes for each Record
Now I need to call an API for getting the Records as pagination. On button click, I also need to see details of any product. Now what is the best approach of the two below?
Approach 1: Call an API for getting the Records as pagination. While calling the API, send all 100 attributes for each Record. Now on button click, show the details of any Record (No new API will be called for details view)
Approach 2: Call an API for getting the Records as pagination. While calling the API, send only the required attributes (maybe 4/5 attributes) for each Record. Now on button click, call a new API and show the details of any Record (with 100 attributes)
Please let me know the best approach of the two. Any other better solution is also appreciable. Thanks in advance.
I think the approach 2 is better because it's good for the UX because user can get the required attributes to work on, So they don't have to wait the unnecessary attributes to do their job. and the same reason for network traffic.