Top Banner
1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard III for providing some of the slides Communications Asymmetry in Mobile Wireless Environments Network asymmetry In many cases, downlink bandwidth far exceeds uplink bandwidth Client-to-server ratio Large client population, but few servers Data volume 2 Small requests, large responses Downlink bandwidth more important Update-oriented communication Updates likely affect a number of clients
29

Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

Feb 21, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

1

Lecture 2: Data Management

Ing-Ray Chen

CS 6204 Mobile Computing

Virginia Tech

1

g

Courtesy of G.G. Richard III for providing some of the slides

Communications Asymmetry in Mobile Wireless Environments

• Network asymmetryy y– In many cases, downlink bandwidth far exceeds

uplink bandwidth

• Client-to-server ratio– Large client population, but few servers

• Data volume

2

– Small requests, large responses

– Downlink bandwidth more important

• Update-oriented communication– Updates likely affect a number of clients

Page 2: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

2

Disseminating Data to Wireless Hosts

• Broadcast-oriented dissemination makes sense for many applicationssense for many applications

• Can be one-way or with feedback– Sports– Stock prices– New software releases

Ch h

3

– Chess matches– Music– Election Coverage– Weather/traffic …

Dissemination: Pull• Pull-oriented dissemination can run into

trouble when demand is extremely high– Web servers crash

– Bandwidth is exhausted

clientclient

client

4

client

client

client

client

server

help

Page 3: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

3

Dissemination: Push

• Server pushes data to clients• Server pushes data to clients

• No need to ask for data

• Ideal for broadcast-based media (wireless)

client

clientclient

5

client

client

client

client

server

Broadcast Disks

2 3

1 4

5 6

server

Schedule of data blocksto be transmitted

6

Page 4: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

4

Broadcast Disks: Scheduling

2 3

1 4

5 6

Round Robin Schedule

1 2

7

1

1 2

1

3 1

Priority Schedule

Priority Scheduling (2)• Random

– Randomize broadcast schedule

– Broadcast "hotter" items more frequently

• Periodic Broadcast Program– Create a schedule that broadcasts hotter items

more frequently……but schedule is fixed

Allows mobile hosts to sleep…

8

q y

– Simplifying assumptions• Data is read-only

• Schedule is computed and doesn't change…

• Access patterns of MUs are assumed the same

Page 5: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

5

Broadcast Program

• Order pages from “hottest” to “coldest”• Partition into ranges (“disks”)—pages in a range

have similar access probabilities• Choose broadcast frequency for each “disk”• Split each disk into “chunks”

– maxchunks = Least Common Multiple (LCM) of relative frequencies, e.g., 4 is the LCM of 1, 2, and 4

/

9

– numchunks(J) = maxchunks / relative_freq(J)

• Broadcast program is structured as:for I = 0 to maxchunks-1

for J = 1 to numdisksBroadcast( C(J, I mod numchunks(J) + 1 )

Broadcast Program ExampleRelative frequencies 4 2 1

Q: What is theaverage access time?

10

average access time?

Page 6: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

6

Air Indexing (Ref. [5])

• Air indexing– Broadcast not only data but also index– Broadcast not only data, but also index– Clients listen to the index to predict the arrival

of desired data– Clients sleep and wake up to receive data

• Performance MeasuresAccess time (efficiency)

11

– Access-time (efficiency)• Time elapsed from issuing a query to receiving data

– Tuning-time (power consumption)• Time elapsed by client staying active to retrieve data

Data Organization

– Access time optimization

– Tuning time optimization

12

– (1,m) indexing

Page 7: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

7

Transaction Processing with Pre-Declaration

• Pre-declaration works with access time optimization organization by pre-declaring the data items that will possibly be requested

• An example transaction: if (d2<3) then read(d0) else read(d1)

Without pre declaration

13

With pre-declaration

Without pre-declaration

Transaction Processing with Pre-Declaration and Selecting Tuning

• Work with tuning time optimization and• Work with tuning time optimization and (1,m) indexing organization– Initial probe

• Locate the next nearest index

– Index search

14

• Search the index to locate the desired data

– Data retrieval• Tune into the channel at the particular point to

download the data

Page 8: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

8

Transaction Processing with Pre-Declaration and Selecting Tuning

Without pre-declaration

15

With pre-declaration

Analysis of Pre-declaration with Selective Tuning in Data Broadcast

–Access Time Optimization• Access Time:

D # of items

I # of indicesAccess Time:

• Tuning Time= Access Time

–Tuning Time Optimization

– (1, m) Indexing• Access Time

op # of items in the transaction

n # of keys plus pointers one tree node can hold

m # of times index is broadcast

k # of levels in index tree

16

Tuning Time Optimization• Access Time:• Tuning Time:

• Tuning Time: Same as in the tuning time optimization organization

Number of revisits at level iof the index tree

# of nodes at level i

Page 9: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

9

Hot For You Ain't Hot for Me• Hottest data items are not necessarily the ones most

f tl d b ti l li tfrequently accessed by a particular client• Access patterns may have changed• Higher priority may be given to other clients• Might be the only client that considers a piece of

data item important…• Solution: caching

17

g– needs to consider not only probability of access (standard

caching), but also broadcast frequency– Observation: Hot items are more likely to be cached!

Broadcast Disks: Caching• Under traditional caching schemes, usually want

t h "h tt t" d tto cache "hottest" data• What to cache with broadcast disks?• Hottest?

– Probably not—that data will come around soon!

• Coldest?U t il

18

– Ummmm…not necessarily…

• Cache data with access probability significantly higher than broadcast frequency

Page 10: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

10

Caching• PIX algorithm (Acharya)• Eject the page from local cache with the

smallest value of:

probability of accessbroadcast frequency

19

• Meaning that pages that are more frequently accessed may be ejected if they are expected to be broadcast frequently…

Hybrid Push/Pull

• Balancing Push and Pull for Data Broadcast• Balancing Push and Pull for Data Broadcast

• B = Bo + Bb

– Bo is bandwidth dedicated to on-demand pull-oriented requests from clients

– Bb is bandwidth allocated to broadcast

20

Bo=0%"pure" Push

Clients needinga page simply wait

Bo=100%Schedule is totally request-based

Page 11: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

11

Optimal Bandwidth Allocation between On Demand and Broadcast• Assume there are n data items, each of size S• Each query packet is of size R• Each query packet is of size R• The average time for the sever to service an on-demand

request is D=(S+R)/Bo; let =1/D be the service rate• Each client generates requests at an average rate of • There are m clients, so cumulative request rate is =m*• For on-demand requests, the average response time per

request is T =(1+queue length)*D where “queue length”

21

request is To=(1+queue length)*D where queue length is given by utilization/(1-utilization) with “utilization’ being defined as – Queueing theory for M/M/1– Take CS 5214 offered in Spring Semester to learn this

Optimal Bandwidth Allocation between On Demand and Broadcast

• What are the best frequencies for broadcasting q gdata items?

• Imielinski and Viswanathan show that if there are n data items D1, D2, …, Dn with popularity ratio p1, p2, …, pn, they should be broadcast with frequencies f1, f2, …, fn, where fi = sqrt(pi)/[sqrt(p1)+sqrt(p2) +sqrt(p )] in order to

22

sqrt(pi)/[sqrt(p1)+sqrt(p2) …+sqrt(pn)] in order to minimize the average latency Tb for accessing a broadcast data item.– For example, If D1 and D2 with p1 =90% and p2 =10%

then f1 =75% and f2 =25%.

Page 12: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

12

Optimal Bandwidth Allocation between On Demand and Broadcast• T=Tb + To is the average time to access a data item

• Imielinski and Viswanathan’s algorithm:Assign D1, D2, …, Di to broadcast channel

Assign Di+1, Di+2, …, Dn to on-demand channel

Determine optimal Bb, Bo to minimize T=Tb + To:

Compute To by modeling on-demand channel

23

p o y gas M/M/1 (or M/D/1)

Compute Tb by using the optimal frequencies f1, f2, …, fiCompute optimal Bb which minimizes T to within an acceptable threshold L

How?

Mobile Caching: General Issues• Mobile user/application issues:

– Data access pattern (reads vs. writes)– Data update rate– Communication/access cost– Mobility pattern of the client– Connectivity characteristics

24

y• disconnection frequency• available bandwidth

– Data freshness requirements of the user– Context sensitivity of the information

Page 13: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

13

Mobile Caching (2)• Research questions:

H li id l b d d?– How can client-side latency be reduced?– How can consistency be maintained among all caches and

the server(s)?– How can we ensure high data availability in the presence

of frequent disconnections?– How can we achieve high energy/bandwidth efficiency?– How to determine the cost of a cache miss and how to

25

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?– How to enable cooperation between multiple peer caches?

Mobile Caching (3)• Cache organization issues:

– Where do we cache? (client? proxy? service?)H l l f hi d (i th f– How many levels of caching do we use (in the case of hierarchical caching architectures)?

– What do we cache?– When do we cache a data item and for how long?– How do we invalidate cached items?– Who is responsible for invalidations? – What is the granularity at which the invalidation is done?

h d h id

26

– What data currency guarantees can the system provide to users?

– What are the costs involved? How do we charge users?– What is the effect on query delay (response time) and

system throughput (query completion rate)?

Page 14: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

14

Web Caching: WebExpress

• System intercepts web browsing, providing sophisticated caching and bandwidth saving optimizations for web activitycaching and bandwidth saving optimizations for web activity in mobile environments

• Major features:– Low bandwidth in wireless networks Caching– Time to live (TTL) based cache consistency– When TTL expires, check if an object has been updated by using the

CRC of an object (to reduce network traffic)– Verbosity of HTTP protocol Reduce redundant header info

2727

y pbetween client-side and server-side proxies

– TCP connection setup time Reuse a single TCP connection– Many responses from web servers are very similar to those seen

previously Use differencing rather than returning complete responses, particularly for CGI-based interactions

WebExpress A Single TCP connection

Put back removed

2828

Two intercepts (proxies): one on the client side and one on the server side

Caching on both client and on wired network + differencing

Reduce redundantHTTP header info

Put back removed HTTP header info on server side

Page 15: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

15

Weak vs. Strong Consistency• Strong consistency

V l d i th t t l i t– Value read is the most current value in system– Invalidation on each write– Disconnections may cause loss of invalidation messages– Can also poll on every access– Impossible to poll if disconnected!

• Weak consistency– Value read may be “somewhat” out of date

29

– TTL (time to live) associated with each value

• Can combine TTL with polling– e.g., Polling to update TTL or retrieval of new copy of data

item if out of date

Invalidation Report for Strong Cache Consistency

• Stateless: Server does not maintain information about the cache content of the clientscache content of the clients– Synchronous: An invalidation report is broadcast periodically, e.g.,

Broadcast Timestamp Scheme– Asynchronous: reports are sent on data modification– Property: Client cannot miss an update (say because of sleep or

disconnection); otherwise, it will need to discard the entire cache content

• Stateful: Server keeps track of the cache contents of its li t

30

clients– Synchronous: does not exist– Asynchronous: A proxy is used for each client to maintain state

information for items cached by the client and their last modification times; invalidation messages are sent to the proxy asynchronously.

– Clients can miss updates and get sync with the proxy (agent) upon reconnection

Page 16: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

16

Asynchronous Stateful (AS) Scheme (Ref. [6]) • Whenever the server updates any data item, an invalidation

report message is sent to the MH’s HA– A home location cache (HLC) is being maintained in the HA to ( ) g

keep track of data having been cached by the MH.– The HLC is a list of records (x,T,invalid_flag) for each data item

x locally cached at MH where x is the data item ID and T is the timestamp of the last invalidation of x

– Invalidation reports are transmitted asynchronously and are buffered at the HA until explicit acknowledgment is received from the specific MH. The invalid_flag is set to true for data items for which an invalidation message has been sent to the MH b k l d i i d

31

but no acknowledgment is received• Before answering queries from application, the MH

verifies whether a requested data item is in a consistent state. If it is valid, it will satisfy the query; otherwise, an uplink request to the HA is issued.

Asynchronous Stateful (AS) Scheme

• When MH receives an invalidation message from HA, it discards that data item from the cache,

• In the sleep mode, the MH is unable to receive any invalidation message

• When a MH reconnects, it sends a probe message to its HA with its cache timestamp upon receiving a q er In response to this probe message the HA

32

query. In response to this probe message, the HA sends an invalidation report.

• The AS scheme can handle arbitrary sleep patternsof the MH.

Page 17: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

17

Analysis of AS Scheme

• Goal:• Goal: – Cache miss probability

– Mean query delay

• Model constraints: A single Mobile Switching Station (MSS) with N mobile

33

g ( )hosts

System Model of AS Scheme

• M data items, each of size ba bits• No query when MH is disconnected• Single wireless channel of bandwidth C• All messages are queued and serviced

FCFS• A query is of size b bits

34

A query is of size bq bits• An invalidations is of size bi bits

Page 18: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

18

MH Queries

• Queries follow a • Queries follow a Poisson distribution with mean rate

• Queries are uniformly distributed over all items M in the

tn

en

tntNP

!))((

35

items M in the database

Data Item Updates

• Time between two consecutive updates to a• Time between two consecutive updates to a data item is exponentially distributed with rate μ

36

Page 19: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

19

MH states

• Mobile hosts alternate between sleep andMobile hosts alternate between sleep and awake modes

• s is the fraction of time in sleep mode with 0 ≤ s ≤ 1

• Time between two consecutive wakeups is exponentially distributed with rate ω

37

exponentially distributed with rate ω

38A. Kahol, S. Khurana, S. K. S. Gupta, P. K. Srimani, An Efficient Cache Maintenance Scheme for Mobile Environment

Page 20: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

20

Analysis: Hit ratio

• λ = (1 s) λ = effective rate of query• λe = (1 – s) λ = effective rate of query generation

• Since queries are uniformly distributed over M items in the database, so per-data item (say x) query rate is:

39

λx = λe /M = [(1 – s) λ/M]

Hit ratio estimation

• A query issued at time t since the last query for a specific data item x by a MH would be a miss in the local cache (which would require an uplink request) in either of two conditions:– [Event 1] During time t item x has been

40

– [Event 1] During time t, item x has been invalidated at least once

– [Event 2] Data item x has not been invalidated during time t, but MH has slept at least once during t

Page 21: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

21

t-t1 t

41A. Kahol, S. Khurana, S. K. S. Gupta, P. K. Srimani, An Efficient Cache Maintenance Scheme for Mobile Environment

t1

Calculating P [Event 1]

Mt

0 0 )1(]1Event [

Ms

MdtdxeeP

x

xtx

x

Probability density

f i fProbability of

42

function of a query for x at

time t

invalidation in time [0,t]

Page 22: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

22

t

PDF of state change

occurs at t1, which can go

from 0 to t

CalculatingP [Event 2]

0 0

1111 1]2Event [ tttttt

x dtdteeeeeP xx

PDF of query for x at time t

Probability of at least one sleep

occurredin [0 t t ]

43

Probability of no invalidation in

time [0,t]

Probability of no query in time [t-t1, t]

in [0, t-t1]

t

0 0

1111 1]2Event [

ttttttt

x dtdteeeeeP xx

44

xx

e

x

e

ee

x

2

Page 23: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

23

Pmiss and Phit

• P = P[Event 1] + P[Event 2]• Pmiss = P[Event 1] + P[Event 2]

• Phit = 1 - Pmiss

45

Analysis: Mean Query Delay• Let Tdelay be the mean query delay, then

T P *0 + P T P T h TTdelay = Phit *0 + PmissTq = PmissTq where Tq is the uplink query delay

• Model the up-link query-response behavior as an M/D/1 queue (assuming there is a dedicated up-link channel of bandwidth C)

46

• Model invalidations on the down-link channel as an M/D/1 queue (assuming there is a dedicated down-link channel of bandwidth C)

Page 24: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

24

N MHs in cell

Uplink query generation rategeneration rate

Query service rate

47A. Kahol, S. Khurana, S. K. S. Gupta, P. K. Srimani, An Efficient Cache Maintenance Scheme for Mobile Environment

Mean invalidation message arrival rate

Invalidation service rate

48A. Kahol, S. Khurana, S. K. S. Gupta, P. K. Srimani, An Efficient Cache Maintenance Scheme for Mobile Environment

Page 25: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

25

Effective arrival rate of invalidation

messages

49A. Kahol, S. Khurana, S. K. S. Gupta, P. K. Srimani, An Efficient Cache Maintenance Scheme for Mobile Environment

Query service rate

Mean Query Delay Estimation

• For the combined

~

2 iqq • For the combined M/D/1 queue

~

2 iqqq

iqq

qT

Average delay experienced by an

uplink query

50

• Mean query delay is: Tdelay = PmissTq

Page 26: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

26

Disconnected Operation

• Disconnected operation is very desirable for sco ected ope at o s ve y des ab e omobile units

• Idea: Attempt to cache/hoard data so that when disconnections occur, work (or play) can continue

• Major issues:– What data items (files) do we hoard?

51

( )– When and how often do we perform hoarding?– How do we deal with cache misses?– How do we reconcile the cached version of the data

item with the version at the server upon reconnection?

States of Operation

Data HoardingData Hoarding

DisconnectedRead/write

Reintegration

52

Reintegration

Page 27: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

27

Case Study: Coda• Coda is a file system developed at CMU to

support disconnected operationsupport disconnected operation• Cache/hoard files and resolve needed updates

upon reconnection• Replicate servers to improve availability• What data items (files) do we hoard?

– User selects and prioritizesh h h

53

– Hoard walking ensures that cache contains the “most important” stuff

• When and how often do we perform hoarding?– Often, when connected

Coda (2)• How do we deal with cache misses?

– If disconnected cannotIf disconnected, cannot

• How do we reconcile the cached version of the data item with the version at the server? – When connection is possible, check before updating– When disconnected, use local copies– Upon reconnection, resolve updates– If there are hard conflicts, user must intervene (e.g., it’s

manual—requires a human brain)

54

• Coda reduces the cost of checking items for consistency by grouping them into volumes– If a file within one of these groups is modified, then the

volume is marked modified and individual files within can be checked

Page 28: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

28

To Cache or Not?• Compare static allocation “always cache” (SA-always),

“never cache” (SA-never), vs. dynamic allocation (DA)• Cost model:• Cost model:

– Each rm (read at mobile) costs 1 unit if the mobile does not have a copy; otherwise the cost is 0

– Each ws (write at server) costs 1 unit if the mobile has a copy; otherwise the cost is 0

• A schedule of (ws, rm, rm, ws)– SA-always: Cost is 1+0+0+1=2– SA-never: Cost is 0+1+1+0 = 2

55

– DA which allocates the item to the mobile after the first ws operation and deallocates after second rm operation: Cost is 0 + allocation/deallocation cost = 0 + 1 (for allocation) + 1 (deallocation) = 2

• A schedule of m ws operations followed by n rm operations? Cost=m (always) vs. n (never) vs. 1 (DA)

To Cache or Not? Sliding Window Dynamic Allocation Algorithm

• A dynamic sliding-window allocation scheme SW[k] i t i th l t k l t ti d k thmaintains the last k relevant operations and makes the

allocation or deallocation decision after each relevant operation

• Requiring the mobile client to be always connected to maintain the history information

• Case “Data item is not cached at the mobile node” – If the window has more rm operations than ws operations, then

ll h d i h bil d

56

allocate the data item at the mobile node

• Case “Data item is cached at the mobile node” – If the window has more ws operations than rm operations, then

deallocate the data item from the mobile node

• Competitive w.r.t. the optimal offline algorithm

Page 29: Lecture 2: Data Managementirchen/6204/paper/lecture2... · 2010. 8. 30. · 1 Lecture 2: Data Management Ing-Ray Chen CS 6204 Mobile Computing Virginia Tech 1 Courtesy of G.G. Richard

29

ReferencesChapter 3, F. Adelstein, S.K.S. Gupta, G.G. Richard III and L. Schwiebert, Fundamentals of Mobile and Pervasive Computing, McGraw Hill, 2005, ISBN: 0-07-141237-9.

Other References:5. S. Lee, C.S. Hwang, and M. Kitsuregawa, “Efficient,

Energy Conserving Transaction Processing in Wireless Data Broadcast,” IEEE Transactions on Knowledge and Data Engineering, Vol. 18, No. 9, Sept. 2006, pp. 1225-1238.

57

6. A. Kahol, S. Khurana, S.K.S. Gupta and P.K. Srimani, “A strategy to manage cache consistency in a disconnected distributed environment,” IEEE Transactions on Parallel and Distributed Systems, Vol. 12. No. 7, July 2001, pp. 686-700.