Application or cache

  • Thread starter Thread starter stefano mostarda
  • Start date Start date
S

stefano mostarda

Hi there,

In my application I need a dataset containing tables often used in pages.
They must be always available so I though Application would likely be the
best place to store the dataset. But what about Cache?. Would it be better
to load the dataset in cache and reload it when it expires?.

Thanks in advance,
Stefano Mostarda MCP
Rome Italy
 
The Application Cache is the best way to go. The Application Collection is
still available, but is not thread-safe, and lacks the additional
functionality of the Cache.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
When you store in Application, you are essentially storing in cache,
although you are setting an extremely long lifetime, in most instances. You
can set up a mechanism to refresh this DataSet routinely.

Cache is a bit more flexible, however, as you have a bit more granularity on
lifespan of the DataSet, which is nice. I would recommend this over
application in instances where the data can change. NOTE: This is not real
time, but it is closer.

Using Notification Services in SQL Server, you can keep cache up to date,
but you will have to code this. This gives you a closer to real time DataSet
cache. With Yukon (out next year), you will have further options.

Take a look at the free Caching Application Block, which is rather nice:

http://www.microsoft.com/downloads/...C9-94C8-4077-AA29-AFE4074746DE&displaylang=en

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
Back
Top