SlideShare a Scribd company logo
1 of 50
CS 542 Database Management Systems Parallel and Distributed Databases Introduction to NoSQL databases and MapReduce J Singh  February 14, 2011
Today’s meeting Parallel and Distributed Databases, Chapter 20.1 – 20.4 But only a part of 20.4, the rest w/ Query Optimization NoSQL Databases MapReduce References: Selected Papers MapReduce (textbook), Lin & Dyer, 2010
Parallel Databases Motivation More transactions per second, or less time per query Throughput vs. Response Time Speedup vs. Scaleup Database operations are extremely parallel E.g. Consider a join between R and S on R.b = S.b
Parallel Databases Shared-nothing vs. shared-memory vs. shared-disk
Parallel Databases
Date’s Rules for Distributed DBMS Rule 0 To the user, a distributed system should look exactly like a non-distributed system Other rules: Local autonomy No reliance on central site Continuous operation Location independence Fragmentation independence Replication independence Distributed query processing Distributed transaction management Hardware independence Operating system independence Network independence DBMS independence
Distributed Systems Headaches Especially if trying to execute transactions that involve data from multiple sites Keeping the databases in sync 2-phase commit for transactions uniformly hated (we’ll cover on 4/11) Autonomy issues Even within an organization, people tend to be protective of their unit/department Locks/Deadlock management Works better for query processing Since we are only reading the data
Distributed Query Optimization Cost-based approach; consider all plans, pick cheapest; similar to centralized optimization. Communication costs must be considered. Local site autonomy must be respected. New distributed join methods. Query site constructs global plan, with suggested local plans describing processing at each site. If a site can improve suggested local plan, free to do so.
Distributed Query Example Find all cities in Africa SELECT City.Name FROM City, Country WHERE City.CountryCode = Country.Code     AND Country.Continent = 'Africa' ; Location assumptions: Country table: Server A City table: Server B Request arrives at Server A Think through on whiteboard
Detour: Paxos Algorithm Paxos is a family of protocols for solving consensus in a network of unreliable processors.  Consensus is the process of agreeing on one result among a group of participants.  This problem becomes difficult when the participants or their communication medium may experience failures. Includes a spectrum of trade-offs between  the number of processors, number of message delays before learning the agreed value, the activity level of individual participants, number of messages sent, and types of failures. Widely used. In Google’s lock management service among other uses The above definitions from Wikipedia. Feel free to pursue. Not on exam. Contributions from Leslie Lamport, Nancy Lynch, Barbara Liskov
Updating Distributed Data Synchronous Replication: All copies of a modified relation (fragment) must be updated before the modifying transaction commits. Data distribution is made transparent to users. Asynchronous Replication:Copies of a modified relation are only periodically updated; different copies may get out of synch in the meantime. Users must be aware of data distribution. Many current products follow this approach. Also referred to as Master/Slave.
Synchronous Replication Voting:  transaction must write a majority of copies to modify an object; must read enough copies to be sure of seeing at least one most recent copy. E.g., 10 copies; 7 written for update; 4 copies read. Each copy has version number. Not attractive usually because reads are common. Read-any Write-all:  Writes are slower and reads are faster, relative to Voting. Most common approach to synchronous replication. But what if one of the 10 nodes is down? Choice of technique determines which locks to set.
Peer-to-Peer Replication More than one of the copies of an object can be a master in this approach. Changes to a master copy must be propagated to other copies somehow. If two master copies are changed in a conflicting manner, this must be resolved. (e.g., Site 1: Joe’s age changed to 35; Site 2: to 36) Best used when conflicts do not arise: E.g., Each master site owns a disjoint fragment. E.g., Updating rights owned by one master at a time.
Summary Parallel DBMSs designed for scalable performance.  Relational operators very well-suited for parallel execution. Pipeline and partitioned parallelism. Distributed DBMSs offer site autonomy and distributed administration.  Must revisit storage and catalog techniques, concurrency control, and recovery issues. Thus far, we have taken an ad hoc approach to database parallelism and distribution Time to formalize it
Brewer’s Conjecture (p1) Source: Eric Brewer’s July 2000 PODC Keynote Main points: Classic “Distributed Systems” don’t work They focus on computation, not data Distributing computation is easy, distributing data is hard DBMS research is about ACID (mostly) But we forfeit “C” and “I” for availability, graceful degradation and performance This tradeoff is fundamental BASE Basically Available Soft-state Eventual Consistency
Brewer’s Conjecture (p2) BASE Weak consistency stale data OK Availability first Best effort Approximate answers OK Aggressive (optimistic) Simpler! Faster Easier evolution ACID Strong consistency Isolation Focus on “commit” Nested transactions Availability? Conservative (pessimistic) Difficult evolution (e.g. schema) But I think it’s a spectrum Eric Brewer
CAP Theorem (p1) ‹Brewer’s Take Home Messages Can have consistency & availability within a cluster, but it is still hard in practice OS/Networking good at BASE/Availability, but terrible at consistency Databases better at C than Availability Wide-area databases can’t have both All systems are probabilistic Since then, Brewer’s conjecture formally proved: Gilbert & Lynch, 2002 Thus Brewer’s conjecture became the CAP theorem… …and contributed to the birth of the NoSQL movement
CAP Theorem (p2) But the theory is not settled Aren’t Availability and Partition Tolerance the same thing? And shouldn’t we be thinking about latency? While http://nosql-database.org/ lists 122 NoSQL databases References Availability and Partition Tolerance, Jeff Darcy, 2010 Problems with CAP…, Dan Abadi, 2010  What does the Proof of the CAP Theorem mean? Dan Weinreb, 2010
CS 542 Database Management Systems NoSQL Databases
What is NoSQL? Stands for Not Only SQL Class of non-relational data storage systems Usually do not require a fixed table schema nor do they use the concept of joins All NoSQL offerings relax one or more of the ACID properties
Forces at Work Three major papers were the seeds of the NoSQL movement CAP Theorem (discussed above) BigTable(Google) Dynamo (Amazon) Gossip protocol (discovery and error detection) Distributed key-value data store Eventual consistency Some types of data could not be modeled well in RDBMS Document Storage and Indexing Recursive Data and Graphs Time Series Data Genomics Data
The Perfect Storm Large datasets, acceptance of alternatives, and dynamically-typed data has come together in a perfect storm Not a backlash/rebellion against RDBMS SQL is a rich query language that cannot be rivaled by the current list of NoSQL offerings
What kinds of NoSQL NoSQL solutions fall into two major areas: Key/Value or ‘the big hash table’. Amazon S3 (Dynamo) Voldemort Scalaris Schema-less which comes in multiple flavors, column-based, document-based or graph-based. Cassandra (column-based) CouchDB (document-based) Neo4J (graph-based) HBase (column-based)
Amazon SimpleDB Key-value store Written in Erlang, (as is CouchDB) Data is modeled in terms of Domain, a container of entities, Item, an entity and  Attribute and Value, a property of an Item Eventually Consistent, except when ReadConsistent flag specified Impressive performance numbers,  e.g., .7 sec to store 1 million records SQL-like SELECT select output_list from domain_name [where expression] [sort_instructions] [limit limit]
Google Datastore Part of App Engine; also used for internal applications Used for all storage Incorporates a transaction model to ensure high consistency Optimistic locking Transactions can fail CAP implications Datastore isn’t just “eventually consistent” They offer two commercial options (with different prices) Master/Slave  Low latency but also lower availability Asynchronous replication High Replication Strong availability at the cost of higher latency
App Engine Architecture req/resp stateless APIs R/O FS Python VM process stdlib urlfech mail app images datastore stateful APIs memcache
Datastore Programming Model (p1) Entities have a Kind, a Key, and Properties Entity ~~ Record ~~ Python dict ~~ Python class instance Key ~~ structured foreign key; includes Kind Kind ~~ Table ~~ Python class Property ~~ Column or Field; has a type Dynamically typed: Property types are recorded per Entity Key has either id or name the id is auto-assigned; alternatively, the name is set by app A key can be a path including the parent key, and so on Paths define entity groups whichlimit transactions A transaction locks the root entity (parentless ancestor key)
Datastore Programming Model (p2) GQL GQL offers SELECT but no INSERT, UPDATE, JOIN Use language bindings for INSERT, … and Transaction primitives SELECT [* | __key__] FROM <kind>    [WHERE <condition> [AND <condition> ...]]    [ORDER BY <property> [ASC | DESC]          [, <property> [ASC | DESC] …]]    [LIMIT [<offset>,]<count>]    [OFFSET <offset>]  <condition> := <property> {< | <= | > | >= | = | != } <value>  <condition> := <property> IN <list>  <condition> := ANCESTOR IS <entity or key>
Datastore is Based on BigTable Provides Scalable, Structured Storage Implemented as a sharded, sorted, array Sharded: Each block (tablet) lives on its own server Sorted: Engineered to fetch the results of range queries with fewest disk reads Operations: Only these six Read Write Delete Update (atomic) Prefix scan Range scan Row Names (keys) up to 64KB Columns unlimited in size Divided into “column families”
Datastore Entity Implementation Shown Index: Entities By Kind Index: Entities By Prop ASC Not Shown Index: Entities By Prop DESC Index: By Composite Property
[object Object]
For more info, see video of Ryan Barrett’s talk at Google I/ODatastore Application at Google
Databases and Key-Value Stores http://browsertoolkit.com/fault-tolerance.png
CS 542 Database Management Systems MapReduce
The Story of Sam
Conceptual Underpinnings Programming model from Lisp and other functional languages (map square '(1 2 3 4))  (1 4 9 16) (reduce + '(1 4 9 16)) 30  Easy to distribute Nice failure/retry semantics
MapReduce Flow
Example: Reverse index words in docs Input: Crawler yields (url, content) pairs Map function: map (key = url, value = content) For each word w in content, emit (w, [url, offset] reduce(key = word, values = list of [url, offset]) Sort values Emit (word, sorted list of [url, offset])
Implementation Questions Map:  How many processors should we use? 4? 32? 1024? Reduce: How many processors? What’s the allocation algorithm for assigning words to processors? These all design decisions driven by Size and other characteristics of the problem
Implementation Steps Split key/value pairs into M chunks, run a map task on each chunk in parallel Partition the output of map tasks into R regions After all map tasks complete, Why do we need to wait?  Run a reduce task on each (of R) regions
Fault Tolerance Problem Detection Heartbeat Remedy Re-execute in-progress and completed map tasks Re-execute in-progress reduce tasks
Not limited to data analysis tasks Any task that is parallelizable e.g., prepare a report for each user The importance of idempotence It must be possible to rerun a task. Applications - name: prepUserReport mapper: input_reader: mapreduce.input_readers.DatastoreInputReader     handler: Service.prepUserReport params:     - name: entity_kind       default: DataModel.Org     - name: done_callback       default: /mr_done/prep
Refinements: Usability In the App Engine Environment, automation has been the focus Automatic sharding for faster execution Automatic rate limiting for slow execution Status pages (demo in a minute) Counters Parameterized mappers Batching datastore operations Iterating over blob data
Refinement: Redundant Execution Slow workers significantly delay completion time Other jobs consuming resources on machine  Bad disks w/ soft errors transfer data slowly  Weird things: processor caches disabled (!!)  Solution: Near end of phase, spawn backup tasks Whichever one finishes first "wins"  Dramatically shortens job completion time
Refinement: Locality Optimization Master scheduling policy:  Asks GFS for locations of replicas of input file blocks  Map tasks typically split into 64MB (GFS block size)  Map tasks scheduled so GFS input block replica are on same machine or same rack  Effect Thousands of machines read input at local disk speed  Without this, rack switches limit read rate
Refinement: Skipping Bad Records Map/Reduce functions sometimes fail for particular inputs Best solution is to debug & fix Not always possible ~ third-party source libraries  On segmentation fault:  Send UDP packet to master from signal handler  Include sequence number of record being processed  If master sees two failures for same record:  Next workeris told to skip the record
Refinement: Pipelining Hadoop Online Prototype (HOP) supports pipelining within and between MapReduce jobs: push rather than pull Preserve simple fault tolerance scheme Improved job completion time (better cluster utilization) Improved detection and handling of stragglers MapReduce programming model unchanged Clients supply same job parameters Hadoop client interface backward compatible No changes required to existing clients E.g., Pig, Hive, Sawzall, Jaql Extended to take a series of job
MapReduce Statistics @ GOOG Take-away message: MapReduce is not a “new-fangled technology of the future” It is here, it is proven, use it!
MapReduce is Still Controversial Arg1: MapReduce is a step backwards in database access MapReduce is not a database, a data storage, or management system MapReduce is an algorithmic technique for the distributed processing of large amounts of data Arg2: MapReduce is a poor implementation MapReduce is one way to generate indexes from a large volume of data, but it’s not a data storage and retrieval system Arg3: MapReduce is not novel Hashing, parallel processing, data partitioning, and user-defined functions are all old hat in the RDBMS world, but so what? The big innovation MapReduce enables is distributing data processing across a network of cheap and possibly unreliable computers
MapReduce is Still Controversial (p2) Arg4: MapReduce is missing features Arg5: MapReduce is incompatible with the DBMS tools The ability to process a huge volume of data quickly such as web crawling and log analysis is more important than guaranteeing 100% data integrity and completeness Arg6: Even Google is replacing MapReduce Not much written about it – seems more focused on pipelining and incremental processing

More Related Content

What's hot

Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless DatabasesDan Gunter
 
Data lake-itweekend-sharif university-vahid amiry
Data lake-itweekend-sharif university-vahid amiryData lake-itweekend-sharif university-vahid amiry
Data lake-itweekend-sharif university-vahid amirydatastack
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Databasenehabsairam
 
An Intro to NoSQL Databases
An Intro to NoSQL DatabasesAn Intro to NoSQL Databases
An Intro to NoSQL DatabasesRajith Pemabandu
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageBethmi Gunasekara
 
Intro to bigdata on gcp (1)
Intro to bigdata on gcp (1)Intro to bigdata on gcp (1)
Intro to bigdata on gcp (1)SahilRaina21
 
Research on vector spatial data storage scheme based
Research on vector spatial data storage scheme basedResearch on vector spatial data storage scheme based
Research on vector spatial data storage scheme basedAnant Kumar
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3RojaT4
 
Boston Hadoop Meetup, April 26 2012
Boston Hadoop Meetup, April 26 2012Boston Hadoop Meetup, April 26 2012
Boston Hadoop Meetup, April 26 2012Daniel Abadi
 
Big data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.irBig data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.irdatastack
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
 
Relational and non relational database 7
Relational and non relational database 7Relational and non relational database 7
Relational and non relational database 7abdulrahmanhelan
 
Big data vahidamiri-datastack.ir
Big data vahidamiri-datastack.irBig data vahidamiri-datastack.ir
Big data vahidamiri-datastack.irdatastack
 

What's hot (20)

Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless Databases
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
 
Data lake-itweekend-sharif university-vahid amiry
Data lake-itweekend-sharif university-vahid amiryData lake-itweekend-sharif university-vahid amiry
Data lake-itweekend-sharif university-vahid amiry
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
An Intro to NoSQL Databases
An Intro to NoSQL DatabasesAn Intro to NoSQL Databases
An Intro to NoSQL Databases
 
Mongo db
Mongo dbMongo db
Mongo db
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
 
Intro to bigdata on gcp (1)
Intro to bigdata on gcp (1)Intro to bigdata on gcp (1)
Intro to bigdata on gcp (1)
 
Research on vector spatial data storage scheme based
Research on vector spatial data storage scheme basedResearch on vector spatial data storage scheme based
Research on vector spatial data storage scheme based
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3
 
Boston Hadoop Meetup, April 26 2012
Boston Hadoop Meetup, April 26 2012Boston Hadoop Meetup, April 26 2012
Boston Hadoop Meetup, April 26 2012
 
Big data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.irBig data vahidamiri-tabriz-13960226-datastack.ir
Big data vahidamiri-tabriz-13960226-datastack.ir
 
RDBMS vs NoSQL
RDBMS vs NoSQLRDBMS vs NoSQL
RDBMS vs NoSQL
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
 
Selecting best NoSQL
Selecting best NoSQL Selecting best NoSQL
Selecting best NoSQL
 
Relational and non relational database 7
Relational and non relational database 7Relational and non relational database 7
Relational and non relational database 7
 
Big data hadoop rdbms
Big data hadoop rdbmsBig data hadoop rdbms
Big data hadoop rdbms
 
Big data vahidamiri-datastack.ir
Big data vahidamiri-datastack.irBig data vahidamiri-datastack.ir
Big data vahidamiri-datastack.ir
 

Viewers also liked

The DSP/BIOS Bridge - OMAP3
The DSP/BIOS Bridge - OMAP3The DSP/BIOS Bridge - OMAP3
The DSP/BIOS Bridge - OMAP3vjaquez
 
Introduction to Parallel Processing Algorithms in Shared Nothing Databases
Introduction to Parallel Processing Algorithms in Shared Nothing DatabasesIntroduction to Parallel Processing Algorithms in Shared Nothing Databases
Introduction to Parallel Processing Algorithms in Shared Nothing DatabasesOfir Manor
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseMd. Shamsur Rahim
 
Database ,14 Parallel DBMS
Database ,14 Parallel DBMSDatabase ,14 Parallel DBMS
Database ,14 Parallel DBMSAli Usman
 
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseHBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseEdureka!
 
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDBBenchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDBAthiq Ahamed
 

Viewers also liked (7)

The DSP/BIOS Bridge - OMAP3
The DSP/BIOS Bridge - OMAP3The DSP/BIOS Bridge - OMAP3
The DSP/BIOS Bridge - OMAP3
 
Introduction to Parallel Processing Algorithms in Shared Nothing Databases
Introduction to Parallel Processing Algorithms in Shared Nothing DatabasesIntroduction to Parallel Processing Algorithms in Shared Nothing Databases
Introduction to Parallel Processing Algorithms in Shared Nothing Databases
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed Database
 
Database ,14 Parallel DBMS
Database ,14 Parallel DBMSDatabase ,14 Parallel DBMS
Database ,14 Parallel DBMS
 
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseHBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
 
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDBBenchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
 
Parallel Database
Parallel DatabaseParallel Database
Parallel Database
 

Similar to CS 542 Parallel DBs, NoSQL, MapReduce

05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.ppt05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.pptAnandKonj1
 
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'sankarapu posibabu
 
No SQL Databases.ppt
No SQL Databases.pptNo SQL Databases.ppt
No SQL Databases.pptssuser8c8fc1
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyRohit Dubey
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfajajkhan16
 
17-NoSQL.pptx
17-NoSQL.pptx17-NoSQL.pptx
17-NoSQL.pptxlevichan1
 
Data management in cloud study of existing systems and future opportunities
Data management in cloud study of existing systems and future opportunitiesData management in cloud study of existing systems and future opportunities
Data management in cloud study of existing systems and future opportunitiesEditor Jacotech
 
No Sql On Social And Sematic Web
No Sql On Social And Sematic WebNo Sql On Social And Sematic Web
No Sql On Social And Sematic WebStefan Ceriu
 
NoSQL On Social And Sematic Web
NoSQL On Social And Sematic WebNoSQL On Social And Sematic Web
NoSQL On Social And Sematic WebStefan Prutianu
 
Unit-1 Introduction to Big Data.pptx
Unit-1 Introduction to Big Data.pptxUnit-1 Introduction to Big Data.pptx
Unit-1 Introduction to Big Data.pptxAnkitChauhan817826
 
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...Dipayan Dev
 
Data Engineering for Data Scientists
Data Engineering for Data Scientists Data Engineering for Data Scientists
Data Engineering for Data Scientists jlacefie
 
عصر کلان داده، چرا و چگونه؟
عصر کلان داده، چرا و چگونه؟عصر کلان داده، چرا و چگونه؟
عصر کلان داده، چرا و چگونه؟datastack
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsDirecti Group
 
Nosql availability & integrity
Nosql availability & integrityNosql availability & integrity
Nosql availability & integrityFahri Firdausillah
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011Chris Westin
 

Similar to CS 542 Parallel DBs, NoSQL, MapReduce (20)

NoSQL Basics - A Quick Tour
NoSQL Basics - A Quick TourNoSQL Basics - A Quick Tour
NoSQL Basics - A Quick Tour
 
05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.ppt05 No SQL Sudarshan.ppt
05 No SQL Sudarshan.ppt
 
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
 
No SQL Databases.ppt
No SQL Databases.pptNo SQL Databases.ppt
No SQL Databases.ppt
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubey
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdf
 
17-NoSQL.pptx
17-NoSQL.pptx17-NoSQL.pptx
17-NoSQL.pptx
 
Data management in cloud study of existing systems and future opportunities
Data management in cloud study of existing systems and future opportunitiesData management in cloud study of existing systems and future opportunities
Data management in cloud study of existing systems and future opportunities
 
No Sql On Social And Sematic Web
No Sql On Social And Sematic WebNo Sql On Social And Sematic Web
No Sql On Social And Sematic Web
 
NoSQL On Social And Sematic Web
NoSQL On Social And Sematic WebNoSQL On Social And Sematic Web
NoSQL On Social And Sematic Web
 
Unit-1 Introduction to Big Data.pptx
Unit-1 Introduction to Big Data.pptxUnit-1 Introduction to Big Data.pptx
Unit-1 Introduction to Big Data.pptx
 
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
Dr.Hadoop- an infinite scalable metadata management for Hadoop-How the baby e...
 
NOSQL
NOSQLNOSQL
NOSQL
 
Data Engineering for Data Scientists
Data Engineering for Data Scientists Data Engineering for Data Scientists
Data Engineering for Data Scientists
 
عصر کلان داده، چرا و چگونه؟
عصر کلان داده، چرا و چگونه؟عصر کلان داده، چرا و چگونه؟
عصر کلان داده، چرا و چگونه؟
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale Systems
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
Nosql availability & integrity
Nosql availability & integrityNosql availability & integrity
Nosql availability & integrity
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 

More from J Singh

OpenLSH - a framework for locality sensitive hashing
OpenLSH  - a framework for locality sensitive hashingOpenLSH  - a framework for locality sensitive hashing
OpenLSH - a framework for locality sensitive hashingJ Singh
 
Designing analytics for big data
Designing analytics for big dataDesigning analytics for big data
Designing analytics for big dataJ Singh
 
Open LSH - september 2014 update
Open LSH  - september 2014 updateOpen LSH  - september 2014 update
Open LSH - september 2014 updateJ Singh
 
PaaS - google app engine
PaaS  - google app enginePaaS  - google app engine
PaaS - google app engineJ Singh
 
Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)J Singh
 
Data Analytic Technology Platforms: Options and Tradeoffs
Data Analytic Technology Platforms: Options and TradeoffsData Analytic Technology Platforms: Options and Tradeoffs
Data Analytic Technology Platforms: Options and TradeoffsJ Singh
 
Facebook Analytics with Elastic Map/Reduce
Facebook Analytics with Elastic Map/ReduceFacebook Analytics with Elastic Map/Reduce
Facebook Analytics with Elastic Map/ReduceJ Singh
 
Big Data Laboratory
Big Data LaboratoryBig Data Laboratory
Big Data LaboratoryJ Singh
 
The Hadoop Ecosystem
The Hadoop EcosystemThe Hadoop Ecosystem
The Hadoop EcosystemJ Singh
 
Social Media Mining using GAE Map Reduce
Social Media Mining using GAE Map ReduceSocial Media Mining using GAE Map Reduce
Social Media Mining using GAE Map ReduceJ Singh
 
High Throughput Data Analysis
High Throughput Data AnalysisHigh Throughput Data Analysis
High Throughput Data AnalysisJ Singh
 
CS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitCS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitJ Singh
 
CS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlCS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlJ Singh
 
CS 542 -- Query Optimization
CS 542 -- Query OptimizationCS 542 -- Query Optimization
CS 542 -- Query OptimizationJ Singh
 
CS 542 -- Query Execution
CS 542 -- Query ExecutionCS 542 -- Query Execution
CS 542 -- Query ExecutionJ Singh
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementJ Singh
 
CS 542 Database Index Structures
CS 542 Database Index StructuresCS 542 Database Index Structures
CS 542 Database Index StructuresJ Singh
 
CS 542 Controlling Database Integrity and Performance
CS 542 Controlling Database Integrity and PerformanceCS 542 Controlling Database Integrity and Performance
CS 542 Controlling Database Integrity and PerformanceJ Singh
 
CS 542 Overview of query processing
CS 542 Overview of query processingCS 542 Overview of query processing
CS 542 Overview of query processingJ Singh
 
CS 542 Introduction
CS 542 IntroductionCS 542 Introduction
CS 542 IntroductionJ Singh
 

More from J Singh (20)

OpenLSH - a framework for locality sensitive hashing
OpenLSH  - a framework for locality sensitive hashingOpenLSH  - a framework for locality sensitive hashing
OpenLSH - a framework for locality sensitive hashing
 
Designing analytics for big data
Designing analytics for big dataDesigning analytics for big data
Designing analytics for big data
 
Open LSH - september 2014 update
Open LSH  - september 2014 updateOpen LSH  - september 2014 update
Open LSH - september 2014 update
 
PaaS - google app engine
PaaS  - google app enginePaaS  - google app engine
PaaS - google app engine
 
Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)Mining of massive datasets using locality sensitive hashing (LSH)
Mining of massive datasets using locality sensitive hashing (LSH)
 
Data Analytic Technology Platforms: Options and Tradeoffs
Data Analytic Technology Platforms: Options and TradeoffsData Analytic Technology Platforms: Options and Tradeoffs
Data Analytic Technology Platforms: Options and Tradeoffs
 
Facebook Analytics with Elastic Map/Reduce
Facebook Analytics with Elastic Map/ReduceFacebook Analytics with Elastic Map/Reduce
Facebook Analytics with Elastic Map/Reduce
 
Big Data Laboratory
Big Data LaboratoryBig Data Laboratory
Big Data Laboratory
 
The Hadoop Ecosystem
The Hadoop EcosystemThe Hadoop Ecosystem
The Hadoop Ecosystem
 
Social Media Mining using GAE Map Reduce
Social Media Mining using GAE Map ReduceSocial Media Mining using GAE Map Reduce
Social Media Mining using GAE Map Reduce
 
High Throughput Data Analysis
High Throughput Data AnalysisHigh Throughput Data Analysis
High Throughput Data Analysis
 
CS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitCS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed Commit
 
CS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlCS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency Control
 
CS 542 -- Query Optimization
CS 542 -- Query OptimizationCS 542 -- Query Optimization
CS 542 -- Query Optimization
 
CS 542 -- Query Execution
CS 542 -- Query ExecutionCS 542 -- Query Execution
CS 542 -- Query Execution
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
 
CS 542 Database Index Structures
CS 542 Database Index StructuresCS 542 Database Index Structures
CS 542 Database Index Structures
 
CS 542 Controlling Database Integrity and Performance
CS 542 Controlling Database Integrity and PerformanceCS 542 Controlling Database Integrity and Performance
CS 542 Controlling Database Integrity and Performance
 
CS 542 Overview of query processing
CS 542 Overview of query processingCS 542 Overview of query processing
CS 542 Overview of query processing
 
CS 542 Introduction
CS 542 IntroductionCS 542 Introduction
CS 542 Introduction
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

CS 542 Parallel DBs, NoSQL, MapReduce

  • 1. CS 542 Database Management Systems Parallel and Distributed Databases Introduction to NoSQL databases and MapReduce J Singh February 14, 2011
  • 2. Today’s meeting Parallel and Distributed Databases, Chapter 20.1 – 20.4 But only a part of 20.4, the rest w/ Query Optimization NoSQL Databases MapReduce References: Selected Papers MapReduce (textbook), Lin & Dyer, 2010
  • 3. Parallel Databases Motivation More transactions per second, or less time per query Throughput vs. Response Time Speedup vs. Scaleup Database operations are extremely parallel E.g. Consider a join between R and S on R.b = S.b
  • 4. Parallel Databases Shared-nothing vs. shared-memory vs. shared-disk
  • 6. Date’s Rules for Distributed DBMS Rule 0 To the user, a distributed system should look exactly like a non-distributed system Other rules: Local autonomy No reliance on central site Continuous operation Location independence Fragmentation independence Replication independence Distributed query processing Distributed transaction management Hardware independence Operating system independence Network independence DBMS independence
  • 7. Distributed Systems Headaches Especially if trying to execute transactions that involve data from multiple sites Keeping the databases in sync 2-phase commit for transactions uniformly hated (we’ll cover on 4/11) Autonomy issues Even within an organization, people tend to be protective of their unit/department Locks/Deadlock management Works better for query processing Since we are only reading the data
  • 8. Distributed Query Optimization Cost-based approach; consider all plans, pick cheapest; similar to centralized optimization. Communication costs must be considered. Local site autonomy must be respected. New distributed join methods. Query site constructs global plan, with suggested local plans describing processing at each site. If a site can improve suggested local plan, free to do so.
  • 9. Distributed Query Example Find all cities in Africa SELECT City.Name FROM City, Country WHERE City.CountryCode = Country.Code AND Country.Continent = 'Africa' ; Location assumptions: Country table: Server A City table: Server B Request arrives at Server A Think through on whiteboard
  • 10. Detour: Paxos Algorithm Paxos is a family of protocols for solving consensus in a network of unreliable processors. Consensus is the process of agreeing on one result among a group of participants. This problem becomes difficult when the participants or their communication medium may experience failures. Includes a spectrum of trade-offs between the number of processors, number of message delays before learning the agreed value, the activity level of individual participants, number of messages sent, and types of failures. Widely used. In Google’s lock management service among other uses The above definitions from Wikipedia. Feel free to pursue. Not on exam. Contributions from Leslie Lamport, Nancy Lynch, Barbara Liskov
  • 11. Updating Distributed Data Synchronous Replication: All copies of a modified relation (fragment) must be updated before the modifying transaction commits. Data distribution is made transparent to users. Asynchronous Replication:Copies of a modified relation are only periodically updated; different copies may get out of synch in the meantime. Users must be aware of data distribution. Many current products follow this approach. Also referred to as Master/Slave.
  • 12. Synchronous Replication Voting: transaction must write a majority of copies to modify an object; must read enough copies to be sure of seeing at least one most recent copy. E.g., 10 copies; 7 written for update; 4 copies read. Each copy has version number. Not attractive usually because reads are common. Read-any Write-all: Writes are slower and reads are faster, relative to Voting. Most common approach to synchronous replication. But what if one of the 10 nodes is down? Choice of technique determines which locks to set.
  • 13. Peer-to-Peer Replication More than one of the copies of an object can be a master in this approach. Changes to a master copy must be propagated to other copies somehow. If two master copies are changed in a conflicting manner, this must be resolved. (e.g., Site 1: Joe’s age changed to 35; Site 2: to 36) Best used when conflicts do not arise: E.g., Each master site owns a disjoint fragment. E.g., Updating rights owned by one master at a time.
  • 14. Summary Parallel DBMSs designed for scalable performance. Relational operators very well-suited for parallel execution. Pipeline and partitioned parallelism. Distributed DBMSs offer site autonomy and distributed administration. Must revisit storage and catalog techniques, concurrency control, and recovery issues. Thus far, we have taken an ad hoc approach to database parallelism and distribution Time to formalize it
  • 15. Brewer’s Conjecture (p1) Source: Eric Brewer’s July 2000 PODC Keynote Main points: Classic “Distributed Systems” don’t work They focus on computation, not data Distributing computation is easy, distributing data is hard DBMS research is about ACID (mostly) But we forfeit “C” and “I” for availability, graceful degradation and performance This tradeoff is fundamental BASE Basically Available Soft-state Eventual Consistency
  • 16. Brewer’s Conjecture (p2) BASE Weak consistency stale data OK Availability first Best effort Approximate answers OK Aggressive (optimistic) Simpler! Faster Easier evolution ACID Strong consistency Isolation Focus on “commit” Nested transactions Availability? Conservative (pessimistic) Difficult evolution (e.g. schema) But I think it’s a spectrum Eric Brewer
  • 17. CAP Theorem (p1) ‹Brewer’s Take Home Messages Can have consistency & availability within a cluster, but it is still hard in practice OS/Networking good at BASE/Availability, but terrible at consistency Databases better at C than Availability Wide-area databases can’t have both All systems are probabilistic Since then, Brewer’s conjecture formally proved: Gilbert & Lynch, 2002 Thus Brewer’s conjecture became the CAP theorem… …and contributed to the birth of the NoSQL movement
  • 18. CAP Theorem (p2) But the theory is not settled Aren’t Availability and Partition Tolerance the same thing? And shouldn’t we be thinking about latency? While http://nosql-database.org/ lists 122 NoSQL databases References Availability and Partition Tolerance, Jeff Darcy, 2010 Problems with CAP…, Dan Abadi, 2010 What does the Proof of the CAP Theorem mean? Dan Weinreb, 2010
  • 19. CS 542 Database Management Systems NoSQL Databases
  • 20. What is NoSQL? Stands for Not Only SQL Class of non-relational data storage systems Usually do not require a fixed table schema nor do they use the concept of joins All NoSQL offerings relax one or more of the ACID properties
  • 21. Forces at Work Three major papers were the seeds of the NoSQL movement CAP Theorem (discussed above) BigTable(Google) Dynamo (Amazon) Gossip protocol (discovery and error detection) Distributed key-value data store Eventual consistency Some types of data could not be modeled well in RDBMS Document Storage and Indexing Recursive Data and Graphs Time Series Data Genomics Data
  • 22. The Perfect Storm Large datasets, acceptance of alternatives, and dynamically-typed data has come together in a perfect storm Not a backlash/rebellion against RDBMS SQL is a rich query language that cannot be rivaled by the current list of NoSQL offerings
  • 23. What kinds of NoSQL NoSQL solutions fall into two major areas: Key/Value or ‘the big hash table’. Amazon S3 (Dynamo) Voldemort Scalaris Schema-less which comes in multiple flavors, column-based, document-based or graph-based. Cassandra (column-based) CouchDB (document-based) Neo4J (graph-based) HBase (column-based)
  • 24. Amazon SimpleDB Key-value store Written in Erlang, (as is CouchDB) Data is modeled in terms of Domain, a container of entities, Item, an entity and Attribute and Value, a property of an Item Eventually Consistent, except when ReadConsistent flag specified Impressive performance numbers, e.g., .7 sec to store 1 million records SQL-like SELECT select output_list from domain_name [where expression] [sort_instructions] [limit limit]
  • 25. Google Datastore Part of App Engine; also used for internal applications Used for all storage Incorporates a transaction model to ensure high consistency Optimistic locking Transactions can fail CAP implications Datastore isn’t just “eventually consistent” They offer two commercial options (with different prices) Master/Slave Low latency but also lower availability Asynchronous replication High Replication Strong availability at the cost of higher latency
  • 26. App Engine Architecture req/resp stateless APIs R/O FS Python VM process stdlib urlfech mail app images datastore stateful APIs memcache
  • 27. Datastore Programming Model (p1) Entities have a Kind, a Key, and Properties Entity ~~ Record ~~ Python dict ~~ Python class instance Key ~~ structured foreign key; includes Kind Kind ~~ Table ~~ Python class Property ~~ Column or Field; has a type Dynamically typed: Property types are recorded per Entity Key has either id or name the id is auto-assigned; alternatively, the name is set by app A key can be a path including the parent key, and so on Paths define entity groups whichlimit transactions A transaction locks the root entity (parentless ancestor key)
  • 28. Datastore Programming Model (p2) GQL GQL offers SELECT but no INSERT, UPDATE, JOIN Use language bindings for INSERT, … and Transaction primitives SELECT [* | __key__] FROM <kind> [WHERE <condition> [AND <condition> ...]] [ORDER BY <property> [ASC | DESC] [, <property> [ASC | DESC] …]] [LIMIT [<offset>,]<count>] [OFFSET <offset>] <condition> := <property> {< | <= | > | >= | = | != } <value> <condition> := <property> IN <list> <condition> := ANCESTOR IS <entity or key>
  • 29. Datastore is Based on BigTable Provides Scalable, Structured Storage Implemented as a sharded, sorted, array Sharded: Each block (tablet) lives on its own server Sorted: Engineered to fetch the results of range queries with fewest disk reads Operations: Only these six Read Write Delete Update (atomic) Prefix scan Range scan Row Names (keys) up to 64KB Columns unlimited in size Divided into “column families”
  • 30. Datastore Entity Implementation Shown Index: Entities By Kind Index: Entities By Prop ASC Not Shown Index: Entities By Prop DESC Index: By Composite Property
  • 31.
  • 32. For more info, see video of Ryan Barrett’s talk at Google I/ODatastore Application at Google
  • 33. Databases and Key-Value Stores http://browsertoolkit.com/fault-tolerance.png
  • 34. CS 542 Database Management Systems MapReduce
  • 36. Conceptual Underpinnings Programming model from Lisp and other functional languages (map square '(1 2 3 4))  (1 4 9 16) (reduce + '(1 4 9 16)) 30 Easy to distribute Nice failure/retry semantics
  • 38. Example: Reverse index words in docs Input: Crawler yields (url, content) pairs Map function: map (key = url, value = content) For each word w in content, emit (w, [url, offset] reduce(key = word, values = list of [url, offset]) Sort values Emit (word, sorted list of [url, offset])
  • 39. Implementation Questions Map: How many processors should we use? 4? 32? 1024? Reduce: How many processors? What’s the allocation algorithm for assigning words to processors? These all design decisions driven by Size and other characteristics of the problem
  • 40. Implementation Steps Split key/value pairs into M chunks, run a map task on each chunk in parallel Partition the output of map tasks into R regions After all map tasks complete, Why do we need to wait? Run a reduce task on each (of R) regions
  • 41. Fault Tolerance Problem Detection Heartbeat Remedy Re-execute in-progress and completed map tasks Re-execute in-progress reduce tasks
  • 42. Not limited to data analysis tasks Any task that is parallelizable e.g., prepare a report for each user The importance of idempotence It must be possible to rerun a task. Applications - name: prepUserReport mapper: input_reader: mapreduce.input_readers.DatastoreInputReader handler: Service.prepUserReport params: - name: entity_kind default: DataModel.Org - name: done_callback default: /mr_done/prep
  • 43. Refinements: Usability In the App Engine Environment, automation has been the focus Automatic sharding for faster execution Automatic rate limiting for slow execution Status pages (demo in a minute) Counters Parameterized mappers Batching datastore operations Iterating over blob data
  • 44. Refinement: Redundant Execution Slow workers significantly delay completion time Other jobs consuming resources on machine Bad disks w/ soft errors transfer data slowly Weird things: processor caches disabled (!!) Solution: Near end of phase, spawn backup tasks Whichever one finishes first "wins" Dramatically shortens job completion time
  • 45. Refinement: Locality Optimization Master scheduling policy: Asks GFS for locations of replicas of input file blocks Map tasks typically split into 64MB (GFS block size) Map tasks scheduled so GFS input block replica are on same machine or same rack Effect Thousands of machines read input at local disk speed Without this, rack switches limit read rate
  • 46. Refinement: Skipping Bad Records Map/Reduce functions sometimes fail for particular inputs Best solution is to debug & fix Not always possible ~ third-party source libraries On segmentation fault: Send UDP packet to master from signal handler Include sequence number of record being processed If master sees two failures for same record: Next workeris told to skip the record
  • 47. Refinement: Pipelining Hadoop Online Prototype (HOP) supports pipelining within and between MapReduce jobs: push rather than pull Preserve simple fault tolerance scheme Improved job completion time (better cluster utilization) Improved detection and handling of stragglers MapReduce programming model unchanged Clients supply same job parameters Hadoop client interface backward compatible No changes required to existing clients E.g., Pig, Hive, Sawzall, Jaql Extended to take a series of job
  • 48. MapReduce Statistics @ GOOG Take-away message: MapReduce is not a “new-fangled technology of the future” It is here, it is proven, use it!
  • 49. MapReduce is Still Controversial Arg1: MapReduce is a step backwards in database access MapReduce is not a database, a data storage, or management system MapReduce is an algorithmic technique for the distributed processing of large amounts of data Arg2: MapReduce is a poor implementation MapReduce is one way to generate indexes from a large volume of data, but it’s not a data storage and retrieval system Arg3: MapReduce is not novel Hashing, parallel processing, data partitioning, and user-defined functions are all old hat in the RDBMS world, but so what? The big innovation MapReduce enables is distributing data processing across a network of cheap and possibly unreliable computers
  • 50. MapReduce is Still Controversial (p2) Arg4: MapReduce is missing features Arg5: MapReduce is incompatible with the DBMS tools The ability to process a huge volume of data quickly such as web crawling and log analysis is more important than guaranteeing 100% data integrity and completeness Arg6: Even Google is replacing MapReduce Not much written about it – seems more focused on pipelining and incremental processing
  • 51. Next meetings February21: Mid-Term Exam February 28: Presentations Due: Presentation Report In-class presentation Please bring on a thumb drive in PDF or PPT format Report to accompany the presentation, up to 5 pages Submit electronically via Turn-In – deadline: 2/27 midnight Due: a proposal for your project No more than 1 page, no less than 300 words. Include an initial bibliography Will not be graded independently, feedback will be provided Will feed into your project grade