AppFabric Cache is an in-memory, distributed caching solution, which stores objects on a cache cluster. A cache cluster may consist of one or more on-premises server and AppFabric provides API for use with .Net applications to read/write data on the cache cluster.
Features
Since it is out-of-process, the cache can be shared by multiple worker processes and even multiple applications across multiple servers. Also, cached data will not be lost when the application pool recycles. If there are multiple portals that need to share the same cached data or there is a requirement to manage the cached data from a different application, this is possible by configuring all the applications to point to the same cache in the cluster. While the cache cluster may have data stored on multiple servers’ memory, the application consuming the data just sees it as one unified resource. AppFabric caching has the following other features:
- Scalability: The distributed nature of the cache allows us to increase the cluster’s memory by adding a new server (also called cache host) as the application requirements grow.
- High Availability: When enabled, a backup copy of cache is stored on a second server, so if the cache server goes down, the backup cache serves the requirement.
- Named Cache: Applications store data in named cache and AppFabric allows configuration of multiple named cache, which are independent of one another. This allows multiple applications to use the same cache cluster.
- Regions/Tags: Users can create a logical space called Region where data can be cached and tagged as well. Items can be searched by tag. However a Region can only reside within a single server, so we will not benefit from the distributed nature when using it.
- Local Cache: We can configure our application to use local cache so it does not need to make frequent trips to a cache server in order to fetch data. Items stored in local cache can be invalidated based on a specified interval of time or notification from a cache cluster.
- Additional hardware is needed for setting up cache cluster.
- Cache cluster configuration needs to be stored in a SQL Server database or an XML file located in a shared network drive. If the connection to that configuration store is lost, then the caching would stop functioning.
- There is no cache dependency feature available out of the box.
