0

I am working on an API that is connected for a store. Now there are bunch of Items and user base and I have different serializable classes that represent this data.

Issue that I am facing is when I am making a GET call and record count is greater than 5K it take forever time to serializable and hence the GET call is timed out. I have worked out a way around this issue by divide the data in chuck of records if its greater in number but I want to solve this issue. Is there any way that my API can respond to GET request and send all the data in one go.

I am having the API created in C#.

Ankit Verma
  • 63
  • 1
  • 10

1 Answers1

0

Without knowing any details beside that your transaction is size critical and written in C# i would recommend thinking about to:

  • use POST instead
  • change timeout value from your web API
  • modify server settings (check GET size limits, timeouts)
  • prefer serializing JSON over XML
  • use multithreading (load a chunk of data needed to populate your views first)
  • leave the idea of transferring all data in one transaction if data amount is/will be an issue. Maybe you can already assume that your database will be growing in future at a certain rate.
  • redesign your client in a more sophisticated way that you can filter your requests to fetch only data which is actually needed (e.g. to accomplish a task or provide more specific information for a less generalized request)

Hope this helps or inspires you...

BionicCode
  • 1
  • 4
  • 28
  • 44
  • Thanks for the response following are my comment to your response, 1) We can't use POST for a GET call. We are trying to follow REST architecture. POST will be for add something in. 2) We have already increased time out but cant increase it more then 5 sec product requirement. 3) That is something that we can have a look. 4) will have to think about using JSON over XML. 5) Yes we are currently following the Chunk approch and divide load around. – Ankit Verma Feb 21 '14 at 06:10