Cache Management
Cache Management
Cache Management
• Purpose of caching:
– Improve data access performance
– Improve data availability
• Trade-off : data consistency
• Data Currency Requirement
• Cache Consistency Maintenance
Schemes depends on applications
– WWW
– Distributed File Systems
– Client-Server Databases
Mobile Data Caching
Cache Consistency Maintenance
• Cache Consistency Models
– Classic Techniques
• Call backs and Validity Checks
• Designed for distributed computing environment
connected via reliable wired links
• Not suitable for Mobile client (lost connection, etc)
• Refetching valid data – wasting bandwidth
– Strong Cache Consistency Model:
• Data x(t) is the most recent x(t)? Checked with the
server before access
• Mobile computing environment – make it unusable
when disconnections become frequent
Mobile Data Caching
Performance and Architectural Issues
• Various issues and Considerations for
Designing Mobile Caching Strategies
1. Data access pattern
2. Data update rate
3. Communication/access cost
4. Mobility pattern of the client
5. Connectivity characteristics (disconnection
frequency, available bandwidth)
6. Context dependence of the information
Mobile Data Caching
Performance and Architectural Issues
• Need to address the following problems
– How to reduce client-side latency
– How to maintain cache consistency between
various cache and the servers
• Being studied extensively in distributed
systems and wired networking
environments
• Not new to mobile computing
environments
Mobile Data Caching
Performance and Architectural Issues
• Need to address the following problems
– How to ensure high data availability in the
presence of frequent disconnections
– How to achieve high energy/bandwidth
efficiency
– How to determine the cost of a cache miss
and how to incorporate this cost in the cache
management scheme
– How to manage location-dependent data in
the cache
• These 4-problems are new to the mobile
computing environment
Mobile Data Caching
Performance and Architectural Issues
• Need to address the following problems
– How to enable cooperation between multiple
peer caches
• Need to consider
– Peer-to-Peer paradigm
– Ad Hoc Networks
Mobile Data Caching
Performance and Architectural Issues
• Cache Organization Issues
1. Where do we cache?
• Server? Proxy? Client?
• Frequency, Pattern, Cost of access
• At server: aggregated access pattern, retrieving
cost
• At proxy and client: access pattern,
communication cost, update rate
2. How many levels of caching do we use
(hierarchical caching)?
3. What do we cache (when to cache a data
item and for how long)?
4. How do we invalidate cached items?
Mobile Data Caching
Performance and Architectural Issues
• Cache Organization Issues
5. Who is responsible for invalidations? What
is the granularity at which the invalidation is
done?
6. What data currency guarantees can the
system provide to users?
7. What are the cost involved? How do we
charge users?
8. What is the effect on query delay (response
time) and system throughput (query
completion rate)
Mobile Cache Maintenance Schemes
• A Taxonomy of Cache Maintenance Schemes
(classification)
– Cache Consistency Requirements
• Strong Cache Consistency – data always up-to-date
– Polling Every Time Scheme
» used in Web caching
– Invalidating Data On Modification Scheme
• Weak Cache Consistency (some degree of inconsistency)
– TTL (Time-To-Live) -based Consistency Strategies
» Used in Web caching
» Polling Every Time Strategies is a special case of TTL with
TTL field of zero
Mobile Cache Maintenance Schemes
• Invalidating-Based Strategies - Server initiates
the cache consistency verification
– Stateless Approach – server does not maintain info
(how long) about the cache contents of the clients
• Stateless Asynchronous approach
– invalidation reports sent out on data modification
• Stateless Synchronous approach
– Server sends out invalidation reports periodically
– Stateful Approach – server keeps track of the cache
contents of its clients
• Stateful Asynchronous approach – AS (Kahol
2001)
– use a Home Location Cache
• Stateful Synchronous approach – hardly any
Cache Maintenance for Push-Based Information
Dissemination
x=10 x=15
Get x
X = 10
Data Server Data Server
Base-station Base-station
x=15
Use x
Data Server
Base-station
Invalid
Data ID
Timest
flag
amp
X * F X t0 Y Y t3 T X t3 T
Home Location
Cache (HLC) Z Z Z Z * T Z * T
* F * F * F
Maintaining in HA
1) Fetch y from server
2) Add (y,t2) to HLC
3) Forward y to MH z changed
x changed y changed
t0 t1 t2 t3 t4 t5 Time
Query Query
Data Server (y,t1) +
Wireless Data Probe
Access Point (*,t2) (y,z,t5)
Data
Server Invalidation (y,t2)
(x,t1)
. Internet
.
. MH
Sleeping First query
awake after wakeup
Ignored
Timestamp t0 t1 t2 t5
. x y
.. *
Data z z z