Caching and Data Consistency in P2P Dai Bing Tian Zeng Yiming.

Slides:



Advertisements
Similar presentations
CAN 1.Distributed Hash Tables a)DHT recap b)Uses c)Example – CAN.
Advertisements

An Array-Based Algorithm for Simultaneous Multidimensional Aggregates By Yihong Zhao, Prasad M. Desphande and Jeffrey F. Naughton Presented by Kia Hall.
Pastry Peter Druschel, Rice University Antony Rowstron, Microsoft Research UK Some slides are borrowed from the original presentation by the authors.
Scalable Content-Addressable Network Lintao Liu
Peer-to-Peer Systems Chapter 25. What is Peer-to-Peer (P2P)? Napster? Gnutella? Most people think of P2P as music sharing.
C-Store: Self-Organizing Tuple Reconstruction Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY Apr. 17, 2009.
Technische Universität Chemnitz Kurt Tutschku Vertretung - Professur Rechner- netze und verteilte Systeme Chord - A Distributed Hash Table Yimei Liao.
Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Schenker Presented by Greg Nims.
Common approach 1. Define space: assign random ID (160-bit) to each node and key 2. Define a metric topology in this space,  that is, the space of keys.
Thomas ZahnCST1 Seminar: Information Management in the Web Query Processing Over Peer- to-Peer Data Sharing Systems (UC Santa Barbara)
A Scalable Content Addressable Network (CAN)
Scribe: A Large-Scale and Decentralized Application-Level Multicast Infrastructure Miguel Castro, Peter Druschel, Anne-Marie Kermarrec, and Antony L. T.
Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
SplitStream: High-Bandwidth Multicast in Cooperative Environments Marco Barreno Peer-to-peer systems 9/22/2003.
Internet Networking Spring 2006 Tutorial 12 Web Caching Protocols ICP, CARP.
Peer to Peer File Sharing Huseyin Ozgur TAN. What is Peer-to-Peer?  Every node is designed to(but may not by user choice) provide some service that helps.
Storage Management and Caching in PAST, a large-scale, persistent peer- to-peer storage utility Authors: Antony Rowstorn (Microsoft Research) Peter Druschel.
Cis e-commerce -- lecture #6: Content Distribution Networks and P2P (based on notes from Dr Peter McBurney © )
Topics in Reliable Distributed Systems Lecture 2, Fall Dr. Idit Keidar.
A Scalable Content-Addressable Network Authors: S. Ratnasamy, P. Francis, M. Handley, R. Karp, S. Shenker University of California, Berkeley Presenter:
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #13 Web Caching Protocols ICP, CARP.
presented by Hasan SÖZER1 Scalable P2P Search Daniel A. Menascé George Mason University.
SCALLOP A Scalable and Load-Balanced Peer- to-Peer Lookup Protocol for High- Performance Distributed System Jerry Chou, Tai-Yi Huang & Kuang-Li Huang Embedded.
Internet Networking Spring 2002 Tutorial 13 Web Caching Protocols ICP, CARP.
Content Addressable Networks. CAN Associate with each node and item a unique id in a d-dimensional space Goals –Scales to hundreds of thousands of nodes.
Squirrel: A decentralized peer- to-peer web cache Paul Burstein 10/27/2003.
Topics in Reliable Distributed Systems Fall Dr. Idit Keidar.
1 CS 194: Distributed Systems Distributed Hash Tables Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
Wide-area cooperative storage with CFS
P2P Course, Structured systems 1 Introduction (26/10/05)
ICDE A Peer-to-peer Framework for Caching Range Queries Ozgur D. Sahin Abhishek Gupta Divyakant Agrawal Amr El Abbadi Department of Computer Science.
1CS 6401 Peer-to-Peer Networks Outline Overview Gnutella Structured Overlays BitTorrent.
INTRODUCTION TO PEER TO PEER NETWORKS Z.M. Joseph CSE 6392 – DB Exploration Spring 2006 CSE, UT Arlington.
1 A scalable Content- Addressable Network Sylvia Rathnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker Pirammanayagam Manickavasagam.
Roger ZimmermannCOMPSAC 2004, September 30 Spatial Data Query Support in Peer-to-Peer Systems Roger Zimmermann, Wei-Shinn Ku, and Haojun Wang Computer.
Other Structured P2P Systems CAN, BATON Lecture 4 1.
Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual.
Chapter 17 Domain Name System
1 SD-Rtree: A Scalable Distributed Rtree Witold Litwin & Cédric du Mouza & Philippe Rigaux.
GeoGrid: A scalable Location Service Network Authors: J.Zhang, G.Zhang, L.Liu Georgia Institute of Technology presented by Olga Weiss Com S 587x, Fall.
Introduction of P2P systems
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
Content Addressable Network CAN. The CAN is essentially a distributed Internet-scale hash table that maps file names to their location in the network.
A Scalable Content-Addressable Network (CAN) Seminar “Peer-to-peer Information Systems” Speaker Vladimir Eske Advisor Dr. Ralf Schenkel November 2003.
Presentation 1 By: Hitesh Chheda 2/2/2010. Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT Laboratory for Computer Science.
1 Kyung Hee University Chapter 18 Domain Name System.
An Improved Kademlia Protocol In a VoIP System Xiao Wu , Cuiyun Fu and Huiyou Chang Department of Computer Science, Zhongshan University, Guangzhou, China.
An IP Address Based Caching Scheme for Peer-to-Peer Networks Ronaldo Alves Ferreira Joint work with Ananth Grama and Suresh Jagannathan Department of Computer.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Scalable Content- Addressable Networks Prepared by Kuhan Paramsothy March 5, 2007.
Peer to Peer A Survey and comparison of peer-to-peer overlay network schemes And so on… Chulhyun Park
Lecture 12 Distributed Hash Tables CPE 401/601 Computer Network Systems slides are modified from Jennifer Rexford.
1 Distributed Hash Table CS780-3 Lecture Notes In courtesy of Heng Yin.
Plethora: Infrastructure and System Design. Introduction Peer-to-Peer (P2P) networks: –Self-organizing distributed systems –Nodes receive and provide.
1 30 November 2006 An Efficient Nearest Neighbor (NN) Algorithm for Peer-to-Peer (P2P) Settings Ahmed Sabbir Arif Graduate Student, York University.
Squirrel: A decentralized peer-to- peer web cache Paper by Sitaram Iyer, Antony Rowstron and Peter Druschel (© 2002) Presentation* by Alexander Prohaska.
BATON A Balanced Tree Structure for Peer-to-Peer Networks H. V. Jagadish, Beng Chin Ooi, Quang Hieu Vu.
INTERNET TECHNOLOGIES Week 10 Peer to Peer Paradigm 1.
P2P Search COP P2P Search Techniques Centralized P2P systems  e.g. Napster, Decentralized & unstructured P2P systems  e.g. Gnutella.
CSCI 599: Beyond Web Browsers Professor Shahram Ghandeharizadeh Computer Science Department Los Angeles, CA
Large Scale Sharing Marco F. Duarte COMP 520: Distributed Systems September 19, 2004.
Distributed Caching and Adaptive Search in Multilayer P2P Networks Chen Wang, Li Xiao, Yunhao Liu, Pei Zheng The 24th International Conference on Distributed.
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
Pastry Scalable, decentralized object locations and routing for large p2p systems.
Controlling the Cost of Reliability in Peer-to-Peer Overlays
COS 461: Computer Networks
CHAPTER 3 Architectures for Distributed Systems
Internet Networking recitation #12
Net 323 D: Networks Protocols
COS 461: Computer Networks
Presentation transcript:

Caching and Data Consistency in P2P Dai Bing Tian Zeng Yiming

Caching and Data Consistency Why Caching  Caching helps use bandwidth more efficiently The data consistency in this topic is different from the consistency in distributed database It refers to the consistency between cached copy and data on servers.

Introduction Caching is built based on current P2P architectures like CAN, BestPeer, Pastry, etc. Caching layer is between application layer and P2P layer. Every peer has its cache control unit and its local cache, and publish the cache contents

Presentation Order We will present four papers, they are  Squirrel  PeerOLAP  Caching for Range Queries With CAN With DAG

Overview PaperBased onCachingConsistency SquirrelPastryYes PeerOLAPBestPeerYesNo RQ with CANCANYes RQ with DAG Not Specified Yes

Squirrel Enables web browsers on desktop machines to share their local caches Uses a self-organizing, peer-to-peer network Pastry as its object location service Pastry is fault resilient, so is Squirrel

Web Caching Web browser generate HTTP GET requests If the object is in the local cache, return it if “fresh” enough “freshness” can be checked by submitting cGET request If no such object, issue GET request to the server For simplicity, we assume objects are cacheable

Home Node As described in Pastry, every peer (node) has its nodeID objectID = SHA-1 (obj URL) This object is assigned to the node whose ID is numerically nearest to the objectID The node who owns this object is called the home node of this object

Two approaches There are two approaches of Squirrel  Home-store  Directory Home-store stores the object directly in the cache of the home node Directory stores the pointer to the nodes who have this object in its cache, these nodes are called delegates

Home-store Origin Server Requester Home Node LAN WAN Request Routed Through Pastry Request for A Is my copy of A fresh? Send A over Yes, it is fresh Request for A Is my copy of A fresh? Send A over Yes, it is fresh

Directory Origin Server Home Node Requester LAN WAN Request Routed Through Pastry Delegate Request for A Get it from D Request for A Send A over No directory Get it from Server Request for A Send A over Request for A I’m your delegate Is my copy of A fresh? Yes, it is fresh Update Meta-info Keep the directory Requester and I are your delegates

Conclusion The home-store approach is less complicated, but it does not have any collaboration The directory approach is more collaborative, it has the ability to store more objects in those peers with larger cache capacity, by setting the pointers to these peers in the directory

PeerOLAP OnLine Analytical Processing (OLAP) query typically involves large amounts of data Each peer has a cache containing some results An OLAP query can be answered by combining partial results from many peers PeerOLAP acts as a large distributed cache

Data Warehouse & Chunk “A data warehouse is based on a multidimensional data model which views data in the form of a data cube.” –Han & Kamber Date Product Country sum TV VCR PC 1Qtr 2Qtr 3Qtr 4Qtr U.S.A Canada Mexico sum

PeerOLAP network LIGLO servers provide global name lookup and maintain a list of active peers Except for LIGLO servers, the network is fully distributed without any centralized administration point LIGLO Data Warehouse Peer

Query Processing Assumption 1: Only chunks at the same aggregation level as the query are considered Assumption 2: The selecting predicates is a subset of grouping-by predicates

Cost Model Every chunk is associated with a cost value, indicating how long it spends to get this chunk

Eager Query Processing (EQP) Peer P sends requests for the missing chunks to all its neighbors, Q 1, Q 2,.... Q k Each Q i provides the desired chunks as many as possible, return to P with a cost associated with each chunk Q i then propagates the requests to all its neighbors recursively In order to avoid flooding, h max is set to limit the depth of the search

EQP (Contd.) P collects (chunk, cost) pairs from all its neighbors Random select one chunk c i, and find the peer who can provide it with lowest cost, Q i For the subsequent chunks, it evaluates the minimum of two cases: the peer with lowest cost is not connected yet, or some existing peer who can also provide this chunk Ask for chunks from these peers and the rest missing chunks from the warehouse.

Lazy Query Processing (LQP) Instead of propagating the requests from each Qi to all its neighbors, each Qi selects its most beneficial neighbor, and forward the request. Given the expected number of neighbors a peer has is k, EQP will visit O(k^h max ) nodes, LQP only visit O(kh max )

Chunk Replacement Least Benefit First (LBF) Similar to LRU, every chunk has a weight Once the chunk is used by P, its weight is set back to the original benefit value Every time there is a new chunk come in, the weight of old chunks will reduce

Collaboration LBF gives local chunk replacement algorithm 3 variations of global behavior  Isolated Caching Policy: non-collaborative  Hit Aware Caching Policy: collaborative  Voluntary Caching: highly collaborative

Network Reorganization Optimization can be done by creating virtual neighborhoods of peers with similar query patterns So that there is a high probability for P to get missing chunks directly from neighbors Each connection is assigned a benefit value and the most beneficial connections are selected to be the peer’s neighbors

Conclusion PeerOLAP is a distributed caching system for OLAP results By sharing the contents of individual caches, PeerOLAP constructs a large virtual cache which can benefit all peers PeerOLAP is fully distributed and highly scalable

Caching For Range Queries Range Query:  E.g. SELECT Student.name WHERE 20<Student.age<30 Why Cache?  Data source too far away from the requesting node  Data source overloaded with queries  Data source is a single point of failure What to cache?  All tuples falling in the range Who cache?  Peers responsible for the range

Problem Definition Given a relation R, and a range attribute A, we assume that the results of prior range-selection queries of the form R.A(LOW, HIGH) are stored at the peers. When a query is issued at a peer which requires the retrieval of tuples from R in the range R.A(low, high), we want to locate a peer in the system which already stores tuples that can be accessed to compute the answer.

A P2P Framework for Caching Range Queries Based on CAN. Map data into 2d virtual space, where d is # dimensions of the relation. For every dimension/attribute, say its domain is [a, b], it is mapped to a square virtual hash space whose corner coordinates are (a,a), (b,a), (b,b) and (a,b). The virtual hash space is further partitioned into rectangular areas, each of which is called a zone.

Example Virtual hash space for an attribute whose domain is [10,70] zone-1: zone-5: zone-8:

Terminology Each zone is assigned to a peer. Active Peer  Owns a zone Passive Peer  Not participate in the partitioning, register itself with an active peer Target Point  A range [low,high] is hashed to a point with coordinates (low,high) Target Zone  Where the target point resides Target Node  The peer that owns the target zone  “Stores” the tuples falling into the range which is mapped to the its zone Caches the tuples in the local cache; OR Stores a pointer to the peer who caches the tuples

Zone Maintenance Initially, only the data source is the active node and the entire virtual hash space is its zone A zone split happens under two conditions:  Heavy Answering Load  Heavy Routing Load

Example of Zone Splits If a zone has too many queries to answer  It finds the x-median and y-median of the stored results. Determine if a split at x-median or y-median results in even distribution of stored answers and the space. If a zone is overloaded because of routing queries  It splits the zone from the midpoint of the longer side.

Answering A Range Query If an active node poses the query, the query is initiated from the corresponding zone; if a passive node poses the query, it contacts any active node from where the query starts routing. 2 steps involved  Query Routing  Query Forwarding

Query Routing If the target point falls in this zone Return this zone Else Route the query to the neighbor who is closest to the target point (26,30)

Query Routing If the target point falls in this zone Return this zone Else Route the query to the neighbor who is closest to the target point (26,30)

Query Routing If the target point falls in this zone Return this zone Else Route the query to the neighbor who is closest to the target point (26,30)

Forwarding If the results are stored in the target node, then the results are sent back to the querying node Else, it is still possible that zones lie in the upper left area of the target point store the results. So we need to forward the query to these zones too.

Example If no results are found in zone-7, the shaded region may still contains the results. Reason: Any prior range query q whose range subsumes (x,y) must be hashed into the shaded region.

Forwarding (Cont.) How far should it go?  For a range (low,high), we want to restrict to results falling in (low- offset,high+offset), where offset = AcceptableFit x |domain|.  AcceptabelFit [0,1]  The shaded square defined by the target point and offset is called the Acceptable Region offset

Forwarding (Cont.) Flood Forwarding  A naïve approach. Forward to the left and top neighbors if they fall in the acceptable region Directed Forwarding  Forward to the neighbor that maximally overlaps with the acceptable region  Can bound the number of forwards by specifying a limit d, which is decremented for every forward.

Discussion Improvements  Lookup During Routing  Warm up queries Peer soft-departure & Failure event Update—cache consistency  Say a tuple t with range attribut a=k is updated in the data source, then the target zone of point (k,k) and all zones lie in the upper left region have to update their cache.

Range Addressable Network: A P2P Cache Architecture for Data Ranges Assumption:  Tuples stored in the system are labeled 1,2,…,N according to the range attribute  A range [a,b] is a contiguous subset of {1,2,…,N}, where 1<=a<=b<=N Objective:  Given a query range [a,b], peers cooperatively find results falling in the shortest superset of [a,b], if they are cached somewhere.

Overview Based on Range Addressable DAG (Directed Acyclic Graph) Map every active node in the P2P system to a group of nodes in the DAG A node is responsible for storing results and answering queries falling into a specific range

Range Addressable DAG The entire universe [1,N] is mapped to the root. Recursively divide one node into 3 overlapping intervals of equal length.

Range Lookup Input: a query range q=[a,b], a node v in DAG Output: the shortest range in DAG that contains q boolean down=true; search (q, v) { if q i(v) search (q, parent(v)); if q i(child(v)) & down search (q, child(v)); else if some range stored at v is a superset of q return the shortest range containing q that is stored at v or parent(v); (*) else down=false; search(q,parent(v)); } Q: [7,10] [5,12] [7,13]

Peer Protocol Maps the logical DAG structure to physical peers Two components  Peer Management Handles peer joining, leaving, failure  Range Management Deals with query routing and updates

Peer Management It ensures that at any time,  every node in the DAG is assigned to some peer  the nodes belonging to one peer, called a zone, is a connected component of the DAG This is done by handling Join Request, Leave Request, Failure Event properly.

Join Request The first peer joining the system takes over the entire DAG A new peer joining the system contacts one of the peers in the system to take over one of its child zones. Default strategy: left child, then mid child, then right child.

Join Request The first peer joining the system takes over the entire DAG A new peer joining the system contacts one of the peers in the system to take over one of its child zones. Default strategy: left child, then mid child, then right child.

Join Request The first peer joining the system takes over the entire DAG A new peer joining the system contacts one of the peers in the system to take over one of its child zones. Default strategy: left child, then mid child, then right child.

Join Request The first peer joining the system takes over the entire DAG A new peer joining the system contacts one of the peers in the system to take over one of its child zones. Default strategy: left child, then mid child, then right child.

Leave Request When a peer wants to leave (soft departure), it hands over its zone to the smallest neighboring zone. Neighboring zones: there is a parent-child relationship among any nodes in the zones

Leave Request When a peer wants to leave (soft departure), it hands over its zone to the smallest neighboring zone. Neighboring zones: there is a parent-child relationship among any nodes in the zones

Failure Event A zone maintains info on all its ancestors. So in case it finds out one of its parents failed, it contacts the nearest alive ancestor for zone takeover.

Range Management Range Lookup Range Update  When a tuple is updated in the data source, we locate the peer with the shortest range containing that tuple, then update this peer and all its ancestors.

Improvement Cross Pointers  For a node v, if it’s the left child of its parent, then it keeps cross pointers to all the left children of nodes that are in its parent’s level.  Similarly for mid child.

Improvement (Cont.) Load Balancing by Peer Sampling  Collapsed DAG: collapse each peer’s zone to a single node.  The system is balanced if the collapsed DAG is balanced.  Lookup time is O(h) where h is the height of the collapsed DAG. Hence a balanced system leads to optimal performance.  When a new peer joins, it polls k peers randomly, and send join request to the one whose zone is rooted nearest to the root. P2 P1 P3 Collapsed DAG: P1 P2P3

Improvement (Cont.) Load Balancing by Peer Sampling  Collapsed DAG: collapse each peer’s zone to a single node.  The system is balanced if the collapsed DAG is balanced.  Lookup time is O(h) where h is the height of the collapsed DAG. Hence a balanced system leads to optimal performance.  When a new peer joins, it polls k peers randomly, and send join request to the one whose zone roots nearest to the root. Collapsed DAG:

Conclusion Caching Range Queries based on CAN  Maps every attribute into a 2D space  The space is divided into zones  Peers manage their respective zones  A range [low,high] is mapped to a point (low,high) in the 2D space  Query Routing & Query Forwarding

Conclusion (Cont.) Range Addressable Network  Model ranges as DAG  Every peer takes responsibility of a group of nodes in DAG  Querying involves traversal of the DAG