Our web application is deployed in a web farm (more than 20 servers). The site has a huge traffic (millions of page views per day). In the first release, this application is using EntLib's CacheManager (Entreprise application block caching). We call this "Local Server Cache". There are many benefits but we still have a major drawback : each server manage its own cache and acces to database (not distributed).
That's why we are trying to implement AppFabric caching feature in order to reduce database round trips. One of the major problem we have is data synchronisation :
So what are caching stragegies for large scale web sites ?
Thanks,
I would say cache read only data as much as possible. For this you can use AppFabric Caching Service. You can setup a cluster of let's say 5 cache servers. Then all of your 20 front-end servers would talk to this cache cluster to get cached data. You can also take advantage of keeping the most frequent data directly on front-end (local cache). For example our configuration is this:
It gets more tricky for data that you want to update. Every time you introduce locks, your performance will suffer.
As I'd mentioned on MSDN, immediate consistency is expensive. You have to accept some tradeoffs in consistency, or lay out a lot of cash to be immediately consistent. Using the isolated read/write model we discussed on MSDN, along with queues, probably provides you the best performance/consistency bang for the buck. Multiple tiers of cache as suggested by David are also excellent, depending on your overall architecture/design. Using your own local in-proc or localhosted cache implementation also offers a lot of value -- not a fan of AppFabric's OOTB local cache myself.
--ab
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With