使用AppFabric Cache分页,列出和分组查询 [英] Paging, listing and grouping queries with AppFabric Cache

查看:116
本文介绍了使用AppFabric Cache分页,列出和分组查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



   我阅读了很多关于AppFabric缓存的文档,但大多数文档都涵盖了简单的场景。

   例如,将城市列表数据或购物卡数据添加到缓存中。

   但我需要将产品目录数据添加到缓存中。

Hi,
    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.

   我有4张桌子:

    I have 4 tables:

   产品(100万行),ProductProperty(2500万行),Property(100行),PropertyOption(300行)

    Product (1 million rows), ProductProperty (25 million rows), Property (100 rows), PropertyOption (300 rows)

    - 我显示分页搜索结果,查询Product和ProductProperty表格的一些过滤器。

    - 我正在创建搜索结果集的标准集。例如(4项新产品,34项电话,26项预订等)。
    -I查询使用IsNew,CategoryId,PriceType等列对Product表进行分组。 


   还有另一个查询,用于通过PropertyId和PropertyOptionId列对ProductProperty表进行分组,以获取具有多少项的属性 


   因此,为了显示搜索结果,我对搜索结果进行了一次查询,对于创建条件列表进行了2次查询(有计数)

   搜索结果查询占用了0.7秒,2个分组查询总共耗费了1.5秒。

   当我运行负载测试时,我每秒达到7个请求,并且由于数据库无法给出响应,因此%10掉线了。

    -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.

   如果我按照以下项目(在AppFabric中);
$
    - 创建命名缓存

    - 创建产品目录数据的区域(包含100万行的表和属性表,其中包含2500万行)

    - 用于查询数据和分组的标记项。

   我可以查询一些标签并获得第1页或第2页结果吗?

   我可以查询一些标签并获取一些分组结果的计数。 (显示带计数的过滤器选项)

   我需要3台服务器吗?我可以提供只有一个appfabric服务器的解决方案(当然我知道风险。)

   您是否知道任何文章或任何文件解释了这些情况?

    

   谢谢。

   

   注意:

    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:

   一些额外的测试:

   我在缓存中添加了大约30,000个项目,其大小为900 MB。

   当我运行getObjectsInRegion方法时,花了大约2分钟。 "IList< KeyValuePair< string,object>> dataList = this.DataCache.GetObjectsInRegion(region).ToList();" b $ b   问题是转换为IList。如果我使用IEnumerable它非常有效。但是如何在不将其转换为我的类型的情况下获得分页或分组结果?

    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<KeyValuePair<string, object>> 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:

   我尝试使用30.000产品项目进行分组计数,获得分组结果需要4秒。例如GetObjectByTag("IsNew")。Count()和其他近50个查询。

    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.

推荐答案

我可以开始认为AppFabric不适用于缓存大结果集?
May I start thinking AppFabric is not for cache large result set ?


这篇关于使用AppFabric Cache分页,列出和分组查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆