Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz...

38
Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski

Transcript of Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz...

Page 1: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Sleepers & Workaholics

Caching Strategies in Mobile ComputingDr. Daniel Barbará

Dr. Tomasz Imielinski

Page 2: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

About Me

Peter Rosegger 5th year Computer Science Specialization: Databases Graduation: December 2007

Page 3: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Sleepers & WorkaholicsCaching Strategies in Mobile Computing

Dr. Daniel Barbará Professor at George Mason University Several patents associated with mobile caching

Dr. Tomasz Imielinski Professor at Rutgers University Senior VP: Search Technology at Ask.com

Page 4: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

199416 million cellular subscribers in US

Page 5: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

1994

Page 6: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

The Future of Mobile Computing

Use Habits: Large # of users Check weather, stocks, scores, etc. Mobile between cells (& wireless networks)

Hardware: Low-powered palmtop machines Poor battery life Narrow bandwidth

Page 7: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

The Future of Mobile Computing

Query complex databases, but… Frequently powered off to save battery Frequently changing cells Network traffic must be minimized to

conserve bandwidth

Page 8: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Why Caching is Important

Conserve:

1. COMPUTATIONAL RESOURCES

2. BATTERY LIFE

3. BANDWIDTH

Page 9: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Traditional Strategies Fail

Server lacks knowledge of: Which units are in its cell Which units are powered ON

Client caches cannot be tracked

Page 10: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

The Solution

Purpose of Sleepers & Workaholics:

"…to propose a taxonomy of different cache invalidation strategies and study the impact of clients' disconnection times on their performance."

Page 11: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Strategies

Timestamps (TS) Amnesic Terminals (AT) Signatures (SIG)

Control Strategy: No Cache (NC)

Page 12: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Timestamps

-Cache entries have timestamps-Synchronous, history based, uncompressed reports

SERVER:Notify clients of identifiers of items changed within last w seconds

CLIENT:For each item in cache: If in report, purge from cache If NOT in report, update timestamp to current time

Page 13: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Amnesic Terminals

-Cache entries have identifiers-Synchronous, history based, uncompressed reports

SERVER:Notify clients of identifiers of items changed within last w seconds

CLIENT:For each item in cache: If in report, purge from cache If NOT in report, do nothing

Page 14: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Signatures

-Checksums calculated over value of data to form Signature-Signatures combined using XOR-Synchronous, state based, compressed reports

SERVER:Server broadcasts the set of combined signatures

CLIENT:Item in cache is declared invalid if it belongs to “too many”

unmatching signatures (suspected of being out of date)

Page 15: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

AnalysisCalculate THROUGHPUT for each strategy…

L = time between invalidation report broadcasts W = bandwidth B = # bits in the broadcast (invalidation reports)

# bits available for answering queries (cache misses)

C

=LW − BC

Page 16: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

AnalysisT = THROUGHPUT; queries per interval handled by the system

h = cache hit rate, expressed [0, 1]

b = # bits for a query

b = # bits to answer a query

Traffic (in bits) due to cache misses

q

a

=T(1− h)(bq + ba )

Page 17: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Throughput

T(1− h)(bq + ba ) = LW − BC

T =LW − BC

(1− h)(bq + ba )

Page 18: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Effectiveness of a Strategy

e =T

Tmax

Page 19: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Maximal ThroughputServer knows:-What units are in the cell-What those units have in their cachesServer can:

-instantaneously notify units when an item changes

BC = 0

h = MaximalHitRatio

Page 20: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Maximal Hit Ratio

The Hit Ratio achieved in ideal conditions:

MHR = λe−λτ e−μτ dτ0

MHR =λ

λ + μ

Page 21: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Maximal Throughput

Tmax =LW

(1− M .H.R.)(bq + ba )€

BC = 0

h = MaximalHitRatio

Page 22: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

No Caching-No invalidation report

-No intervals

BC = 0

h = 0

Tnc =LW

(bq + ba )

Page 23: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Timestamps

TTS =LW − nc (log(n) + bT )

(bq + ba )(1− hts)

Page 24: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Amnesic Terminals

TAT =LW − nL log(n)

(bq + ba )(1− hat )

Page 25: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Signatures

Consider the probability of false diagnosis: Probability of a false positive Probability of a false negative

TSIG =LW − 6g( f +1)(ln(

1

δ) + ln(n))

(bq + ba )(1− hsig )

Page 26: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Asymptotic AnalysisAnalyze throughput in extreme cases: As probability of sleeping s0, s1

Analyze throughput as system parameters vary: Database size Update frequency Bandwidth Etc.

Page 27: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

WorkaholicsUnit sleeps less and less: s0 All hit ratios approach the same value SIG lags behind TS and AT by a factor of

BEST THROUGHPUT: AT, because its report is the shortest

pnf

Page 28: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

SleepersUnit sleeps more and more: s1 All hit ratios approach 0

BEST THROUGHPUT: No Caching eventually wins as s becomes very large For practical purposes, SIG is the best choice

Page 29: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Infrequent Updates

Effectiveness as s ranges from 0 to 1

Page 30: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Increase Database Size & Bandwidth

Effectiveness as s ranges from 0 to 1

Page 31: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Update Intensive

Effectiveness as s ranges from 0 to 1

Page 32: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Increase Database Size & Bandwidth

Effectiveness as s ranges from 0 to 1

Page 33: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Conclusions on Effectiveness

Strategy depends on circumstances: SIG is best for sleepers TS is best for query-intensive scenarios, but… AT is best for workaholics

How can we improve effectiveness?

Page 34: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Relax: Consistency of the Cache

Depending on data type, data may not need to be exact…

EX: stocks, weather, etc.

Makes shorter invalidation reports possible

Page 35: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

How Do We Decide to Update?

- Consider cached copies to be quasi-copies

- Each quasi-copy has a coherency condition attached to it

Coherency Conditions:Delay Condition - updated based on time

Arithmetic Condition - updated based on difference between data and quasi-copy

Page 36: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Adaptive Invalidation Reports-Start with TS strategy

Use algorithms to optimize strategy.

Examples: If an item is queried very often by units that sleep

a lot, include it in reports for longer If an item changes frequently, do not bother

caching

Page 37: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

Criticism Units rarely powered down

Battery life better than predicted Battery life does not dictate use

Units still lose reception frequently Today’s most common “sleeper” condition --

explicitly excluded from definition in S&W Bandwidth better than predicted

Page 38: Sleepers & Workaholics Caching Strategies in Mobile Computing Dr. Daniel Barbará Dr. Tomasz Imielinski.

However… Adjust “sleeper” to include lost reception Caching is still important

Endless demand for computational resources Endless demand for battery life Endless demand for more bandwidth