Where to leave the data ? – Parallel systems – Scalable Distributed Data Structures – Dynamic Hash Table (P2P)

Slides:



Advertisements
Similar presentations
Unit 1:Parallel Databases
Advertisements

CpSc 3220 File and Database Processing Lecture 17 Indexed Files.
Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
External Memory Hashing. Model of Computation Data stored on disk(s) Minimum transfer unit: a page = b bytes or B records (or block) N records -> N/B.
Parallel Databases These slides are a modified version of the slides of the book “Database System Concepts” (Chapter 18), 5th Ed., McGraw-Hill, by Silberschatz,
Parallel Databases By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part C Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
Hash-based Indexes CS 186, Spring 2006 Lecture 7 R &G Chapter 11 HASH, x. There is no definition for this word -- nobody knows what hash is. Ambrose Bierce,
1 Hash-Based Indexes Module 4, Lecture 3. 2 Introduction As for any index, 3 alternatives for data entries k* : – Data record with key value k – –Choice.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Hash-Based Indexes Chapter 11.
Quick Review of Apr 10 material B+-Tree File Organization –similar to B+-tree index –leaf nodes store records, not pointers to records stored in an original.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Hash-Based Indexes Chapter 11.
Hashing and Indexing John Ortiz.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 11 – Hash-based Indexing.
File Processing : Hash 2015, Spring Pusan National University Ki-Joune Li.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 21: Parallel Databases.
Data Warehousing 1 Lecture-25 Need for Speed: Parallelism Methodologies Virtual University of Pakistan Ahsan Abdullah Assoc. Prof. & Head Center for Agro-Informatics.
BTrees & Bitmap Indexes
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part A Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
Peer To Peer Distributed Systems Pete Keleher. Why Distributed Systems? l Aggregate resources! –memory –disk –CPU cycles l Proximity to physical stuff.
Wide-area cooperative storage with CFS
1 SD-Rtree: A Scalable Distributed Rtree Witold Litwin & Cédric du Mouza & Philippe Rigaux.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
1 High-Availability LH* Schemes with Mirroring W. Litwin, M.-A. Neimat U. Paris 9 & HPL Palo-Alto
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Chapter 21: Parallel Databases Chapter 21: Parallel Databases Introduction I/O Parallelism Interquery Parallelism Intraquery Parallelism Intraoperation.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
12.1 Chapter 12: Indexing and Hashing Spring 2009 Sections , , Problems , 12.7, 12.8, 12.13, 12.15,
1 High-Availability in Scalable Distributed Data Structures W. Litwin.
Indexing and hashing Azita Keshmiri CS 157B. Basic concept An index for a file in a database system works the same way as the index in text book. For.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 18: Parallel.
Introduction to Database, Fall 2004/Melikyan1 Hash-Based Indexes Chapter 10.
1.1 CS220 Database Systems Indexing: Hashing Slides courtesy G. Kollios Boston University via UC Berkeley.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Indexed Sequential Access Method.
1 Scalable Distributed Data Structures Part 2 Witold Litwin Paris 9
Marwan Al-Namari Hassan Al-Mathami. Indexing What is Indexing? Indexing is a mechanisms. Why we need to use Indexing? We used indexing to speed up access.
©Silberschatz, Korth and Sudarshan18.1Database System Concepts - 6 th Edition Chapter 18: Parallel Databases Introduction I/O Parallelism Interquery Parallelism.
Lecture 14- Parallel Databases Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan Chapter 21: Parallel Databases.
©Silberschatz, Korth and Sudarshan20.1Database System Concepts 3 rd Edition Chapter 20: Parallel Databases Introduction I/O Parallelism Interquery Parallelism.
CS 540 Database Management Systems
File Processing : Query Processing 2008, Spring Pusan National University Ki-Joune Li.
1 Overview of Query Evaluation Chapter Outline  Query Optimization Overview  Algorithm for Relational Operations.
Azita Keshmiri CS 157B Ch 12 indexing and hashing
Parallel Databases.
Database Management System
Tree-Structured Indexes
Chapter 18: Parallel Databases
(slides by Nick Feamster)
Hash-Based Indexes Chapter 11
Database Management Systems (CS 564)
External Memory Hashing
External Memory Hashing
Hash-Based Indexes Chapter 10
Indexing and Hashing Basic Concepts Ordered Indices
Selected Topics: External Sorting, Join Algorithms, …
Chapter 20: Parallel Databases
Chapter 21: Parallel Databases
Implementation issues
Indexing and Hashing B.Ramamurthy Chapter 11 2/5/2019 B.Ramamurthy.
Database Systems (資料庫系統)
2018, Spring Pusan National University Ki-Joune Li
Chapter 18: Parallel Databases
Evaluation of Relational Operations: Other Techniques
Chapter 11 Instructor: Xin Zhang
Chapter 11: Indexing and Hashing
Chapter 21: Parallel Databases
Presentation transcript:

Where to leave the data ? – Parallel systems – Scalable Distributed Data Structures – Dynamic Hash Table (P2P)

Introduction Parallel machines are quite common and affordable Databases are growing increasingly large – large volumes of transaction data are collected and stored for later analysis. – multimedia objects like images are increasingly stored in databases Large-scale parallel database systems increasingly used for: – storing large volumes of data – processing time-consuming decision-support queries – providing high throughput for transaction processing

Parallelism in Databases Data can be partitioned across multiple disks for parallel I/O. Individual relational operations (e.g., sort, join, aggregation) can be executed in parallel – data can be partitioned and each processor can work independently on its own partition. Queries are expressed in high level language (SQL, translated to relational algebra) – makes parallelization easier. Different queries can be run in parallel with each other.Concurrency control takes care of conflicts. Thus, databases naturally lend themselves to parallelism.

I/O Parallelism Reduce the time required to retrieve relations from disk by partitioning the relations on multiple disks. Horizontal partitioning – tuples of a relation are divided among many disks such that each tuple resides on one disk. Partitioning techniques (number of disks = n): Round-robin: Send the i th tuple inserted in the relation to disk i mod n. Hash partitioning: – Choose one or more attributes as the partitioning attributes. – Choose hash function h with range 0…n - 1 – Let i denote result of hash function h applied tothe partitioning attribute value of a tuple. Send tuple to disk i.

I/O Parallelism (Cont.) Partitioning techniques (cont.): Range partitioning: – Choose an attribute as the partitioning attribute. – A partitioning vector [v o, v 1,..., v n-2 ] is chosen. – Let v be the partitioning attribute value of a tuple. Tuples such that v i v i+1 go to disk I + 1. Tuples with v < v 0 go to disk 0 and tuples with v v n-2 go to disk n-1. E.g., with a partitioning vector [5,11], a tuple with partitioning attribute value of 2 will go to disk 0, a tuple with value 8 will go to disk 1, while a tuple with value 20 will go to disk2.

Comparison of Partitioning Techniques Evaluate how well partitioning techniques support the following types of data access: 1.Scanning the entire relation. 2.Locating a tuple associatively – point queries. – E.g., r.A = Locating all tuples such that the value of a given attribute lies within a specified range – range queries. – E.g., 10 r.A < 25.

Comparison of Partitioning Techniques (Cont.) Round robin: Advantages – Best suited for sequential scan of entire relation on each query. – All disks have almost an equal number of tuples; retrieval work is thus well balanced between disks. Range queries are difficult to process – No clustering -- tuples are scattered across all disks

Comparison of Partitioning Techniques(Cont.) Hash partitioning: Good for sequential access – Assuming hash function is good, and partitioning attributes form a key, tuples will be equally distributed between disks – Retrieval work is then well balanced between disks. Good for point queries on partitioning attribute – Can lookup single disk, leaving others available for answering other queries. – Index on partitioning attribute can be local to disk, making lookup and update more efficient No clustering, so difficult to answer range queries

Comparison of Partitioning Techniques (Cont.) Range partitioning: Provides data clustering by partitioning attribute value. Good for sequential access Good for point queries on partitioning attribute: only one disk needs to be accessed. For range queries on partitioning attribute, one to a few disks may need to be accessed Remaining disks are available for other queries. Good if result tuples are from one to a few blocks. If many blocks are to be fetched, they are still fetched from one to a few disks, and potential parallelism in disk access is wasted – Example of execution skew.

Partitioning a Relation across Disks If a relation contains only a few tuples which will fit into a single disk block, then assign the relation to a single disk. Large relations are preferably partitioned across all the available disks. If a relation consists of m disk blocks and there are n disks available in the system, then the relation should be allocated min(m,n) disks.

Handling of Skew The distribution of tuples to disks may be skewed that is, some disks have many tuples, while others may have fewer tuples. Types of skew: – Attribute-value skew. Some values appear in the partitioning attributes of many tuples; all the tuples with the same value for the partitioning attribute end up in the same partition. Can occur with range-partitioning and hash-partitioning. – Partition skew. With range-partitioning, badly chosen partition vector may assign too many tuples to some partitions and too few to others. Less likely with hash-partitioning if a good hash-function is chosen.

Handling Skew in Range-Partitioning To create a balanced partitioning vector (assuming partitioning attribute forms a key of the relation): – Sort the relation on the partitioning attribute. – Construct the partition vector by scanning the relation in sorted order as follows. After every 1/n th of the relation has been read, the value of the partitioning attribute of the next tuple is added to the partition vector. – n denotes the number of partitions to be constructed. – Duplicate entries or imbalances can result if duplicates are present in partitioning attributes. Alternative technique based on histograms used in practice

Handling Skew using Histograms Balanced partitioning vector can be constructed from histogram in a relatively straightforward fashion Assume uniform distribution within each range of the histogram Histogram can be constructed by scanning relation, or sampling (blocks containing) tuples of the relation

Handling Skew Using Virtual Processor Partitioning Skew in range partitioning can be handled elegantly using virtual processor partitioning: – create a large number of partitions (say 10 to 20 times the number of processors) – Assign virtual processors to partitions either in round-robin fashion or based on estimated cost of processing each virtual partition Basic idea: – If any normal partition would have been skewed, it is very likely the skew is spread over a number of virtual partitions – Skewed virtual partitions get spread across a number of processors, so work gets distributed evenly! /ufs/mk/monet5/Linux/mTests/

Scalable Distributed Data Structures The leading researcher is Withold Litwin

Why SDDSs Multicomputers need data structures and file systems Trivial extensions of traditional structures are not best hot-spots scalability parallel queries distributed and autonomous clients distributed RAM & distance to data

What is an SDDS ? +Data are structured +records with keys objects with an OID + more semantics than in Unix flat-file model + abstraction popular with applications + allows for parallel scans +function shipping +Data are on servers – always available for access +Overflowing servers split into new servers – appended to the file without informing the clients +Queries come from multiple autonomous clients – available for access only on their initiative no synchronous updates on the clients +There is no centralized directory for access computations

+Clients can make addressing errors Clients have less or more adequate image of the actual file structure, Servers are able to forward the queries to the correct address – perhaps in several messages + Servers may send Image Adjustment Messages Clients do not make same error twice See the SDDS talk for more on it – – Or the LH* ACM-TODS paper (Dec. 96) What is an SDDS ?

An SDDS Clients growth through splits under inserts Servers

An SDDS Clients growth through splits under inserts Servers

An SDDS Clients growth through splits under inserts Servers

An SDDS Clients growth through splits under inserts Servers

An SDDS Clients growth through splits under inserts Servers

An SDDS Clients

An SDDS

Clients IAM An SDDS

Clients An SDDS

Clients An SDDS

Known SDDSs Hash SDDS (1993) 1-d tree LH* DDH Breitbart & al RP* Kroll & Widmayer Breitbart & Vingralek m-d trees DS Classics H-Avail. LH*m, LH*g Security LH*s k-RP* dPi-tree Nardelli-tree s-availability LH* SA LH* RS

LH* ( A classic) Allows for the primary key (OID) based hash files – generalizes the LH addressing schema variants used in Netscape products, LH-Server, Unify, Frontpage, IIS, MsExchange... Typical load factor % In practice, at most 2 forwarding messages – regardless of the size of the file In general, 1 m/insert and 2 m/search on the average 4 messages in the worst case Search time of 1 ms (10 Mb/s net), of 150 s (100 Mb/s net) and of 30 s (Gb/s net)

High-availability LH* schemes In a large multicomputer, it is unlikely that all servers are up Consider the probability that a bucket is up is 99 % – bucket is unavailable 3 days per year If one stores every key in only 1 bucket – case of typical SDDSs, LH* included Then file reliability : probability that n-bucket file is entirely up is: 37 % for n = % for n = 1000 Acceptable for yourself ?

High-availability LH* schemes Using 2 buckets to store a key, one may expect the reliability of: – 99 % for n = 100 – 91 % for n = 1000 High-availability files – make data available despite unavailability of some servers RAIDx, LSA, EvenOdd, DATUM... High-availability SDDS – make sense – are the only way to reliable large SDDS files

P2P datastructures

Chord lookup algorithm properties Interface: lookup(key) IP address Efficient: O(log N) messages per lookup – N is the total number of servers Scalable: O(log N) state per node Robust: survives massive failures Simple to analyze

Chord Hashes a Key to its Successor N32 N10 N100 N80 N60 Circular ID Space Successor: node with next highest ID K33, K40, K52 K11, K30 K5, K10 K65, K70 K100 Key ID Node ID

Basic Lookup N32 N10 N5 N20 N110 N99 N80 N60 N40 Where is key 50? Key 50 is At N60 Lookups find the IDs predecessor Correct if successors are correct

Successor Lists Ensure Robust Lookup N32 N10 N5 N20 N110 N99 N80 N60 Each node remembers r successors Lookup can skip over dead nodes to find blocks N40 10, 20, 32 20, 32, 40 32, 40, 60 40, 60, 80 60, 80, 99 80, 99, , 110, 5 110, 5, 10 5, 10, 20

Chord Finger Table Accelerates Lookups N80 ½ ¼ 1/8 1/16 1/32 1/64 1/128

Chord lookups take O(log N) hops N32 N10 N5 N20 N110 N99 N80 N60 Lookup(K19) K19