的SqlCacheDependency和AppFabric的服务器 [英] SQLCacheDependency and AppFabric Server

查看:219
本文介绍了的SqlCacheDependency和AppFabric的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个情况我需要一个新的来取代我们目前基于文件缓存依赖系统。我所看到的是倾向于使用AppFabric的缓存。我在想,如果所在的表通知数据更新的应用SQLDependencyCaching技术与工程的AppFabric因为它具有内置缓存ASP.NET呢?

I have a situation where I need to replace our current file based cache dependency system with a new one. What I am looking at is moving towards using AppFabric for caching. I was wondering if the SQLDependencyCaching technique where the table notifies the application of data updates works with AppFabric as it does with ASP.NET built in caching?

推荐答案

有AppFabric缓存内没有支持,为的SqlCacheDependency机制(或实际上任何种类的依赖)。

There is no support within AppFabric caching for the SqlCacheDependency mechanism (or in fact for any kind of dependency).

然而,AppFabric的1.1介绍DataCacheStoreProvider类,它可以用来确保缓存总是同步与底层数据库。从本质上讲,你创建一个从DataCacheStoreProvider继承的类,并创建告诉它如何读取和更新数据库它的方法。然后,你做你的所有的数据访问 - 添加对象,更新现有对象等 - 对高速缓存,所以缓存始终拥有最新版本的数据。那么缓存调用您提供一流的更新数据库,坚持更改。还有用于创建提供程序类 rel=\"nofollow\">的演练。

However, AppFabric 1.1 introduces the DataCacheStoreProvider class, which can be used to ensure that the cache is always in sync with the underlying database. In essence, you create a class that inherits from DataCacheStoreProvider and create methods on it which tell it how to read from and update your database. Then you do all your data access - adding objects, updating existing object etc - against the cache, so the cache always has the latest version of the data. The cache then calls your provider class to update the database and persist your changes. There's a walkthrough for creating a provider class here.

这篇关于的SqlCacheDependency和AppFabric的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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