Getting a lot of data from api

I call a Restful api that returns over 100,000 entries. How can I handle this huge amount of data on the client side? I do not want to receive all records at once.

+4
source share
1 answer

If you own an untrusted API, reconfigure it to support paging. And request information in smaller parts using the page number.

If you do not own the API, then create an intermediary server service that works like a cache with paging support. And the client works with this intermediary service, sends requests with a page number and receives smaller parts of the data.


UPDATE

, , , " Black Box".

( : "Mediator servie" ), , , "Black Box Service", .

:

schema

, : http://www.yourserver.com/mediatorservice

API :

pageNumber - recordsPerPage -

:

http://www.yourserver.com/mediatorservice?pageNumber=1&recordsPerPage=25

(pageNumber = 1) 25 (recordsPerPage = 25) .

. : 1 .. 100 000, " " .

.

100 001 ...200 000, ( ). .

, -. , .

java-, , , .

+3

All Articles