Processing large datasets in web api & odata

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?

+5
source share
4 answers

This is a question that can lead to a wide range of answers. However, let me put on my pre-MSFT hat and give you two cents.

: " ". . , , . , ACID, , .

, :

  • ?
  • ?
  • ? (100k , , , 100k- , , , , SQL Server, , .)
  • : ? , - ? (, , - , , / .)

( , ), , . . AppFabric , Microsoft, .

+2

, Entity Framework, IQueryable EF. , OData . $limit $take SQL-.

+1

- , . , , AppFabric, . . NCache, .

NCache Appfabric, youtube , FYI....

http://www.youtube.com/watch?v=3CPi1QlskrU

0

The caching that I pointed out on the blog http://byterot.blogspot.ie/2012/06/aspnet-web-api-caching-handler.html refers to HTTP caching , also known as output caching. In fact, the data itself is not cached on the server, but on the client or server cache of the average flow, so it is not suitable for what you mean.

0
source

All Articles