2. Objective
Caching Mechanism and Problems
Caching using Windows Server AppFabric Cache
Windows Server AppFabric Cache Overview
Design Considerations for Cache Implementation
Case Study
3. Caching Mechanism and Problems
Long load
time & Users see different
Speeds up the
delays Load Balancer data, depending on the
application server they get routed to!
Cache Cache
Reduces
database
load
High load
on the V1 V2
database
Update
3
4. Solution: Distributed Caching Using
AppFabric Cache
Load Balancer
Unified Cache View
Cache
Invalidated New version of data
placed in cache
V1 V2
Update
4
5. AppFabric Cache Physical
Architecture
Cache Cluster
Cache Cache Cache
Host Host Host
Cache-enabled
Application
Server
Cache Server Cache Server Cache Server
7. AppFabric Cache Advantages
Rich API
Can be NET 4.5 or .NET 4.0 or .NET 3.5 SP1
Can be configured in code or config
Read-Through/Write-Behind Pattern
Scalable
Can be Scaled out
Performance
Typically linear as more nodes are added
LocalCache increases raw performance
High Availability
Provides cache data-protection by saving 2 copies of cached data on different nodes
Safeguards against cache node failures
Management
Security
8. Management
Caches and Cache Cluster are provisioned and managed through
Windows PowerShell
ETW Tracing and Logging Available on both Client and Server
Rich set of performance monitor counters
9. Security
Domain
Authentication in AD, Authorisation in AppFabric
Only authorised servers join clusters
Only authorised clients connect to clusters
Workgroup
Authentication in network share, Authorisation in AppFabric
Transport Level Security
Signing and Encryption
11. Data Categorization
Reference Data
“Read-Heavy”, Shared between users (concurrent access)
Examples: Product description, customer profile data
Resource Data
Read-Write, Shared between users (concurrent access)
Examples: Number of units in stock, online survey results
Activity Data
Read-Write, User specific (no concurrent access)
Examples: Shopping cart content, survey response
1
1
12. Object Removal
Explicit Deletion
User explicitly removes an item from the cache
Expiration
When an object is proactively removed from the cache because of
staleness
Eviction
When an object is reactively removed from the cache due to low
memory conditions
13. Cache-Source Coherency
Pre-load data into Cache
Example: Loading products catalog details into cache using bootstrap
process when application starts
Maintain Cache-Source coherency every time source is updated
14. Programming Patterns
Cache-aside Pattern
Explicitly write code to check if data exists in cache, if not, read from
database and place a copy in cache
Read-through and Write-behind
Read: If data not found in cache, read through a specialized provider
Write: Cache stores the data in memory and writes the data to
permanent storage using specialized provider
15. Case Study: Dealer Management
Software
Problem
SaaS based Dealer Management Software from industry leading
provider had to share the data between many of its sub-applications
in-order to complete the business process flow. Each application
would query the same data and act upon. Some of the data comes
from legacy Crm application and access times were considerable
and this led to slowing down performance of the software.
16. Case Study: Dealer Management
Software
Solution
ASP.Net Session Provider was built and
used across applications to share data.
Enrollment Financial
Mgmt. App
Fulfillment Session provider used AppFabric Cache
App App as a primary persistent storage and SQL
Server as secondary storage. This
reduced repeated access for same
data across applications and load on
ASP.Net Session Provider Crm system.
Reference (“Read Heavy”) data was
Cache Cluster
loaded into cache using a bootstrap
process. This reduced data load times
for certain data at first request.
Central administration of cache through
Primary Cache Host
PowerShell Scripts
Cache Host
Resulted in significant performance
boost