Last post Mar 29, 2013 06:37 AM by Kelmen
Mar 15, 2013 12:19 PM|Novice Kid|LINK
I have been researching on the topic of caching in enterprise applications. Every document I have been looking has been suggesting that caching should be implemented at all layers. That is a good practice which can speed up application performance.
But the problem Gurus, is that I am not really getting a hold on how exactly to implement it. I understand that third party frameworks such as Spring.NET, Castle Windsor, as well as MS Caching Application Block all can help in implementing caching. I have
also read about caching patterns such as 'primed cache', 'on - demand cache' etc., I understand these are useful if I am building caching into my application at design time itself.
Gurus, can you please show me any document or other resource which shows how to implement caching in a step by step manner in an application?
Also, if I choose to implement caching at design time itself, how do I go about it Gurus? I am sure my Gurus here on this forum have implemented caching in many enterprise applications. Please enlighten me O Gurus, firstly on how to get a start with caching,
and then proceed to fully implement it across all layers in my application.
Mar 26, 2013 10:04 AM|Novice Kid|LINK
Haven't any of my Gurus implemented caching?
Ok, if I may ask a question, when building caching into the application at design time itself, are we supposed to design the data store itself? Or is the data store a given and we only need to design update and retrieval strategies?
Help me O Gurus, I am completely lost on this. Don't know where to make a start.
Mar 27, 2013 03:26 AM|Kelmen|LINK
.net already has built-in caching mechanism, System,Web.Caching.Cache
basically we want to use server memory to cache, we don't want to use db datastore. if you using db, there's no point in using "caching".
because db read write is far slower than memory.
google asp.net and caching and example, mr google can dump you lots examples.
when using caching, you may look into write/update the cache, especially on thread-safety, web-farm. or you can ignore this 1st, just get the hang with cache, and discuss/research further when you get the hang of it.
Mar 27, 2013 04:39 AM|Novice Kid|LINK
Thanks for your reply Guru Kelmen, but I was interested in knowing how to implement caching at every layer of an enterprise application. System.Web.Caching cannot be used at the business tier can it? I am interested in knowing how to integrate a caching
mechanism into the architecture itself.
I have been searching and researching and doing everything else related to it, but somehow, ain't able to make a start to it. If you know of any examples or resources that show it being implemented step by step at all layers for at least a skeleton application,
I would greatly appreciate it!
Mar 29, 2013 06:37 AM|Kelmen|LINK
you can just take the sample from ms cache app block, customize it for your own need.
i believe they also using the web cache object, which should be usable for non-web app as well.
regardless, you can just adopt the app block, use as black-box system, as long as it serve your need.
in term of caching, it's practical use for data that need to read frequently, but seldom change.
you want to avoid unnessary database reading, which almost 90% of the time you expecting getting the same data, so caching is practical here.
for data that tends to be volatile/changing, its up to you to decide, but i would suggest don't over-engineer it, do without cache. simple work/design, less bug.
when you got the hang/experience with it, you will then decide what and how to move on.