HighTechTalks DotNet Forums  

Question/Advice on updating Cache

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss Question/Advice on updating Cache in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Keith F.
 
Posts: n/a

Default Question/Advice on updating Cache - 01-20-2005 , 06:05 PM






Hi,
I'm trying to implement caching for an ASP.NET web app, to reduce calls to
our backend database (sql server). The object I want to cache is a simple
data table.
The tricky part is that throughout the day, I need to be able to update
individual records. The updates are infrequent. Each record will probably be
updated once sometime during the day. But this table will be read thousands
of times. So caching will save thousands of database calls.

I've read about using the ReaderWriterLock class at the following site:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

I've experimented with creating a custom class, I'll call it the
CacheManager, that will be the "gate-keeper" for my data table cache object
and use the ReaderWriterLock class to make sure only one update happens at a
time.
In order for this to work, I've found that I have to Cache an instance of my
CacheManager, and all requests to read or update the data table cache object,
go through that instance of CacheManager.

In some basic testing using multiple browser sessions, this approach seems
to work. But I want to make sure this will work with a hundred or more users.

Does this seem like the right approach, or is there a better approach to
accomplish this?

I would appreciate any suggestions/advice that you might have.

Thanks,
Keith F


Reply With Quote
  #2  
Old   
Geir Aamodt
 
Posts: n/a

Default Re: Question/Advice on updating Cache - 02-21-2005 , 12:41 PM






Keith,

have you been looking at or using the ASP.NET Cache object?

This Caching functionality provides you with all the functionality you need.

Look here:
http://msdn.microsoft.com/library/en...ncacheapis.asp
for more details about the Cache object.

To try to answer your questions without any knowledge about your
solution/code/design etc.
is impossible, but the logic of using an CacheManager as front-end and then
utilize the ASP.NET
Cache object as back-end, is a very good idea I have used in several
projects.

--

Best regards,
Geir Aamodt
geir.aamodt(AT)bekk.no


"Keith F." <KeithF (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,
I'm trying to implement caching for an ASP.NET web app, to reduce calls to
our backend database (sql server). The object I want to cache is a simple
data table.
The tricky part is that throughout the day, I need to be able to update
individual records. The updates are infrequent. Each record will probably
be
updated once sometime during the day. But this table will be read
thousands
of times. So caching will save thousands of database calls.

I've read about using the ReaderWriterLock class at the following site:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

I've experimented with creating a custom class, I'll call it the
CacheManager, that will be the "gate-keeper" for my data table cache
object
and use the ReaderWriterLock class to make sure only one update happens at
a
time.
In order for this to work, I've found that I have to Cache an instance of
my
CacheManager, and all requests to read or update the data table cache
object,
go through that instance of CacheManager.

In some basic testing using multiple browser sessions, this approach seems
to work. But I want to make sure this will work with a hundred or more
users.

Does this seem like the right approach, or is there a better approach to
accomplish this?

I would appreciate any suggestions/advice that you might have.

Thanks,
Keith F




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.