Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning large data set for a REST GET call  RSS feed

 
Karthick Dharani Vidhya
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the preferred approach when we have to return a huge amount of data for a REST GET call. Let's say we have 30K JSON objects to be sent (after narrowing down the GET as much as possible), can we do a streaming concept.

a. Can we return multiple chunks of data as and when it's ready. Let's say 3K first and next 3K when that's ready and so on till 30K. Not sure if the service can have a handle to the caller and keep sending multiple data.

b. Service can send 3K and also send a index may be a id like 1556. So that client can call again by passing the index as 1556, this time service can send next 3K starting from 1556 id and return the index as 1856 and it goes on till client gets all 30K.

Please let me know if the above is not clear.
 
Santhosh Muralidharan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Requesting large amount of data for REST service during peak load will always lead to strain on the server.The best option, i think, would be to fetch the data based on managable threshold value to limit the data returned and calling multiple calls would be fine.
 
Karthick Dharani Vidhya
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Even I think that is a better option
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!