SQLCacheDependency and AppFabric Server
Asked Answered
V

3

8

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?

Versed answered 15/2, 2012 at 17:30 Comment(1)
Chekout linkVoltage
O
4

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

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.

Omaomaha answered 15/2, 2012 at 18:4 Comment(0)
N
1

though its not supported within appfabric, but supported within NCache. NCache has a Cache Dependency feature that lets you manage relational data with 1-1, 1-n, and m-n relationships among data elements. Cache Dependency allows you to preserve data integrity in the cache.

Norby answered 4/7, 2012 at 10:50 Comment(0)
J
0

There is a Windows Azure Output Cache provider it works somewhat differently to the SqlDependencyCache however it does have good performance and other benefits.

You could also write a custom output cache provider and leverage the Azure Cache notifications to trigger the update depending on your requirements.

MSDN: Building and Using Custom OutputCache Providers in ASP.NET

Jalopy answered 15/2, 2012 at 17:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.