Top Banner
A Distributed Database System - in a dynamic peer-to-peer environment A project by: Claus R. Thrane, Uffe Sørensen, Morten Dahl Jørgensen, Martin Clemmensen
31

A Distributed Database System

Jan 19, 2016

Download

Documents

Colin

- in a dynamic peer-to-peer environment. A Distributed Database System. A project by: Claus R. Thrane, Uffe Sørensen, Morten Dahl Jørgensen, Martin Clemmensen. Agenda. Introduction (Uffe) Motivation Model Networking MANETs P2P and Overlays (Morten) Database Querying (Martin) - PowerPoint PPT Presentation
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: A Distributed Database System

A Distributed Database System

- in a dynamic peer-to-peer environment

A project by:

Claus R. Thrane,Uffe Sørensen,

Morten Dahl Jørgensen,Martin Clemmensen

Page 2: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 2 of 30

Agenda

• Introduction (Uffe)• Motivation• Model

• Networking• MANETs• P2P and Overlays (Morten)

• Database• Querying (Martin)• Data Replication Versus Caching• Distributed Transactions (Claus)

• Conclusion• Model Results• Experiments and Testing (Morten)• Demonstration

Page 3: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 3 of 30

Motivation

• Terma• Client/Server• Ad-hoc P2P (MANET)• “The Travelling Wheelbarrow Problem”

Page 4: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 4 of 30

Project Goals

• Analyze case network requirements and derive theoretical and practical solutions.

• Develop an effective routing technique based on the requirements of the case.

• Develop an effective query scheme based on the requirements of the case.

• Design, implement, test and analyze results of the presented solutions.

Page 5: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 5 of 30

Model

Proof-of-concept

Groups

Proem

ZRP

Any

Page 6: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 6 of 30

MANETs

• M(obile)• Dynamic topology• Limited bandwidth, interference – wireless

• A(d-hoc)• No fixed infrastructure, preferred paths,

designated routers.

• NET(works)• Maintain intra-MANET connectivity• Maintain outside connectivity

Page 7: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 7 of 30

MANET Application

• Vehicular Networking• Trucks as in our case

• Mobile Phones• Festivals – Roskilde 2002• Cities – Context awareness

Page 8: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 8 of 30

Ad-hoc Network Anatomy

• Architectural view:• No distinction between router and host• Dynamic network configuration

No pre-established linksThe network forms the links

Page 9: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 9 of 30

Agenda

• Introduction (Uffe)• Motivation• Model

• Networking• MANETs• P2P and Overlays (Morten)

• Database• Querying (Martin)• Data Replication Versus Caching• Distributed Transactions (Claus)

• Conclusion• Model Results• Experiments and Testing (Morten)• Demonstration

Page 10: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 10 of 30

Peer-to-Peer (P2P)

• Made up by the peers in the network• Built on top of an existing network

• Motivated by its high scalability/reliability

• No predefined roles (client/server)• Abstraction over network - overlay

• Free flat “address space”• Exact location of data not known until “run-

time”• Logical routing and querying

Page 11: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 11 of 30

P2P Network

Page 12: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 12 of 30

P2P Overlay Types

• 1th and 2nd generation: unstructured• Application specific• Little abstraction, more framework• E.g. Napster and Gnutella

• 3rd generation: structured• General purpose• High abstraction: DHT and DOLR• Upper bound on routing (in ideal state)• E.g. Pastry

Page 13: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 13 of 30

P2P and MANETs

• MANETs can be highly mobile• Structures in MANETs should be locality-

aware

• P2P overlays assume a “stable” infrastructure• Upper bound is on logical routing in ideal

state• P2P networks designed to span the globe

• Safari handles large MANETs• Uses a DHT-like structure• Distribute/share responsibility• Small structures

Page 14: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 14 of 30

Agenda

• Introduction (Uffe)• Motivation• Model

• Networking• MANETs• P2P and Overlays (Morten)

• Database• Querying (Martin)• Data Replication Versus Caching• Distributed Transactions (Claus)

• Conclusion• Model Results• Experiments and Testing (Morten)• Demonstration

Page 15: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 15 of 30

Querying

• Query language• Like SQL

• Query Interface• Strictly defined interface

• Case Database Schema• Case databases are heterogeneous• Objects represent physical items

Page 16: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 16 of 30

Query Techniques

• Groups• “Optimized” flooding

• Depth-First Search• Sequential queries

• Breadth-First Search• Flooding

• Local Indices• Answering queries on behalf of

others

Page 17: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 17 of 30

Group Based Querying

• This solution was chosen in our model• Optimized flooding• Performance depends highly on group

construction• Optimizations to group construction can

be made by performing statistical analysis of queries

• In a network with few nodes, performance will be slightly better than flooding

Page 18: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 18 of 30

Data Replication Versus Caching

Replication• Advantages

• Availability• Fault tolerance

• Disadvantages• Traffic increase• Storage usage

increase

Caching• Advantages

• Good enough answers

• No significant traffic increase

• Disadvantages• Storage usage

increase• Not 100% up-to-

date

Page 19: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 19 of 30

Data Replication

• Full replication• Defeats the purpose of P2P/MANETs

• Uniform replication• Fixed number of replicas

• Proportional replication• Replicas of requested objects

• Our Case• Data objects represents physical objects• Large amount of traffic on the network

Page 20: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 20 of 30

Caching

• Caching Queries & Results• Used to provide good-enough answers and

to optimize future queries

• Eavesdropping• Caching results of queries made by others

and heard by the current node

• Our Case• Does not generate excessive amount of

traffic

Page 21: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 21 of 30

Agenda

• Introduction (Uffe)• Motivation• Model

• Networking• MANETs• P2P and Overlays (Morten)

• Database• Querying (Martin)• Data Replication Versus Caching• Distributed Transactions (Claus)

• Conclusion• Results• Experiments and Testing (Morten)• Demonstration

Page 22: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 22 of 30

Concepts of Distributed Transactions

• Simulate atomic operations • Preserve object state consistency and

maximize concurrency• All or Nothing (in case of crashes)• Client, Coordinator and Recoverable

objects

Page 23: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 23 of 30

Distributed Transaction Techniques

• Traditional and distributed• Locks, Optimistic and Timestamp• One/two/three-phase commit

• A transaction in our system• Reserve tire, frame, barrow and mounting

screws

Page 24: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 24 of 30

Transaction Example

Pseudo-code:• T=

openTransaction(abc)• reserveItem(A,tire)• reserveItem(B,frame)• reserveItem(C,barrow)• reserveItem(C,screws)• closeTransaction(T)

•Issues in ad-hoc•Who is coordinator?•Dead-lock detection?•Server crashes / disconnect?

Two-Phase commit

Page 25: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 25 of 30

Model Results

• Goals and Achievements• Overall project• Project results

• Implementation – proof of concept

• Ad-hoc and Peer-to-Peer.

Page 26: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 26 of 30

Agenda

• Introduction (Uffe)• Motivation• Model

• Networking• MANETs• P2P and Overlays (Morten)

• Database• Querying (Martin)• Data Replication Versus Caching• Distributed Transactions (Claus)

• Conclusion• Model Results• Experiments and Testing (Morten)• Demonstration

Page 27: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 27 of 30

Ad-hoc Testing

• Setup and Environment• Two algorithms: proactive and reactive• Three cases: average case and two

“optimized”• Modelled in ns2

Page 28: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 28 of 30

Simulation results

Page 29: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 29 of 30

Query Testing

• Setup and Environment• 20%/60% items in storage• Broadcast/group model• 7/49 nodes• Tightly connected nodes• Implemented using FreePastry with Scribe

Page 30: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 30 of 30

Test Results

• Results• Tightly connected nodes unrealistic

• Future Tests• More realistic environment• More realistic scenario; real-world test• Longer running tests

Page 31: A Distributed Database System

8 January 2006 AALBORG UNIVERSITET Page 31 of 30

Demonstration

DEMO