I have been working with asp.net web api in recent weeks with great success. It really helped me create an interface for mobile clients for programming compared to http.
I got to the place where I need help.
I have a new endpoint that will have a database and can return 100K results. I use OData to filter data and return a paginated dataset.
How can this happen for mutliple requests, I'm interested in performance. Returning 100K records from the database each time is not ideal. So I have some ideas.
First, you need to cache 100K results, and each time OData does its magic. I work with AppFabric distributed cache as a load-balanced environment. However, caching so much data in AppFabric can lead to memory complications, so think that I better avoid this.
The next option is to forget about the magic of OData and send the filters that I use to the database, and each time return only the necessary data. So, in other words, hit db every time.
I could see how to use a caching handler, such as the version described in this article, to cache in cache http → http://byterot.blogspot.ie/2012/06/aspnet-web-api-caching-handler.html . The disadvantage of this is that the data gets updated through another system, which may, the cached data did not expire.
Any other tips on how I can handle this scenario, a large amount of data filtered with odata combined with a web api?
source
share