Handling Spatial Data In P2P Systems Verena Kantere, Timos Sellis, Yannis Kouvaras.

Post on 02-Jan-2016

214 views 2 download

Transcript of Handling Spatial Data In P2P Systems Verena Kantere, Timos Sellis, Yannis Kouvaras.

Handling Spatial Data In P2P Systems

Verena Kantere, Timos Sellis, Yannis Kouvaras

Problem Definition

Assumptions: Structure P2P Overlays Spatial Data in Peers

Problem: Necessity for indexing and routing

techniques for such an environment

Technique Requirements

We need a technique that: Guarantees the retrieval of any existing

spatial information in the system Achieves satisfying index size for any node Achieves a satisfying length for any search

path Provides easier access to popular

information Preserves proximity of areas

Related Work

P2PR-tree (Workshop of EDBT ‘04) Quad-tree approach (Poster in

ICDE’05) kd-tree approach (WebDB’04)

Partitioning Space

Spatial Coding

0

1

1

2

2

2

3

3

3

3

4

4

4

5

5 6

0

1

1

2

2

2

3

3

3

3

4

4

4

5

5 6

1

1

02

2

2

3

3

3

3

4

4

4

5

56

Partitioning Space cont’d

The code of an area A is: A azaxay

az: is the granularity level, i.e. the size in terms of cells. ax: is the average of the digit d1 of all the area cells. ay: is the average of the digit d2 of all the area cells.

Distance Metrics:d1(A1, A2) = |a1x-a2x|+|a1y-a2y|d2(A1, A2) = ||a1x-a2x|-|a1y-a2y||

D(A1, A2) d1d2

Dzoom(A1, A2) D(A1, A2)/(0.5*|A1.az+A2.az|)

Distributed Indexing for Spatial Areas

Distributed Indexing Algorithm Step 1: Indexing the grids of each level Phase A: Indexing areas of the same

grid Phase B: Indexing areas of other grids of

the same level Step 2: Indexing the grids of other

levels

Grid Example

0 7 1 6

1 8 3 6

5 6

7 6

9 6

11 6

13 6

3 8

5 8

7 8

9 8

11 8

13 8

2 7

4 7

6 7

8 7

10 7

12 7

14 7

3 4

5 4

7 4

9 4

11 4

2 5

4 5

6 5

8 5

10 5

12 5

5 2

7 2

9 2

4 3

6 3

8 3

10 3

6 1

8 1

7 0

3 10

5 10

7 10

9 10

11 10

5 12

7 12

9 12

2 9

4 9

6 9

8 9

10 9

12 9

4 11

6 11

8 11

10 11

6 13

8 137 14

Direct Neighbors &Data Hashing

Peers have 2 neighbors on each dimension: Horizontal Vertical PerpendicularNeighbors are the closest peers on each

direction. Areas are stored to the closest neighbor

following a priorities of dimensions

Direct Neighbors: Examples

horizontal successor

verticalsuccessor

horizontalpredecessor

verticalpredecessor

1st quadrant2nd quadrant

3rd quadrant 4th quadrant

Routing of Spatial Queries

Basic Routing Algorithm Step 1: Find a peer corresponding to

the same size as the sought area. Step 2: Find a peer hosting the sought

area or an overlapping area of the latterStep 3: Find the peer hosting the sought

area

Routing Example

0 7 1 6

1 8 3 6

5 6

7 6

9 6

11 6

13 6

3 8

5 8

7 8

9 8

11 8

13 8

2 7

4 7

6 7

8 7

10 7

12 7

14 7

3 4

5 4

7 4

9 4

11 4

2 5

4 5

6 5

8 5

10 5

12 5

5 2

7 2

9 2

4 3

6 3

8 3

10 3

6 1

8 1

7 0

3 10

5 10

7 10

9 10

11 10

5 12

7 12

9 127 14

2 9

4 9

6 9

8 9

10 9

12 9

4 11

6 11

8 11

10 11

6 13

8 13

1

2

suc

suc

su

c

suc

suc/pred

3

pred

Details…

0 7 1 6

1 8 3 6

5 6

7 6

9 6

11 6

13 6

3 8

5 8

7 8

9 8

11 8

13 8

2 7

4 7

6 7

8 7

10 7

12 7

14 7

3 4

5 4

7 4

9 4

11 4

2 5

4 5

6 5

8 5

10 5

12 5

5 2

7 2

9 2

4 3

6 3

8 3

10 3

6 1

8 1

7 0

3 10

5 10

7 10

9 10

11 10

5 12

7 12

9 12

2 9

4 9

6 9

8 9

10 9

12 9

4 11

6 11

8 11

10 11

6 13

8 137 14

suc

suc

0 7 1 6

1 8 3 6

5 6

7 6

9 6

11 6

13 6

3 8

5 8

7 8

9 8

11 8

13 8

2 7

4 7

6 7

8 7

10 7

12 7

14 7

3 4

5 4

7 4

9 4

11 4

2 5

4 5

6 5

8 5

10 5

12 5

5 2

7 2

9 2

4 3

6 3

8 3

10 3

6 1

8 1

7 0

3 10

5 10

7 10

9 10

11 10

5 12

7 12

9 12

2 9

4 9

6 9

8 9

10 9

12 9

4 11

6 11

8 11

10 11

6 13

8 13

-2 7 -1 6

-1 8

0 5 1 4 2 3 3 2 4 1 5 0 6 -1 7 -2

0 9

1 10

2 11

3 12

4 13

5 14

6 15

7 16

8 -1

9 0

10 1

11 2

12 3

13 4

14 5

15 6

16 78 15 9 14 10 13 11 12 12 11 13 10 14 9 15 8

7 14

Complexity Characteristics

Complexity for both pure Chord and our method is O(3log2n).

But with our method: Peers with big areas are favored with

small indexes Shorter search paths for bigger areas The search path grows with the

relative distance

Assignment of Peer IDs

The peer ID plays a significant role in our approach joining peers can ask for specific ids: it is adequate to assign an id that

belongs to the same or similar level as the requested id

The above constraint loosens with the size of the area (higher levels are more connected)

Preliminary Experiments

0

1

2

3

4

5

6

6> 12> 24> RANDProximity

Ave

rage

# o

f hop

s

S1024 C1024 S2048 C2048 S4096 C4096

Preliminary Experiments (2)

0

1

2

3

4

5

6

6> 12> 24> RANDProximity

Ave

rage

# o

f hop

s

S400 C400 S900 C900 S1400 C1400