第 4 讲 移动数据分发

60
第 4 第 第第第第第第 §4.1 数数数数 Mobile Data Delivery §4.2 数数数数 -- Data Broadcast (Push) §4.3 数数数数 Data Indexing §4.4 数数数数 -- Pull-based

Upload: gilead

Post on 13-Jan-2016

95 views

Category:

Documents


0 download

DESCRIPTION

第 4 讲 移动数据分发. §4.1 数据发送 Mobile Data Delivery §4.2 数据分发 -- Data Broadcast (Push) §4.3 数据索引 Data Indexing §4.4 数据分发 -- Pull-based. Mobile Data Delivery. Two basic modes of data accessing mechanism: Data dissemination : from server to a large population of clients. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 第 4 讲 移动数据分发

第 4 讲 移动数据分发

§4.1 数据发送 Mobile Data Delivery

§4.2 数据分发 -- Data Broadcast (Push)

§4.3 数据索引 Data Indexing

§4.4 数据分发 -- Pull-based

Page 2: 第 4 讲 移动数据分发

Mobile Data Delivery

Two basic modes of data accessing mechanism:Data dissemination: from server to a large population of clients.

Preferred in utilizing the high bandwidth downstream channel to serve many clients.Can broadcast information of common interest, such as stock quotations, traffic conditions, special events, or available seats at a theater performance.

Dedicated data access: from server to individual client and from client back to server.

Conveyed over dedicated channels with limited bandwidth.Client can query (dedicated data query) and update (dedicated data update) data items in the database.Dedicated data accesses are more expensive.Possible to handle a dedicated data query, such as querying for the availability of seats in a concert, through data dissemination.Dedicated data update is still needed in M-commerce applications.Clients make changes in database state for activities such as those to buy or sell a stock, or to reserve a seat in a show.

Page 3: 第 4 讲 移动数据分发

Mobile Data Delivery

Two modes for data dissemination:Push

Server continuously pushes items over the broadcast channel.Client tunes in the channel to wait for accessing the required data item.Set of items broadcast depends on anticipated access need of clients.Server-initiated.More scalable with number of clients, but less flexible.Implemented through the construction of a broadcast program.

PullClient requests for data items.Server schedules the appropriate data for dissemination among a set of requested items ready for reply.Client-initiated.Less scalable with number of clients, but more flexible.Implemented by online scheduling algorithm.

Page 4: 第 4 讲 移动数据分发

Mobile Data Delivery

Page 5: 第 4 讲 移动数据分发

Mobile Data Delivery

Data-oriented: consider on nature of data delivered.Publication only

Data are sent to clients regardless of whether they are requested.Clients can either filter them or ignore their presence.

Demand-drivenOnly selected set of data items are sent to clients.Clients make request to server and server sends them over dedicated channel or multiplexes them over broadcast channel.

HybridData can be published or delivered when needed.Static allocation implies that specific data items are always published and specific items are always delivered on demand and this is decided beforehand. For example, weather report and traffic report are published, but expected delay of bus can be delivered on demand.Dynamic allocation implies that the set of items for publishing may change over time.

Page 6: 第 4 讲 移动数据分发

Mobile Data Delivery

Mechanics-oriented: consider on mechanisms to deliver data.

InitiationInitiated by client: closer to on-demand and good for small number of clients.Initiated by server: closer to publication and good for large number of clients.

SchedulabilityEvent-driven: send data only upon occurrence of certain events, such as request or value change.Schedule-driven: send data according to predetermined schedule.

Communication typeUnicast: send data to individual client (normally initiated by clients).1:N: send data to a collection of clients, either broadcast (to all) or multicast (to selected set).

Page 7: 第 4 讲 移动数据分发

Mobile Data Delivery

Organization-oriented: consider on how data is structured for clients.

Broadcast program: clients listen to all items on channel.Organized program: data items organized together into a flat program (each selected item broadcast once in a cycle), non-flat (selected items broadcast with different frequency), randomized (all broadcast cycles are different).Ad hoc program: corresponds to on-demand requests. Server may broadcast singular item to each query or batch answer to several queries together.

Selective tuning: clients should listen only to potentially useful items and doze to save energy.

Indexed: client looks at a broadcast index to determine what and when to listen to channel. Index can be either precise or imprecise.Non-indexed: client and server agree on the time a resultant item will appear and client can doze and wake up accordingly. e.g., answer available after 200 ms.

Page 8: 第 4 讲 移动数据分发

Mobile Data Delivery

Bandwidth-oriented: consider on the allocation of bandwidth for different data types or mechanisms or structures.

Static allocationCertain percentage of bandwidth (or number of channels) allocated for a publish and other for demand data type; or for server-initiated/client-initiated requests.

The allocation is determined at beginning.

Simple but not adaptive to change of need.

Dynamic allocationNumber of channels or amount of bandwidth for different need would change over time.

The changed need is determined by monitoring for data access pattern.

Page 9: 第 4 讲 移动数据分发

Mobile Data Delivery

Performance metricsResponsiveness: how fast required data items are available.

Characterized by response time (moment when the first data item is available) and access time (moment when all data items are available).

Data affinity: how hungry is client for required data items.A more comprehensive measure over response time and access time.Characterized by aggregated data affinity (integral of missing data items over time).

Tuning efficiency: how long a client stays in active mode for tuning.Characterized by the tuning time (total amount of time spent on listening to the channels in active mode).

Power efficiency: how much energy is consumed for requests.Characterized by queries per watt or useful data per watt.

Packet efficiency: how well are channels bandwidth used for requests.Characterized by queries per Hz or useful data per Hz.

Adaptivity: how system adjusts to system characteristics changes.Definitely bad for static schemes (e.g. static channel allocation, static object classification, static broadcast program).

Page 10: 第 4 讲 移动数据分发

§4.2 Data Broadcast– push-based dissemination

A broadcast program consists of a set of data items, ordered in time of broadcast.

Periodic / aperiodicWhether same broadcast program is repeated and cycle length is the same.Pull-based dissemination is essentially aperiodic.

Equal-sized item / unequal-sized itemWhether data items are of the same size.

Flat program / non-flat programWhether each included data item is broadcast only once or not.Flat programs are easy to handle and index, but non-flat programs can help to reduce access time.

Page 11: 第 4 讲 移动数据分发

Data Broadcast

A B C D

Flat broadcast program

A A A A

Skewed non-flat broadcast program: broadcast items of higher access need more frequently

B C D D

A B A D

Regular non-flat broadcast program: disperse the repeated items evenly

A C A D

(Flat – All items are equally important)

Page 12: 第 4 讲 移动数据分发

Performance Metrics

For a Regular Non-Flat Broadcast Program, the simplified forms for

The Average Waiting Time for an object is equal to the half of the broadcast period of this object.

The Overall Average Waiting Time is equal to the sum of products of the average waiting time of an object and its access probabilityThe Overall Average Access Time is equal to The Overall Average Wait Time + 1 (A request will be processed in next time unit)

Page 13: 第 4 讲 移动数据分发

Data Broadcast

We would like to broadcast the following set of 33 items (item 1 to 33):

Group A are hot items.Group B are ordinary items.Group C are cold items.

2 5 8 1 12 15 18 22 25 28 31

9 6 10 3 13 16 19 23 21 29 32

26 7 11 4 14 17 20 24 27 30 33

A B C

Page 14: 第 4 讲 移动数据分发

Data Broadcast

Generating a flat broadcast program.Broadcast in the standard order.

2 9 26 5 6 7 8 10 11 1 3 4 12 13 14 15 16 17 … 33 2 9 26 … Performance.

Cycle length = 33The average waiting time = 16.5The average access time = 17.5The average tuning time = 17.5The same performance will be resulted if the broadcast program goes like

1 2 3 4 5 6 7 8 9 10 …

Reason:Access frequency or probability has not been taken into account.Broadcast program is cyclic in nature.

Page 15: 第 4 讲 移动数据分发

Data Broadcast

Generating a regular non-flat broadcast program.All items are spaced regularly (equal-spacing).Wong’s Algorithm:

Input: cycle length L and access probabilities q1 to qN (sorted in descending order) for N items.

Output: broadcast schedule.

select integer fi such that and for each pair i and j, the ratio fi / fj is close to

for i = 1 to N do

select integer si as close to L/fi as possible (spacing of items).for i = 1 to N-1 do

assign copies of item i into the broadcast cycle positions with the objective of matching the equal-spacing criterion

assign copies of item N to remaining slots in the broadcast.

ji qq /

LfN

i i 1

Page 16: 第 4 讲 移动数据分发

Data Broadcast Assume that access probability for items in group A, B and C are qA =

4/21, qB = 1/21, qC = 1/168. Thus qA/qB = 4, qA/qC = 32, qB/qC = 8.

Ratio of their square roots = root(4):root(32):root(8) = 2:5.66:2.83. Choosing fA = 6, fB = 3, fC = 1, we have fA/fB = 2, fA/fC = 6, fB/fC = 3.

This ratio 2:6:3 is close enough to the square root of the access frequency ratio above.

Cycle length L = 6x3+3x6+1x24=60. Spacing of items (si) in A, B and C are 10, 20, 60. The broadcast schedule:

2 5 8 1 26 12 15 9 6 10 2 18 2225

26 7 11 9 28 31

9 6 10 2 3 13 16 26 7 11 9 19 23 2 5 8 21 26 29 32

26 7 11 9 4 14 2 5 8 17 26 20 24 9 6 10 2 27 30 33What is the access time?Time

Access Time = 10 +1

Note: you could choose other values for frequency fA, fB, fC, but the cycle length would be different.

Difficulty: hard to choose good frequencies.

Page 17: 第 4 讲 移动数据分发

Broadcast Disk

Item-based broadcast program is expensive to generate, especially when there are many items.

Regular programs respect the equally-spacing property, a necessary condition for optimal access time, with easier management.

Regular programs with close to optimal performance can be generated by collecting items of similar access probability into partitions.

Each partition is viewed as an individual disk. Broadcasting hot partitions more often translates into a disk

spinning with faster speed. This is called the broadcast disk.

Put items into different disks with different spinning speed.Multiplex multiple disks onto the same broadcast channel.This is also called a multi-disk broadcast.

Page 18: 第 4 讲 移动数据分发

order the pages from hottest to coldest. divide the pages into partitions, so that each

partition contains pages with similar access probability.

(Each partition is called a disk. Let there be Num_disk disks.)

select the broadcast frequency fi for each disk i. compute Max_num_chunk = LCM of frequency. compute Num_chunki = Max_num_chunk / fi. divide disk i into Num_chunki chunks. for i = 0 to Max_num_chunk-1 do for j = 1 to Num_disk do

broadcast (i mod Num_chunkj + 1)st chunk of disk j.

Assuming equal-sized data items. For simplicity, each item or each group of items is a page. Acharya, Franklin and Zdonik’s Algorithm:

Broadcast Disk

Page 19: 第 4 讲 移动数据分发

Broadcast Disk

Assume that there are three disks with 2 , 3, and 4 chunks respectively.

The broadcast order would be1, 3, 6, 2, 4, 7, 1, 5, 8, 2, 3, 9, 1, 4, 6, 2, 5, 7, 1, 3, 8, 2, 4, 9, 1, 5, 6, 2, 3, 7, …

1 2

3 4 5

6 7 8 9 6 7 8 9

3 4 5 3 4 5

1 2 1 2 1 2 1 2

6 7

3 4

1 2

8 9

5

Page 20: 第 4 讲 移动数据分发

Broadcast Disk With the same example as before, access probability for items in

group A, B and C are qA = 4/21, qB = 1/21, qC = 1/168. Those 33 items are collected into three disks A, B and C. Assume that the frequency is 4:2:1.

Maximum number of chunks on a disk = 4 (LCM of 4, 2, 1).Number of chunks for disk A, B and C are 4/4=1, 4/2=2 and 4/1=4 respectively.Each chunk in disk A, B and C contain 3/1=3 items, 6/2=3 items and 24/4=6 items respectively.The broadcast schedule (L = 48):

What is the access time?

2 5 1 12 2 8 15 18 2 5 22 25 2 8 28 31

9 6 3 13 9 10 16 19 9 6 23 21 9 10 29 32

26 7 4 14 26 11 17 20 26 7 24 27 26 11 30 33

chunk 1 ofdisk A

Access Time = 10.29 +1

Page 21: 第 4 讲 移动数据分发

Broadcast Disk Repeating the example with access probability for items in group A,

B and C being qA = 4/21, qB = 1/21, qC = 1/168. Assume that the frequency is 6:3:1 instead. Maximum number of chunks on a disk = 6. Number of chunks for each disk are 1, 2 and 6. Chunk sizes for A, B and C are 3, 3, 4. Unused slots when a disk is not divisible well into whole chunks

may be used for auxiliary information such as index. The broadcast schedule (L = 60):

What is the access time?

2 5 112

26

11

15

9 618

2 821

24

26 728

910

31

9 6 3 2 813

16

26

719

910

22

2 525

29

26

11

32

26

7 4 910

14

2 517

20

26

11

23

9 627

2 830

33Time

Access Time = 10 +1

Page 22: 第 4 讲 移动数据分发

Broadcast Disk – an improvement

Sorted data items in the broadcast is usefulE.g. to serve range queries, requesting for a number of items

A simple solution:Sort the items in each partition or chunk in key order.Associate a small description with each chunk on covered range.Client can doze off for irrelevant chunks.

A better solution:Superimpose the repeated (hot) items over the standard items.Determine how many times each hot item is to be broadcast and the number of segments in the broadcast disk algorithm.Sort the original set of all items based on key value.Divide them into segments of approximately equal size.Allocate the repeated items and put them into the appropriate segment, while trying to observe spacing property.Result: client can determine which segments to listen to with range indicator of a segment by answering range queries.

Page 23: 第 4 讲 移动数据分发

Broadcast Disk – an improvement Assuming 4:2:1 frequency, the initial partition (4 segments):

Remaining items (3 more times for items in A and 1 for B):

Final broadcast schedule (cycle length = 48):All slots can be fully occupied and unfilled one can be skipped.

1 4 7 912

15

17

20

23

25

28

31

2 5 810

13

16

18

21

24

26

29

32

3 611

14

19

22

27

30

33

2 2 2 5 8

9 9 9 610

26

26

26

711

1 4 726

211

14

26

2 717

20

23

211

27

30

33

2 5 8 912

15

5 818

21

24

925

28

31

3 6 910

13

16

6 919

22

26

10

26

29

32

Time

Page 24: 第 4 讲 移动数据分发

§4.3 Data Indexing

Indexing, indicating the moment data items are available

Data indexing is very important, especially in data broadcast

Selective tuning based indexing can save access costLoss of an index can cause a data item to be missed and another cycle needs to be waited for.

To reduce tuning time, an indexing structure is needed.

Page 25: 第 4 讲 移动数据分发

Methods in Indexing

Indexing on the airThe index is broadcasted over the broadcast channelClients can tune to get data or meta-data (index)Regular broadcast programs can be associated with smaller indexing information.

Indexing by directoryThe index is pre-loaded to a clientSimple and efficient (no overhead in broadcasting)Problem: directory update?

Indexing by computing The index can be computed by client, if

data items are equal-sized, consecutive key values (e.g., from 1 to N) andthe broadcast algorithm is known by clients.

Page 26: 第 4 讲 移动数据分发

Terms in Indexing

Index segment: a collection of consecutive index pages or buckets.

Data segment: a collection of consecutive data pages or buckets.

File: concatenation of all data segments.

Bcast (broadcast cycle): a file with all interleaving index and data segments.

Tuning time: time a client spent listening to broadcast.

Access time: time a client waits until all required data items are downloaded.

Probe time: time a client waits until the first indexing structure comes (i.e., knows the context of where-am-i).

Bcast wait: time spent since getting an index to getting all items.The file is of constant length, but bcast length is a design parameter.More index pages shorter tuning time but that larger access time.

Page 27: 第 4 讲 移动数据分发

Terms in Indexing

Bucket informationID/type: offset from start of bcast / data bucket or index bucket.Bcast/index pointers: offset to start of next bcast / index segment.Index of data: attribute value, offset pairs for index bucket.

Data access protocolInitial probe: listen to channel / locate start of next index segment.Index access: tune into index segment to get the start of required data segment or bucket.Data access: tune into data bucket for the needed data item.

index segment data segment

Page 28: 第 4 讲 移动数据分发

Simple Indexing

Associate a simple multilevel index (complete index) to all data items at the beginning of a file.

Client listens to index and look for data page. Doze till the data page appears and tune for the item. Disadvantage:

client must wait for index first and then tune for the data, with expected access time of (L+Li) /2(cycle length).

Page 29: 第 4 讲 移动数据分发

B+-tree Indexing

Recall of B+-tree

interior node

leaf node

Page 30: 第 4 讲 移动数据分发

B+-tree Indexing

7 11 +3 +7+11 3 5 +1

3+17

+21 9 0 +2

3+27 0 13 0 +2

8+32 0

1 2 D D +1 3 4 D D +1 5 6 D D +1 7 8 D D +1

9 10 D D +1 11 12 D D +1 13 14 D D 0

7 11 6 11 16 3 5 21 26 31 9 0 36 41 0 13 0 46 51 0

1 2 D D 26 3 4 D D 31 5 6 D D 36 7 8 D D 41

9 10 D D 46 11 12 D D 51 13 14 D D 0

Time Key (interior node) Pointer (index of key) Key at leaf or data

Page 31: 第 4 讲 移动数据分发

(1,m) Indexing

7 11 +3 +7+11 3 5 +1

3+17

+41 9 0 +4

3+67 0 13 0 +6

8+72 0

1 2 D D +1 3 4 D D +21 7 11 +3 +7

+11 3 5 -17 -13

+11

9 0 +13

+37 0 13 0 +3

8+42 0 5 6 D D +1 7 8 D D +2

1

7 11 +3 +7+11 3 5 -47 -43 -19 9 0 -17 +7 0 13 0 +8

+12 0

9 10 D D +1 11 12 D D +1 13 14 D D 0

Time

Improve on simple indexing by providing the complete index segment m times, interleaved in the bcast.

Client can tune for next index segment and then for data. Expected access time is about L(m+1)/2m (e.g., m = 5).

Page 32: 第 4 讲 移动数据分发

(1,m) Indexing

Another replication of index.

7 11 +3 +7+11 3 5 +1

3+17

+21 9 0 +4

3+47 0 13 0 +6

8+72 0

1 2 D D +1 3 4 D D +1 5 6 D D +21 7 11 +3 +7

+11

3 5 -22 -18 -14 9 0 +8+12 0 13 0 +3

3+37 0 7 8 D D +1

9 10 D D +21 7 11 +3 +7

+11 3 5 -52 -48 -44 9 0 -22 -18 0

13 0 +3 +7 0 11 12 D D +1 13 14 D D 0

Time

Page 33: 第 4 讲 移动数据分发

(1,m) Indexing

An improved version.

7 11 +3 +7+11 3 5 +1

3+17

+21 9 0 +3

8+42 0 13 0 +5

3+57 0

1 2 D D +1 3 4 D D +1 5 6 D D +16 7 11 -32 +2 +6

3 5 -22 -18 -14 9 0 +8+12 0 13 0 +2

3+27 0 7 8 D D +1

9 10 D D +21 7 11 -52 -23 +1 3 5 -52 -48 -44 9 0 -22 -18 0

13 0 +3 +7 0 11 12 D D +1 13 14 D D 0

Time

Page 34: 第 4 讲 移动数据分发

Distributed Indexing

Observe that it is useless to provide index to data items that have already passed by in a broadcast in the middle part of bcast.

See the negative offsets in previous example.

Improve on (1,m) indexing by not having to replicate all parts of the index.

Index nodes are mixed within broadcast. Index nodes are broadcast in depth first order. One needs only to provide index for data being broadcast

between current and next index segment. Based upon B+-tree indexing scheme, with replication along the

path from root to current branch of tree. One may also perform no replication or full replication of path

as variation.

Page 35: 第 4 讲 移动数据分发

Distributed Indexing

Add two more pointers to the front and back of each node.Generalized B+-tree index and data node would be:

v1

v2

v3

a1

v1

v2

v3

b1 b2 b3 b4

x y next replicated index node I

next replicated index node a1Data for v1

Data 1x y

<v1 <v2 <v3 v3

next cycle

Page 36: 第 4 讲 移动数据分发

Distributed Indexing

Each node/bucket contains either data or index. For replicated nodes, add two additional pointers:

(x, bcastptr) and (y, indexptr). Items of key less than x have been missed and we should

follow the bucket pointer to next broadcast. Items of key greater than y is not in current branch of data

segment, so go to next segment. Items of key x K y can be found in current branch of

data segment.

Page 37: 第 4 讲 移动数据分发

Distributed Indexing

An example with 243 data items.81 are shown.

3 data items per node.

Page 38: 第 4 讲 移动数据分发

Example of Distributed Indexing

Time

There are three branches without replication I and a1, a2, a3 will be repeated three times for branchs rooted at b1, b2, …, b9. 1st index bucket a1 (for branch b1) : X(1,first I of next bcast) , Y(81,second I of this

bcast) 2nd index bucket a1 (for branch b2), X (28,first I of next bcast) and (81,second I of

this bcast

Page 39: 第 4 讲 移动数据分发

Data Access with Distributed Indexing

1. Tune to the current bucket, read the index pointer pairs and get offset to next index bucket.

2. Tune to beginning of the bucket and read index.If item is missed, get first offset (x-ptr) to next bcast and doze, goto step 2.If item is not in current segment, get second offset (y-ptr) to next higher level index and doze, goto step 3.If item is in current segment, goto step 3.

3. Probe the index bucket and follow the multi-level pointers for the required data bucket.

4. Tune for the required data bucket for the item with key K.

Page 40: 第 4 讲 移动数据分发

Distributed Indexing

If initial probe is at replicated part, cases will be simpler.Example to access item 45 with initial probe at index bucket a1.

Tune to a1, b2, c5, d15 and data bucket for item 45.Example to access item 65 with initial probe at index bucket a1.

Tune to a1, b3, c8, d22 and data bucket for item 65. If initial probe is at data or non-replicated part, we may miss

the data sometimes.Example to access item 45 with initial probe at data bucket 3.

Tune to data 3, pointing to second a1, b2, c5, d15 and data bucket for item 45.

Example to access item 25 with initial probe at data bucket 3.Tune to data 3, pointing to second a1 (missed), next I (next cycle), a1, b1, c3, d9 and data bucket for item 25.

Page 41: 第 4 讲 移动数据分发

Fault-Tolerant Broadcast

Unreliable wireless channels can create major problems.

Missing a data item implies (likely) tuning for next broadcast cycle.Missing an indexing structure would cause item to be missed.

SolutionFault-tolerance to data

Broadcast items more frequently.Broadcast items over several channels.Use error correcting code.

Fault-tolerance to indexReplicate important parts of index.

Page 42: 第 4 讲 移动数据分发

Fault-Tolerance to Index

Naive solution by index replicationTo duplicate the indexing structure on each index bucket.

For example, “hello” can be transmitted as “hheelllloo”.

This is effective assuming independent failure mode of bucket.The problems are

The high overhead in doubling the index length.Burst communication failures are often.

Desirable properties for a solutionDegree of replication should be small.Re-accessing partial index should be minimized

(ensure that existing good index received is useful).Allow tuning to existing version of index bucket within the same bcast, not to the next replicated version.

Page 43: 第 4 讲 移动数据分发

Fault-Tolerance to Index

Inter-index replication schemesCreate redundant pointers to the next more complete indexing structure.That is simpler to implement.Violate the third property by having to tune to the next broadcast cycle.Examples: all children replication and self replication.

Intra-index replication schemesCreate additional pointers to existing indexing structure.More difficult to implement, since pointers must point forward.Allow staying on same broadcast cycle to look for data.Examples: extended tree-based indexing or distributed indexing.

Page 44: 第 4 讲 移动数据分发

All Children Replication (ACR)

A simple solution. For each indexing entry to a child, provide an additional pointer to

the next version of the same child. For example, a pointer to child b1 will also provide an additional

pointer to (b1)2 (next version of b1). Features:

Partial index is not wasted: as search progresses down the index tree and jumps to the parallel version of a failed index at next level. That reduces tuning time.

High cost of replication; Unable to handle two successive failurescannot get to index bucket within the same version

Page 45: 第 4 讲 移动数据分发

Data Access Protocol of ACR

1. Tune for a good bucket and follow the offset to next index bucket.2. Tune for the index bucket. If corrupted, repeat step 1.

Follow the intended index and keep the spare index.If item missed, doze off for next bcast.If item not in segment, doze off for next higher level index.If item in segment, goto step 3.

3. Get the required index bucket.If correct, doze off for the next index bucket down the level and keep the spare index.If incorrect, use spare index to doze off for next version of same index bucket. Reset spare pointer to null. Repeat 3.If out of spare pointer, goto step 1 for next bcast.

4. Tune in for the required data bucket.If there is an error, use the spare pointer and repeat step 4.If out of spare pointer, goto 1 for next bcast.

Page 46: 第 4 讲 移动数据分发

Self Replication Scheme (SR)

Instead of replicating the pointers to all children, just replicate the pointer to next version of myself.

Features:Partial index is not wasted: as search progresses across the index tree and jumps to parallel version of a failed index at same level.cannot survive two successive failures.Indexing cost is lower,

At the expense of one more tuning bucket upon first failure.

cannot get to index bucket within the same version

Page 47: 第 4 讲 移动数据分发

Tree-Based Index Replication Make use of the tree structure to provide pointer replication. Add the (maxvalue, pointer) pair in each index node (except the root). Construct the pair (maxvalue, pointer)

The maxvalue of a node represents the largest data value that can be obtained for the subtree of the node.E.g. maxvalue of b1 is 27

maxvalue of c2 is 18Pointer: (see next slide)

Page 48: 第 4 讲 移动数据分发

Tree-Based Index Replication

DefinitionsFor a node, its ancestor’s maxvaule is greater than or equal to its maxvalue.E_ancestors of a rightmost node: ancestors with the same maxvalue.

E.g. b1 and c3 are the E_ancestors of d9.

F_ancestor of a rightmost node: the E_ancestor furthest away (closest to the root)

Construct Pointers:For each child, except the rightmost: pointing (the offset) to its right sibling. For the rightmost child: pointing to the right sibling of its F_ancestor.

Page 49: 第 4 讲 移动数据分发

Tree-Based Index Replication

Data access protocol1. Tune to current bucket and listen for an error-free bucket.2. If it is an index bucket, get the next bucket pointer, doze for the bucket

and repeat step 1.3. If it is a data bucket, locate for the object. If unsuccessful, goto step 1.

Once you access a corrupted bucket, listen to the next bucket. Since all index bucket contains a pointer to the next index

bucket in the pre-order traversal, no data item will be missed, unless the bucket containing the required data item is also corrupted.

Much higher degree of fault-tolerance compared with two previous schemes, which cannot tolerate two successive failures.

Page 50: 第 4 讲 移动数据分发

Tree-Based Index Replication

Example: tuning for item 54 when first probe is at bucket d1.Error free: d1, second a1, b2, c6, d18, bucket containing 54.Bucket d1 and next bucket are both corrupted:

d1, data bucket under d1, d2, second a1, c6, d18, bucket containing 54. Example: tuning for item 27 when first probe is at bucket d1.

Error free: d1, d2, d3, c2, c3, d9, bucket containing 27d1, second a1, next I, a1, b1, c3, d9, bucket containing 27. (not using additional pointers).

d1 is corrupted: d1, data bucket under d1, d2, d3, c2, c3, d9, bucket containing 27.c2 is corrupted: d1, d2, d3, c2, d4, d5, d6, c3, d9, bucket containing 27

Page 51: 第 4 讲 移动数据分发

§4.4 Pull-based Data Dissemination

Client submits request for item over uplink channel and waits/dozes for the required information.

Stateful server approachClient decides on the moment for the item.Client submits request with expected retrieval and dozes off.Server transmits requested item at pre-determined time.Client downloads item according to its schedule.

Stateless server approachClient submits request and looks for cues from server.Server retrieves item and transmits item with cues, which may be a simple index for existing broadcast cycle (aperiodic broadcast).Client gets cues and can doze off for next set of cues or the data block containing the item.

Stateless server is easier to implement, but client needs to spend more computational effort.

Page 52: 第 4 讲 移动数据分发

Pull-based Data Dissemination

Getting all client requests, server can retrieve requested data items and construct a broadcast.

Server can organize broadcast so as to reduce access time, or aggregate data affinity.Server can collect similar needs of clients and broadcast them together.Server may pre-determine potential useful items and broadcast together in existing cycle.

This allows pre-fetching of mobile clients.Clients that do not raise requests may also benefit from broadcast, by tuning for the index and then their interested items.

One could try to balance between push-based and pull-based data delivery.

Page 53: 第 4 讲 移动数据分发

Fixed-Sized-Object Scheduling for Pull-Based Broadcast Systems

Earliest First Request (EFR)In the order of the arrival time of the first request

Most Requests First (MRF)The data object with the maximum number of pending requests is picked for broadcasting

Most Request First Lowest (MRFL)Use MRF but break ties in favor of the object with the lowest access probability

Longest Wait First (LWF)The object with the longest total waiting time first(The total waiting time of an object is the sum of the time that all pending requests for an object have been waiting).

Page 54: 第 4 讲 移动数据分发

Variable-Sized-Object Scheduling for Pull-Based Broadcast Systems

Shortest Service Time First (SSTF)The object with the shortest service time first

Preemptive Scheduling Schemes – The broadcast of an object can be interrupted

Preemptive Longest Wait First (PLWF) Preemptive Remaining Service Time (PRST) – The preemptive SSTFLongest Total Stretch First (LTSF)

Stretch is the ratio of the access time of a request to its service time (For variable objects, access time is biased to objects with small sizes).The Total Stretch is the sum of the current stretches of all pending requests for an object

MAX: Use the maximum stretch of an object as the deadline for requestsThe objects with earliest deadline first

Page 55: 第 4 讲 移动数据分发

Balancing Push and Pull

Push model is effective with large number of clients and if their needs can be satisfied collectively (certain overlapping in need).

Advantage: scalable and low cost.Disadvantage: no feedback mechanism about effectiveness of broadcast (e.g., cache hit) or change of client need.

Pull model is needed to complement push model for specific client need, especially when their needs are very diversified.

Advantage: flexible and fast with small number of clients.Disadvantage: bandwidth and even server processing power become insufficient with large number of clients and requests.

Performance can be improved by sending requests for data items carefully.

For example, if item is cached, or item is contained in the air cache or air storage (i.e., on the broadcast disk) and will arrive soon, do not send the request.

The bandwidth allocation between push or broadcast channels and pull or point-to-point channels is important. This is similar to a load balancing problem (and can be addressed similarly).

Page 56: 第 4 讲 移动数据分发

Balancing Push and Pull

An integrated push/pull model

requests

cache

Page 57: 第 4 讲 移动数据分发

Balancing Push and Pull

Hybrid-10% means 10% hot objects for broadcast.

Query arrival rate of u is the breakeven point for push / pull models.

Using hybrid push / pull shifts the breakeven points.

The percentage for 10% or 20% should also be dynamic.

Page 58: 第 4 讲 移动数据分发

Balancing Push and Pull

A simple load balancing style of adaptive bandwidth allocation algorithm.

Collect data items into buckets of similar access probability (quantization).

Algorithm:

compute Tbc = broadcast item access timecompute Tod = on demand item access timeif |Tbc – Tod | > tolerance then // consider shift

if Tbc > Tod then // push channel is overloaded move some bucket from push to pull / reallocate bandwidthelse// pull channel is overloaded move some bucket from pull to push / reallocate bandwidth

else // not much difference, do nothing to avoid ping-pongdo nothing

Page 59: 第 4 讲 移动数据分发

A Summary

Different approaches for data disseminationPush

Broadcast Broadcast diskFault tolerant broadcast

PullBalancing push and pull

Data indexingSimple indexing(1,m) indexingDistributed indexingFault tolerance to indexing

Page 60: 第 4 讲 移动数据分发

Homework Questions

1. In Wong’s data broadcast algorithm, why is the ratio fi/fj required to be ?

2. In the indexing example with 243 items, what will happen if a user wants to access item 65 with initial probe at data bucket 3 or index bucket b1 respectively?

3. In the tree-based index replication, tuning for item 27 when first probe is at bucket d1, what will happen if both buckets d1 and c2 are corrupted?

ji qq /