I read a lot of documents about AppFabric caching but most of them cover simple scenarios. For example adding city list data or shopping card data to the cache. But I need adding product catalog data to the cache.
I have 4 tables:
Product (1 million rows), ProductProperty (25 million rows), Property (100 rows), PropertyOption (300 rows)
- I display paged search results querying with some filters for Product and ProductProperty tables.
- I am creating criteria set over searched result set. For example (4 Items New Product, 34 Items Phone, 26 Items Book etc.)
- I query for grouping over Product table with columns of IsNew, CategoryId, PriceType etc.
and also another query for grouping over ProductProperty table with PropertyId and PropertyOptionId columns to get which property have how many items
Therefore to display search results I make one query for search result and 2 for creating criteria list (with counts)
Search result query took 0,7 second and 2 grouping queryies took 1,5 second in total. When I run load test I reach 7 request per second and %10 dropped by IIS becasue db could not give response.
This is why I want to cache Product and property records.
If I follow items below (in AppFabric);
- Create named cache
- Create region for product catalog data (a table which have 1 million rows and property table which have 25 million rows)
- Tagging item for querying data and grouping.
Can I query with some tags and get 1st or 2nd page of results ? Can I query with some tags and get counts of some grouping results. (displaying filter options with count) And do I have to need 3 servers ? Can I provide a solution with only one appfabric server (And of course I know risk.) Do you know any article or any document explains those scenarios ?
Thanks.
Note:
Some additional test: I added about 30.000 items to the cache and its size is 900 MB. When I run getObjectsInRegion method, it tooks about 2 minutes. "IList> dataList = this.DataCache.GetObjectsInRegion(region).ToList();" The problem is converting to IList. If I use IEnumerable it works very quicly. But How can I get paging or grouping result without converting it to my type ?
Another test:
I tried getting grouping count with 30.000 product item and getting result for grouping took 4 seconds. For example GetObjectByTag("IsNew").Count() and other nearly 50 query like that.