Programming asp

Page 277

Distributed Caching In cases where multiple instances of your application are running on more than one web server, requests to the application may be served by any one of those servers. And every time a request goes to a new server, the cached items have to be regenerated if they have not been generated on that server already. Depending on how complex a process it is to generate the cached items, it may be terribly inefficient to regenerate the same data again and again. Instead, it can be much more efficient to generate the data once and store it in multiple servers or web farms. This technique of caching data on one application instance and sharing it with other instances is known as distributed caching, and it is the most elaborate of all caching techniques. Distributed caching is an extension of normal caching techniques by which data from a database or session is stored in a central location that all instances of an application have access to. There are a number of benefits to using a distributed caching layer, such as: Performance Because a high volume of data can be stored in memory on the servers, read performance improves significantly, which benefits all pages downstream by making them load faster. Scalability Scalability becomes a function of adding more capacity or nodes to the clusters, allowing the application to scale to higher demands and load easily. Combined with cloud storage, nodes can be spun up on demand and freed when not required, increasing cost efficiency. Redundancy Redundancy ensures that if one node or server fails, the whole application does not suffer. Instead, another failover node can simply pick up the request and serve it without any manual intervention. Failover and redundancy are essential features of many distributed caching solutions.

Distributed caching solutions There are a number of distributed caching products available today, and although each of these products offer very different APIs and ways of working with the data they manage, the basic concepts of distributed caching remain the same. In order to give you an idea of how to implement a distributed caching solution, the next few sections show how to implement Microsoft’s distributed caching solution, called Velocity, within the Ebuy reference application. Installing Velocity. Velocity is the Windows AppFabric (aka Microsoft Application Server) caching layer. So in order to install Velocity, you must download Windows AppFabric or install it via the Web Platform Installer. Server-Side Caching Techniques | 259

www.it-ebooks.info


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.