Effectively using Caching#

Since this has come up twice in the past couple weeks I figure there has to be more people out the wondering what are some scenarios they should be using the Enterprise Library Caching Block.  The EntLib caching block provides an easy way to create, manage and invalidate a cache. 

How many caches does one need?  This depends on your scenario.  For just a server application you most likely only need one.  What if there is a client that talks to the server?  You may think it is good enough to cache only on the server but given how easy it is to create and manage a cache with Entlib I would suggest also having a cache on the client.  This will most likely create two caches talking to each other via whatever interface you choose.

The above setup works just as well for inter application caching, say a messaging layer talking to an application layer.  The application layer is the gate keeper to the database which is where lookup codes are stored.  The messaging layer needs the lookup codes to map different codes between systems.  So in this scenario the application layer will have a cache which is surfaced via WCF and the Messaging layer will have a cache which retrieves the lookups via WCF from the cache on the application layer.  With this setup both layers get the advantage of using a cache and limits the amount of database hits for a fast massaging setup.

Thursday, March 29, 2007 2:10:53 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview
All content © 2009, John Luif