-
Cache Operations Strategy
-
Write-Through
-
Does not improve write performance
- Operation is completed after written to the Data Store
- No support for Two-Phase Commit
-
Read-Through
- Goes to disk if not in the cache
-
Refresh Ahead
-
Can reload a cache before expiration
- Expiration time is configurable in seconds
Expiration Time
Refresh Ahead Factor
- Objects accessed after the expiration needs to be retrieved from Data Store
- If the data is accessed before the expiration a refresh-ahead is scheduled (Async process)
-
Write-Behind
-
Written to Data Source based on configured delay
- After config delay call CacheStore to write to the Data Store can be:
10 seconds
20 minutes
1 week or longer
- Better Apps Performance
- Multiple Writes coalesced to one physical write ("write-coalesce")
- Protected somehow against database failures
- If other external applications share the same data,
updates needs to be carefully handled. Cannot avoid conflict with external updates
-
Caches
- Clustered Cache
-
Near Cache
- Best of both worlds
- Fast Read access to the MRU (Most Recent Used) and MFU (Most frequently Used)
-
Wraps 2 caches
-
Front-Cache
- Provides Local Cache access
-
Back-Cache
- Centralized and multi-tiered cache
- Load-on-demand when local cache misses
- Local Cache
-
Data Distribution
-
Dynamic Partitioning
- Each Server manages its share of information
- Data Logically located in the same server to avoid many hops (Affinity)
- Each server knows the the backup location to route the access
-
Predictable Scalability
- More servers, better performance
-
Primary/Backup
- Get() - First go to the Primary
- Put() - First go to the Primary
-
Replicated Cache
- Replicates to all nodes
- Get() - Happens on the local node
- Put() - Happens on the local node and replicates to all nodes
- Manages the locks
-
I am bit skeptical here, need to test
- Memory requirement per node increases
- Too much data to be managed by each cluster
- Not linear scalability if many updates
-
TCMP Protocol
-
TCMP a combination of
-
UDP Multicast
- Cluster discover
- Heartbeat
-
Message Delivery
- When needs to deliver to multiple nodes
- Usually disabled in WAN environments
-
UDP Unicast
- member-to-member communication
- Sometimes to multiple nodes communication to reduce CPU in large clusters
-
TCP
- Sophisticated "Death Dectection"
- NOT USED for data transfer due to the overhead
-
Reliability
- UDP does not provide reliable or ordered message delivery
- TCMP uses a queue mechanism to solve UDP limitations
-
CacheStore
-
Consumes more Cache Service threads
- Common symptom of Insufficient thread pool is the cache access latency
- Should be careful when calling another cache instance to avoid
overload the other cache service thread pool