CC5212-1 P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2014 Aidan Hogan Lecture XI: 2014/06/11.

Slides:



Advertisements
Similar presentations
Introduction to cloud computing Jiaheng Lu Department of Computer Science Renmin University of China
Advertisements

Tomcy Thankachan  Introduction  Data model  Building Blocks  Implementation  Refinements  Performance Evaluation  Real applications  Conclusion.
CS525: Special Topics in DBs Large-Scale Data Management HBase Spring 2013 WPI, Mohamed Eltabakh 1.
Data Management in the Cloud Paul Szerlip. The rise of data Think about this o For the past two decades, the largest generator of data was humans -- now.
Map/Reduce in Practice Hadoop, Hbase, MongoDB, Accumulo, and related Map/Reduce- enabled data stores.
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2014 Aidan Hogan Lecture X: 2014/05/12.
COLUMN-BASED DBS BigTable, HBase, SimpleDB, and Cassandra.
Jennifer Widom NoSQL Systems Overview (as of November 2011 )
Cassandra concepts, patterns and anti-patterns - ApacheCon EU 2012 Cassandra concepts, patterns and anti- patterns Dave ApacheCon.
Bigtable: A Distributed Storage System for Structured Data Presenter: Guangdong Liu Jan 24 th, 2012.
HBase Presented by Chintamani Siddeshwar Swathi Selvavinayakam
Lecture 7 – Bigtable CSE 490h – Introduction to Distributed Computing, Winter 2008 Except as otherwise noted, the content of this presentation is licensed.
Google Bigtable A Distributed Storage System for Structured Data Hadi Salimi, Distributed Systems Laboratory, School of Computer Engineering, Iran University.
7/2/2015EECS 584, Fall Bigtable: A Distributed Storage System for Structured Data Jing Zhang Reference: Handling Large Datasets at Google: Current.
NoSQL and NewSQL Justin DeBrabant CIS Advanced Systems - Fall 2013.
 Pouria Pirzadeh  3 rd year student in CS  PhD  Vandana Ayyalasomayajula  1 st year student in CS  Masters.
CS 405G: Introduction to Database Systems 24 NoSQL Reuse some slides of Jennifer Widom Chen Qian University of Kentucky.
Distributed storage for structured data
Bigtable: A Distributed Storage System for Structured Data
BigTable CSE 490h, Autumn What is BigTable? z “A BigTable is a sparse, distributed, persistent multidimensional sorted map. The map is indexed by.
Inexpensive Scalable Information Access Many Internet applications need to access data for millions of concurrent users Relational DBMS technology cannot.
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2015 Lecture 9: NoSQL I Aidan Hogan
Gowtham Rajappan. HDFS – Hadoop Distributed File System modeled on Google GFS. Hadoop MapReduce – Similar to Google MapReduce Hbase – Similar to Google.
Bigtable: A Distributed Storage System for Structured Data F. Chang, J. Dean, S. Ghemawat, W.C. Hsieh, D.A. Wallach M. Burrows, T. Chandra, A. Fikes, R.E.
Google Bigtable Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber.
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2014 Aidan Hogan Wrap-Up.
HBase A column-centered database 1. Overview An Apache project Influenced by Google’s BigTable Built on Hadoop ▫A distributed file system ▫Supports Map-Reduce.
Getting Biologists off ACID Ryan Verdon 3/13/12. Outline Thesis Idea Specific database Effects of losing ACID What is a NoSQL database Types of NoSQL.
Modern Databases NoSQL and NewSQL Willem Visser RW334.
Google’s Big Table 1 Source: Chang et al., 2006: Bigtable: A Distributed Storage System for Structured Data.
Bigtable: A Distributed Storage System for Structured Data Google’s NoSQL Solution 2013/4/1Title1 Chao Wang Fay Chang, Jeffrey Dean, Sanjay.
BigTable and Accumulo CMSC 461 Michael Wilson. BigTable  This was Google’s original distributed data concept  Key value store  Meant to be scaled up.
Google Bigtable Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber.
1 Dennis Kafura – CS5204 – Operating Systems Big Table: Distributed Storage System For Structured Data Sergejs Melderis 1.
Bigtable: A Distributed Storage System for Structured Data 1.
Google Bigtable Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber.
Big Table - Slides by Jatin. Goals wide applicability Scalability high performance and high availability.
Bigtable: A Distributed Storage System for Structured Data Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows,
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2015 Lecture 11: Conclusion Aidan Hogan
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Exam and Lecture Overview.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Cloud Data Models Lecturer.
CS 347Lecture 9B1 CS 347: Parallel and Distributed Data Management Notes 13: BigTable, HBASE, Cassandra Hector Garcia-Molina.
CSC590 Selected Topics Bigtable: A Distributed Storage System for Structured Data Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A.
NoSQL Or Peles. What is NoSQL A collection of various technologies meant to work around RDBMS limitations (mostly performance) Not much of a definition...
NoSQL Systems Motivation. NoSQL: The Name  “SQL” = Traditional relational DBMS  Recognition over past decade or so: Not every data management/analysis.
Bigtable: A Distributed Storage System for Structured Data
1 HBASE – THE SCALABLE DATA STORE An Introduction to HBase XLDB Europe Workshop 2013: CERN, Geneva James Kinley EMEA Solutions Architect, Cloudera.
Data and Information Systems Laboratory University of Illinois Urbana-Champaign Data Mining Meeting Mar, From SQL to NoSQL Xiao Yu Mar 2012.
Bigtable: A Distributed Storage System for Structured Data Google Inc. OSDI 2006.
Department of Computer Science, Johns Hopkins University EN Instructor: Randal Burns 24 September 2013 NoSQL Data Models and Systems.
Group members: Phạm Hoàng Long Nguyễn Huy Hùng Lê Minh Hiếu Phan Thị Thanh Thảo Nguyễn Đức Trí 1 BIG DATA & NoSQL Topic 1:
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2016 Lecture 11: NoSQL II Aidan Hogan
Bigtable A Distributed Storage System for Structured Data.
Big Data Infrastructure Week 10: Mutable State (1/2) This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States.
1 Gaurav Kohli Xebia Breaking with DBMS and Dating with Relational Hbase.
Plan for Final Lecture What you may expect to be asked in the Exam?
CS 405G: Introduction to Database Systems
and Big Data Storage Systems
HBase Mohamed Eltabakh
Bigtable: A Distributed Storage System for Structured Data
How did it start? • At Google • • • • Lots of semi structured data
CC Procesamiento Masivo de Datos Otoño 2017 Lecture 9: NoSQL
CSE-291 (Cloud Computing) Fall 2016
Modern Databases NoSQL and NewSQL
NOSQL.
NOSQL databases and Big Data Storage Systems
NoSQL Systems Overview (as of November 2011).
Data-Intensive Distributed Computing
NoSQL Databases Antonino Virgillito.
CC Procesamiento Masivo de Datos Otoño Lecture 8 NoSQL: Overview
Presentation transcript:

CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2014 Aidan Hogan Lecture XI: 2014/06/11

Me vs. Google

RECAP: NOSQL

NoSQL

NoSQL vs. Relational Databases What are the big differences between relational databases and NoSQL systems? What are the trade-offs?

The Database Landscape Using the relational model Relational Databases with focus on scalability to compete with NoSQL while maintaining ACID Batch analysis of data Not using the relational model Real-time Stores documents (semi-structured values) Not only SQL Maps Column Oriented Graph-structured data In-Memory Cloud storage

RECAP: KEY–VALUE

Key–Value = a Distributed Map KeyValue …… city:Kabulcountry:Afghanistan,pop: #2013 city:Tiranacountry:Albania,pop: #2013 …… ……

Amazon Dynamo(DB): Model Countries Primary KeyValue Afghanistancapital:Kabul,continent:Asia,pop: #2011 Albaniacapital:Tirana,continent:Europe,pop: #2013 …… Named table with primary key and a value Primary key is hashed / unordered Cities Primary KeyValue Kabulcountry:Afghanistan,pop: #2013 Tiranacountry:Albania,pop: #2013 ……

Amazon Dynamo(DB): Object Versioning Object Versioning (per bucket) – PUT doesn’t overwrite: pushes version – GET returns most recent version

Other Key–Value Stores

RECAP: DOCUMENT STORES

Key–Value Stores: Values are Documents Document-type depends on store – XML, JSON, Blobs, Natural language Operators for documents – e.g., filtering, inv. indexing, XML/JSON querying, etc. KeyValue country:Afghanistan city:Kabul Asia ……

MongoDB: JSON Based o Can invoke Javascript over the JSON objects Document fields can be indexed db.inventory.find({ continent: { $in: [ ‘Asia’, ‘Europe’ ]}}) KeyValue (Document) 6ads786a5a9 { “_id” : ObjectId(“6ads786a5a9”), “name” : “Afghanistan”, “capital”: “Kabul”, “continent” : “Asia”, “population” : { “value” : , “year” : 2011 } ……

Document Stores

TABLULAR / COLUMN FAMILY

Key–Value = a Distributed Map Countries Primary KeyValue Afghanistancapital:Kabul,continent:Asia,pop: #2011 Albaniacapital:Tirana,continent:Europe,pop: #2013 …… Tabular = Multi-dimensional Maps Countries Primary Keycapitalcontinentpop-valuepop-year AfghanistanKabulAsia AlbaniaTiranaEurope ……………

Bigtable: The Original Whitepaper MapReduce authors Why did they write another paper? MapReduce solves everything, right?

Bigtable: Data Model “a sparse, distributed, persistent, multi- dimensional, sorted map.” sparse: not all values form a dense square distributed: lots of machines persistent: disk storage (GFS) multi-dimensional: values with columns sorted: sorting lexicographically by row key map: look up a key, get a value

Bigtable: in a nutshell (row, column, time) → value row: a row id string – e.g., “ Afganistan ” column: a column name string – e.g., “ pop-value ” time: an integer (64-bit) version time-stamp – e.g., value: the element of the cell – e.g., “ ”

Bigtable: in a nutshell (row, column, time) → value ( Afganistan,pop-value,t 4 ) → Primary Keycapitalcontinentpop-valuepop-year Afghanistant1t1 Kabult1t1 Asia t1t t1t t2t t4t t4t Albaniat1t1 Tiranat1t1 Europe t1t t1t t3t t3t ……………

Bigtable: Sorted Keys Primary Keycapitalpop-valuepop-year Asia:Afghanistant1t1 Kabul t1t t1t t2t t4t t4t Asia:Azerbaijan … … … … … … … … … … … … … Europe:Albaniat1t1 Tirana t1t t1t t3t t3t Europe:Andorra……………… ………………… SORTEDSORTED Benefits of sorted keys vs. hashed keys?

Bigtable: Tablets Take advantage of locality of processing! Primary Keycapitalpop-valuepop-year Asia:Afghanistant1t1 Kabul t1t t1t t2t t4t t4t Asia:Azerbaijan … … … … … … … … … … … … … Europe:Albaniat1t1 Tirana t1t t1t t3t t3t Europe:Andorra……………… ………………… ASIAASIA EUROPEEUROPE

Bigtable: Distribution Split by tablet Horizontal range partitioning Pros and cons versus hash partitioning?

Bigtable: Column Families Group logically similar columns together – Accessed efficiently together – Access-control and storage: column family level – If of same type, can be compressed Primary Keypol:capitaldemo:pop-valuedemo:pop-year Asia:Afghanistant1t1 Kabul t1t t1t t2t t4t t4t Asia:Azerbaijan … … … … … … … … … … … … … Europe:Albaniat1t1 Tirana t1t t1t t3t t3t Europe:Andorra……………… …………………

Bigtable: Versioning Similar to Apache Dynamo (so no “fancy” slide) – Cell-level – 64-bit integer time stamps – Inserts push down current version – Lazy deletions / periodic garbage collection – Two options: keep last n versions keep versions newer than t time

Bigtable: SSTable Map Implementation 64k blocks (default) with index in footer (GFS) Index loaded into memory, allows for seeks Can be split or merged, as needed Primary Keypol:capitaldemo:pop-valuedemo:pop-year Asia:Afghanistant1t1 Kabul t1t t1t t2t t4t t4t Asia:Azerbaijan … … … … … … … … … … … … … Asia:Japan … … … … … … Asia:Jordan … … … … … … … … … … … … … Block 0 / Offset 0 / Asia:Afghanistan Block 1 / Offset / Asia: Japan Index:

Bigtable: Buffered/Batched Writes GFS In-memory Tablet log Memtable WRITE READ Tablet SSTable1SSTable2SSTable3 Merge-sort

Bigtable: Redo Log If machine fails, Memtable redone from log GFS In-memory Tablet SSTable1SSTable2SSTable3 Tablet log Memtable

BigTable: Minor Compaction When full, write Memtable as SSTable GFS In-memory Tablet log Tablet SSTable1SSTable2SSTable3 Memtable SSTable4 Memtable

BigTable: Merge Compaction Merge some of the SSTables (and the Memtable) GFS In-memory Tablet log Tablet SSTable1SSTable2SSTable3 Memtable SSTable4 Memtable SSTable1 READ

BigTable: Major Compaction Merge all SSTables (and the Memtable) GFS In-memory Tablet log Tablet SSTable1SSTable2SSTable3 Memtable SSTable4 Memtable SSTable1 READ SSTable1

Bigtable: Hierarchical Structure

Bigtable: Consistency CHUBBY: Distributed consensus tool based on PAXOS – Maintains consistent replicas Five replicas: one master and four slaves – Co-ordinates distributed locks – Stores location of main “root tablet” Do we think it’s a CP system or an AP system?

Bigtable: A Bunch of Other Things Locality groups: Group multiple column families together; assigned a separate SSTable Select storage: SSTables can be persistent or in-memory Compression: Applied on blocks; custom compression can be chosen Caches: SSTable-level and block-level Bloom filters: Find negatives cheaply …

Aside: Bloom Filter Create a bit array of length m (init to 0’s) Create k hash functions that map an object to an index of m (even distribution) Index o: set m[hash 1 (o)], …, m[hash k (o)] to 1 Query o: – any m[hash 1 (o)], …, m[hash k (o)] set to 0 = not indexed – all m[hash 1 (o)], …, m[hash k (o)] set to 1 = might be indexed Reject “empty” queries using very little memory!

Bigtable: Apache HBase Open-source implementation of Bigtable ideas

The Database Landscape Using the relational model Relational Databases with focus on scalability to compete with NoSQL while maintaining ACID Batch analysis of data Not using the relational model Real-time Stores documents (semi-structured values) Not only SQL Maps Column Oriented Graph-structured data In-Memory Cloud storage

GRAPH DATABASES

Data = Graph Any data can be represented as a directed labelled graph (not always neatly)] When is it a good idea to consider data as a graph? When you want to answer questions like: How many social hops is this user away? What is my Erdős number? What connections are needed to fly to Perth? How are Einstein and Godel related?

RelFinder

Graph Databases (Fred,IS_FRIEND_OF,Jim) (Fred,IS_FRIEND_OF,Ted) (Ted,LIKES,Zushi_Zam) (Zuzhi_Zam,SERVES,Sushi) …

Graph Databases: Index Nodes (Fred,IS_FRIEND_OF,Jim) (Jim,LIKES,iSushi) Fred ->

Graph Databases: Index Relations (Ted,LIKES,Zushi_Zam) (Jim,LIKES,iSushi) LIKES ->

Graph Databases: Graph Queries (Fred,IS_FRIEND,?friend) (?friend,LIKES,?place) (?place,SERVES,?sushi) (?place,LOCATED_IN,New_York)

Graph Databases: Path Queries (Fred,IS_FRIEND*,?friend_of_friend) (?friend_of_friend,LIKES,Zushi_Zam) What about scalability?

Graph Database: Index-free Adjacency FredIS_FRIEND_OFTed FredIS_FRIEND_OFJim LIKESiSushi FredIS_FRIEND_OFJim TedLIKESZushi Zam FredIS_FRIEND_OFTed iSushiSERVESSushi iSushiLOCATED_INNew York JimLIKESiSushi

Leading Graph Database

SPARQL

CASSANDRA

Apache Cassandra: Key–Value or Table?

Cassandra: Hashing of Dynamo Unsorted keys

Cassandra: Distribution of Dynamo Or a custom partitioner … Typically hash-based

Cassandra: Eventual Consistency of Dynamo AP: Eventual consistency, High availability C AP AP : If someone cannot be reached, they all go downtown but might not end up at the same place. But (like Dynamo), tables are tunable towards CP

Cassandra: Eventual Consistency using Merkle Trees like Dynamo Merkle tree is a hash tree Nodes have hashes of their children Leaf node hashes from data: keys or ranges

Cassandra: Tuneable Consistency like Dynamo Tuneable consistency Write = Commit Log + Memtable Quorom = Majority of replicas: ⌊ R/2 ⌋ +1 for R the replication factor Hinted handoff: central 3 hour TODO log (not readable) LevelExplanation ANYOne replica node or a hinted handoff ONEOne replica node (hinted handoff not enough) TWOTwo replica nodes THREEThree replica nodes QUORUMA quorum of replica nodes ALLAll replica nodes Higher availability Stronger Consistency

Cassandra: Columns of Bigtable Primary Keycapitalpop-valuepop-year Asia:Afghanistant1t1 Kabul t1t t1t t2t t4t t4t Europe:Ireland … … … … … … … … … … … … … Europe:Albaniat1t1 Tirana t1t t1t t3t t3t SAmerica:Chile……………… ………………… UNSORTEDUNSORTED Also allows for indexing columns Partition key unsorted, but can sort on another key (e.g., population) for range queries

Cassandra: Column Families of Dynamo Primary Keypol:capitaldemo:pop-valuedemo:pop-year Asia:Afghanistant1t1 Kabul t1t t1t t2t t4t t4t Asia:Azerbaijan … … … … … … … … … … … … … Europe:Albaniat1t1 Tirana t1t t1t t3t t3t Europe:Andorra……………… ………………… Rows can also be “jagged”

Dynamo vs. Bigtable vs. Cassandra DynamoBigtableCassandra Data Modelkey–valuetable/ multi-dim. map table/ multi-dim. map Indexinghashingsorted Partitionhash/random, etc.sorted tabletshash/random, etc. Consistencyeventual (tuneable)strongeventual (tuneable) Availabilitystrongweakstrong Managementpeer-basedhierarchicalpeer-based SPOF?no(chubby)no

Cassandra Query Language (CQL) SQL Like:

RECAP

Recap Relational Databases don’t solve everything – SQL and ACID add overhead – Distribution not so easy NoSQL: what if you don’t need SQL or ACID? – Something simpler – Something more scalable – Trade efficiency against guarantees

NoSQL: Trade-offs Simplified transactions (no ACID) Simplified (or no) query language – Procedural or a subset of SQL Simplified query alegbra – Often no joins Simplified data model – Often map-based Simplified replication – Consistency vs. Availability Simplifications enable scale to thousands of machines. But a lot of relational database features are lost!

NoSQL Overview Map

Types of NoSQL Store Key–Value Stores (e.g., Dynamo): – Distributed unsorted maps – Some have secondary indexes Document Stores (e.g., MongoDB): – Map values are documents (e.g., JSON, XML) – Built-in document functions/indexable fields Table/Column-Based Stores (e.g., Bigtable): – Distributed multi-dimensional sorted maps – Distribution by Tablets/Column-families Graph Stores (e.g., Neo4J) – Stores vertices and relations: Index-free adjacency – Query languages for paths, reachability, etc. Hybrid/mix/other (e.g., Cassandra)

Type of Optimisations In-memory buffer indexes (memtable) – Commit log used for failures Intermittent index merging Hash ring used for dynamic partitions Merkle trees used for consistency checks Versioning allows for lazy deletions Trade consistency for availability by reducing quorum requirements Bloom filters to find empty queries Compression, Caches, Locality, Rack Awareness

Questions

World Cup