133
Advanced Database Management Systems 21st Century DBMSs: Scalability Alvaro A A Fernandes School of Computer Science, University of Manchester AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 1 / 133

Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Advanced Database Management Systems21st Century DBMSs: Scalability

Alvaro A A Fernandes

School of Computer Science, University of Manchester

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 1 / 133

Page 2: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Outline

DBMSs, Then and Now

21st-Century: Big Data

Scalable OLTP

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 2 / 133

Page 3: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

DBMSs, Then and Now (1)What have classical DBMSs been good at?

I Classical DBMSs have been good when

1. processing data that is structured in the form of records (hence withknown, stable structure),

2. only a few records are operated upon per task, e.g., in on-linetransaction processing (OLTP),

3. writes dominate performance (because of locking, latching, logging andbuffer management),

4. data growth can be addressed with vertical scaling,5. there is no need for dynamically responding in real-time to external

events,6. there is no need for embedding in the physical world in which

organizations exist.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 3 / 133

Page 4: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

DBMSs, Then and Now (2)How are DBMSs evolving?

I “The Web changes everything.”

I It is big time for big data!I Most cutting-edge DBMS research and products are geared towards

supporting one or more of:

1. Semi- and unstructured data too,2. on-line analytical processing (OLAP), and also off-line, too,3. distributed, extremely voluminous data and computational resources

with high horizontal scalability and high availability,4. dynamic response in real-time to external events,5. embedding in the physical world in which the organization exists.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 4 / 133

Page 5: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (1)Not Only Structured, Semi- and Unstructured Data Too

key:value stores : an influential exemplar is Amazon’s Dynamo.

document stores : well-known exemplars are CouchDB, MongoDB, andAmazon’s SimpleDB.

extensible record stores : influential exemplars are Google’s BigTable andFacebook’s Cassandra.

graph/triple stores : well-known exemplars are Neo4j (for general graphs),and Jena, Sesame, 4store (for RDF)

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 5 / 133

Page 6: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (1)Not Only Structured, Semi- and Unstructured Data Too (1)

key:value stores :

I collections of objects,I each with an application-assigned keyI tagging a schemaless payloadI with no DBMS-discernible structure;I application program must do all the workI using put(key, value), get(key):value API.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 6 / 133

Page 7: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (2)Not Only Structured, Semi- and Unstructured Data Too (2)

document stores :

I collections of objects,I each with an application-assigned keyI tagging a collection of attribute:value pairs;I the DBMS knows about attributes and value types,I there is a notion, therefore, of flexible, variable,

possibly-nested schema structures;I can be (non-SQL) queried (e.g., XQuery) orI application program can use set(key, document),

get(key):document, set(key, attribute, value),get(key,attribute):value API.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 7 / 133

Page 8: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (3)Not Only Structured, Semi- and Unstructured Data Too (3)

extensible record stores I collections of key-sharing column families(like vertical partitions)

I where each column family is like a document (seeabove);

I no query-language support;I application can use define(family), insert(family,

key, columns), get(family,key): columns

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 8 / 133

Page 9: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (4)Not Only Structured, Semi- and Unstructured Data Too (4)

graph/triple stores I collections of labeled edges over collections oflabeled nodes

I with system-assigned IDs, andI where both edges and nodes need not be predetermined,

or fixed, or stable, andI edge and node labels can be collections of

attribute:value pairs;I can be (non-SQL) queried (e.g., SPARQL) orI application program can use create: id,

get(id):graphObject, connect(id1, id2):id,addAttribute(id,name,value),getAttribute(id,name): value API.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 9 / 133

Page 10: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (5)Not Only OLTP, OLAP Too

I While classical DBMSs do well on OLTP, they are less good at OLAP.

I OLTP typically consists of workloads that mix updates and querieswhose profiles and demands can be studied and optimized for inadvance.

I OLAP workloads are mostly read-only and dominated by ad-hoc (ortransient) requirements.

I In modern organizations, the competitive edge that is provided byadvanced data management is moving from transactions to analyses.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 10 / 133

Page 11: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

DBMSs, Then and Now

Issues for Classical DBMSs (6)Not Only Scaled-Up Node Performance, Scale Out Too

I Classical DBMSs are not cheap to acquire, are costly to manage andtune, and costly to run.

I It has often been observed that the total cost of ownership (TCO) forDBMSs is increasing quite significantly.

I TCO = ACQ + ADM + OPE, i.e., TCO adds the acquisition cost,the costs of managing and maintaining the system (e.g., applicationdevelopment, database tuning) and the running costs (e.g.,computational and storage resources, energy, etc.)

I Even if the acquisition component of TCO were not high, theadministration and operation costs are high and rising.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 11 / 133

Page 12: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

Big Data (1)What Do We Mean? The (Adapted) Gartner/Forrester Vs

Volume data in the order of terabytes per day, petabytes per year (close to40% growth per year; 40x in the next 10 years): scale-up fails,scale-out only option

Velocity data that is retrieved statically or arrives continuously, on demandor not, non-stop, 24 x 7 x 4 x 12: time to process too smallcompared to data change rate

Variety data with no published stable semantics (e.g., documents, not justrecords; snippets, not often complete; text, often informal; mediastreams, often noisy; sometime human- and sometimesmachine-generated): impractical to integrate or evolvesemantically

Value in Variability data that underpins the construction of models (ofbusinesses, markets, phenomena, behaviours) through theidentification of what is regular/expected (or irregular/unexpected)in terms of threats and opportunities

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 12 / 133

Page 13: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

Big Data (2)The Landscape [Werner Vogels’s collect: store: organize: analyze: share (*)]

(*)http://www.odbms.org/blog/2011/11/on-big-data-interview-with-dr-werner-vogels-cto-and-vp-of-amazon-com/

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 13 / 133

Page 14: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

Big Data (3)In Business Contexts (1)

traditional enterprise data

I customer/supplier relationshipI traditional transactionalI web store transctionalI general ledger (accounts, stocks, invoices, etc.)

social/repository data

I customer/market sentimentI micro- and macro-blogging feedsI social webI documents, (image|video|sound) libraries/archives

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 14 / 133

Page 15: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

Big Data (4)In Business Contexts (2)

physical-world data

I sensingI taggingI positioningI video/sound streams

machine-generated data

I call detail records, clickstreams, logsI smart metering, equipment logsI trading/transactional streams

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 15 / 133

Page 16: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

Big Data (5)Benefits in Business Contexts

I So much, so varied, so pervasive, so up-to-date data

I promises to enable a more thorough and insightful

I understanding of a business

I in itself and in relation to its customers, suppliers and competitorsI with a view to

I enhancing productivity (e.g., eliminating inefficiencies in thevalue-adding chain)

I improving scope to compete (e.g., on price, on return on investment,on quality of service, etc.)

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 16 / 133

Page 17: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

Big Data (6)In Scientific Contexts

I In science, big data is mostly machine-generated (from extremelylarge and complex intruments, like the ESO Very Large Telescope, orthe CERN Large Hadron Collider).

I The LHC will generate 15 petabytes/year, i.e., 1 million gigabytes peryear, i.e., more than 1.7 million dual-layer DVDs, per year.

I Growth rates are even more explosive than in business (until aninternet of things becomes reality).

I It is giving birth to a new area, called XLDB (for eXtremely LargeDataBases).

I Some kinds of social data (e.g., crowdsourcing, citizen science) arealso being used but volumes are smaller.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 17 / 133

Page 18: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

The DBMS Market in 2010+ (1)The Stonebraker-Cattell Focus v. Complexity Dimensions

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 18 / 133

Page 19: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

21st-Century: Big Data

The DBMS Market in 2010+ (2)Traversing the Spaces

I We now have the Vogels landscape and the Stonebraker-Cattellspace [Stonebraker and Cattell, 2011].

I We will look at scalable SQL-centric OLTP ideas.

I We will then look at the appliance and the cluster/cloud approachesto massive parallelism in organizing and analyzing data throughSQL-based queries.

I We will look next at the NoSQL approach to massive distribution thatunderpins the data management strategies of many web giants andsome cloud applications.

I Later, we will move to consider a missing Vogels landmark in theStonebraker-Cattell space, viz., approaches to querying stream data.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 19 / 133

Page 20: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

Internal Architecture of Classical DBMSsFour+One Main Service Types

I Query Processing

I Transaction Processing

I Concurrency Control

I Recovery

I Storage Management

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 20 / 133

Page 21: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

Scalable OLTPFrom One to Many Through Sharding

I When there is explosive, typically unforeseen, data growth, asingle-node DBMS may not be able to cope.

I One cheap-and-dirty fix is to shard, i.e., partition the data acrossmany copies of the original single-node DBMS.

I However, many drawbacks ensue from this approach:I query operations that touch data across many nodes need to have their

semantics enforced inside the application logic, which destroys thedeclarative-to-procedural contract (and with it, the guarantee ofquasi-optimal response times)

I ditto for update consistency for constraint propagation andmaintenance

I for large numbers of nodes, failure is common, but the logic to detectand fix dangling inconsistencies or out-of-sync replicas is complex andmust be done in application logic

I there is no support for hot swap, so availability is compromised.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 21 / 133

Page 22: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

Scalable OLTPThe Stonebraker-Cattell Ten Rules

R1 Look for shared-nothing scalability.

R2 High-level languages are good and need not hurtperformance.

R3 Plan to carefully leverage main memory databases.

R4 High availability and automatic recovery are essential forsimple-operation scalability.

R5 Online everything.

R6 Avoid multi-node operations.

R7 Don’t try to build ACID consistency yourself.

R8 Look for administrative simplicity.

R9 Pay attention to node performance.

R10 Open source gives you more control over your future.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 22 / 133

Page 23: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (1)R1 Look for shared-nothing scalability

I Shared-memory designs (i.e., a multicore, single-node DBMS overshared primary and secondary memory) suffers from contention andstarves the cores forcing designers into sharding.

I Shared-disk designs (i.e., a multicore, single-node DBMS with privateprimary memory per CPU but sharing secondary memory) suffers fromcomplex buffer and lock management needs which limit scalability.

I Shared-nothing designs (i.e., each node has its own private andsecondary memory) are scalable if partitioning is load-balancing and ifthe DBMS pounces on opportunity for touching as few partitions aspossible (ideally one).

I While shared-memory and shared-disk designs do not scale beyondtens of nodes, shared-nothing designs scale to hundreds and arelimited only by network bandwidth.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 23 / 133

Page 24: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (2)R2 High-level languages are good and need not hurt performance

I SQL transactions can be prone to overheads comparing to low-levelprogramming, including:

O1: sub-optimal plan selectionO2: need for data to flow through DBMSO3: sub-optimal code due to generationO4: generic services for storage management, concurrency and

recovery

I Regarding O1, plan selection is more likely to yield a better plan thanall but the most skilled and knowledgeable (and costly) programmers.

I Regarding O2, if stored procedures (rather than database connectivityAPIs) are used, there’s only one over-and-back message.

I Regarding O3, queries are compiled to either native or interpretablecode, so the tool chain is essentially the same for handwritten andoptimizer-selected query code.

I O4 is addressed in R3 below.AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 24 / 133

Page 25: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (3)R3 Plan to carefully leverage main memory databases

I A shared-nothing design with 16 nodes, each with 64 GB primarymemory, is now commonplace.

I This is 1 TB of (non-shared) primary memory, making it possible todeploy many (even most) transactional DBs on primary memory only.

I But the profiling of OLTP processing in classical DBMSs shows thatonly 13% is useful work, the overheads for multithreading, locking,logging, and buffer management consume 11%, 20%, 23% and 33%,resp. [Harizopoulos et al., 2008]

I The magnitude of each overhead is such that removing one or twostill allows much performance to leak.

I Removing all of them requires reenginering the classical DBMSarchitecture for the case of main-memory deployments.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 25 / 133

Page 26: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (4)R4 High availability and automatic recovery are essential for simple-operation scalability

I DBMSs are expected to never fail to be available.I However, when there is a massive number of nodes, quasi-random

continuous single-node failures are likely.I Failures caused by software faults are often hard to detect,

particularly in massively distributed scenarios.I Another challenge is the force of the CAP theorem

[Brewer, 2000, Gilbert and Lynch, 2002] which states that adistributed system can only exhibit any two (but not all) of threedesiderata: consistency, availability, and partition tolerance.

I In other words, that:I all nodes see the same data at the same timeI every request receives a response as to whether it succeeded or failedI the system continues to operate despite arbitrary message loss

.AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 26 / 133

Page 27: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (5)R5 Online everything

I DBMSs are expected to have no down-time.

I This should be so even if one needs to change schemas or indices, addor remove nodes, or upgrade software components.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 27 / 133

Page 28: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (6)R6 Avoid multi-node operations

I When scaling out, two goals must be met as close as possible:I computational load must be split evenly between nodes, which can be

fostered by replication, in the case of read-only scalability, and bypartitioning, in the case of read/write scalability

I operations that span more than one node or partition must be rare.

I If load is uneven, contention or lagging will cause performanceleakage.

I If operations often span more than one node, cross-nodecommunication and synchronization delays will cause performanceleakage.

I Here too the CAP theorem places limit on ambitions for P.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 28 / 133

Page 29: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (7)R7 Don’t try to build ACID consistency yourself (1)

SQL-based DBMSs support ACID guarantees:

Atomicity All the operations in the transaction complete, or none does.

Consistency All the integrity constraints are true when the transactionbegins and when it ends.

Isolation No transaction interferes with any other transaction.

Durability If a transaction commits, its effects persist and cannot bereversed by failures or faults.

Non-SQL systems often offer BASE guarantees:

Basically Available by relaxation of isolation,

Soft-state by relaxation of durability and atomicity,

Eventually consistent by optimistic postponement of consistency.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 29 / 133

Page 30: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (8)R7 Don’t try to build ACID consistency yourself (2)

I BASE systems version/timestamp every write, leading to multiplicityin the presence of parallelism, and request the application to decideon how to reconcile.

I They sometimes refrain from updating if the value they meant tochange has already changed.

I They can often guarantee ACID on a single object or partition.

I They can decide on postponed consistency resolution on the basis ofquorum reads/writes (i.e., before returning, ensure a majority ofnodes has completed the read or write).

I In all cases, application programmers have a complex task if updatesmust be coordinated (e.g., funds transfer).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 30 / 133

Page 31: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (9)R8 Look for administrative simplicity

I Classical DBMSs have poor out-of-the-box behaviour, leading todependence on highly-costly professionals to install, tune and run amulti-node system.

I Data appliances (which we consider later) are one response to thischallenge.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 31 / 133

Page 32: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (10)R9 Pay attention to node performance

I While its true that, if inherently scalable, one can respond with morenodes to a growth in the problem, if one can improve the individualcontribution of each node, then one will need fewer nodes to scalelinearly.

I Often performance per node varies by one order of magnitude.

I If a node can perform ten times better, then an installation thatneeded 500 nodes can be trimmed to 50.

I The savings in acquisition costs, rack space, and energy consumptioncould be very significant.

I Churn due to individual node failures is likely less as well.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 32 / 133

Page 33: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

The Stonebraker-Cattell Ten Rules in Detail (11)R10 Open source gives you more control over your future

I This is an innovation space with start-ups that are born to be sold.

I Being locked into a single supplier can lead to extortionate upgradesand poor-value technical support contracts.

I Open source reduces such risks and builds uponknowledge-contribution from large technical communities.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 33 / 133

Page 34: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

Summary21st Century DBMS: Scalability

I The first decades of the 21st century seem likely to be characterizedby ever expanding availability of data, touching of tens or hundreds ofpetabytes per year per domain.

I Data is not just more voluminous, it is also continuously available atever faster rates, more diverse in structure and more variable in termsof patterns or models that characterize them.

I This makes scalability and flexibility imperative.

I It also becomes crucial to cust the management and operation costsof data management solutions.

I It remains possible to scale out SQL-based DBMSs but greatawareness needs to be paid to issues such as codified in the 10Stonebrake-Cattell rules.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 34 / 133

Page 35: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Scalable OLTP

Advanced Database Management Systems21st Century DBMSs: Massively-Parallel Data Appliances

Alvaro A A Fernandes

School of Computer Science, University of Manchester

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 35 / 133

Page 36: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Outline

Data Appliances

Massively-Parallel Data Appliances

An Example MPP Data Appliance

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 36 / 133

Page 37: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Data Appliances

Massive Parallelism and Distribution (1)Tera- to Petabyte-Scale Data Volumes

I Recall that the post-1990s success of parallel/distributed architecturesfor DBMSs was attributed to three main factors, viz.:

I the ascendancy of the relational model,I the high-quality of commodity hardware and network components, andI the enabling power of modern software mechanisms.

I All of these advances have continued into the 2000s and the lattertwo in particular underpin the cutting edge of massively-parallelarchitectures that are likely to dominate the future of tera- topetabyte-scale data management and beyond, viz.:

I massively-parallel data appliancesI massively-distributed cluster schemes

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 37 / 133

Page 38: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Data Appliances

Massive Parallelism and Distribution (2)Data Appliances

I Massively-parallel data appliances can be seen as scale-up (orvertically-scaled) designs.

I They pack software and hardware in a box, deploying preconfiguredand tuned DBMSs onto preconfigured and tuned processors and diskswired by a preconfigured and tuned interconnect.

I They adopt optimization schemes based on special storage strategiesto minimize reliance on indexes and maximize the use ofhighly-parallel, high-performance scans and hash joins in query plans.

I While they major on OLAP-style queries, they are SQL engines.

I Consistently with the read-only nature of their typical workload, somedata appliances remain shared-disk designs.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 38 / 133

Page 39: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Data Appliances

Massive Parallelism and Distribution (3)Cluster-Based Schemes

I Massively-parallel cluster-based schemes replace scale-up (biggerboxes) with scale-out (more boxes) for their design strategy.

I They are the latest realization of extreme shared-nothing with thetwist of custom-built software infrastructure for merging and splittingas well as scheduling and fault-tolerance.

I While they major in un- and semi-structured data processing, theycan be targets for SQL-based query workloads.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 39 / 133

Page 40: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MP Data Appliances

Data Appliances (1)A Response to One of the Critiques of Classical DBMSs

I In order to keep TCO down, administration and operation costs needto be kept down.

I The notion of an appliance connotes precisely thisworks-out-of-the-box, plug-and-run ideal.

I The notion first emerged in network management, then was picked upin keyword-based search applications.

I An appliance can be seen as special-purpose hardware runningspecial-purpose software for a well-defined class of computing tasks.

I Both the hardware and the software are preconfigured and tuned (andthis is where appliance vendors compete and aim to make theirmoney).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 40 / 133

Page 41: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MP Data Appliances

Data Appliances (2)Major Characteristics (1)

I Shared-nothing massively-parallel processing (MPP): In order todeliver performance, data appliances make heavy use of all theadvances in parallel DBMS we have studied.

I Simpler QEPs on more raw computing power: In order to bothavoid high administration and operation costs and improve rawperformance, data appliances strongly favour a simpler space of QEPsand physical schemas and pack enough high-quality hardware andfine-tuned software to make them go faster than if more optimized,more complex QEPs were used.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 41 / 133

Page 42: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MP Data Appliances

Data Appliances (3)Major Characteristics (2)

I QEP simplification is founded on two characteristics:I Index-light: avoid indices which are costly to design, store, maintain

and make use of without the highest-quality DBAs being in constantinteraction with application designers.

I Scan-heavy: avoid random disk accesses and ensure instead thatsequential scans come close to potential speed-up by physical designsthat are tuned to high-quality, specially-configured, fine-tunedhardware.

I The major technical challenges centre around balanced, efficient datamovements, i.e., the dynamic management of intermediate result setsand their timely, fast delivery to capable, fast-performing nodes.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 42 / 133

Page 43: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MP Data Appliances

Data Appliances (4)Major Types/Current Players

One classification of data appliances is as follows:

Type 0 appliances use customized hardware. They are distinctive inusing custom chips (or field-programmable gate arrays) andaggressively push computation to them in order to obtainbetter performance.

Type 1 appliances are custom assemblies of standard hardware thatdo not make use of chip-level tuning.

Type 2 appliances preconfigure and tune standard software andhardware into a coherent, tightly-coupled unit component.

Examples include:

Type 0 XtremeData, Netezza (now IBM)

quasi-Type 1 Teradata, Greenplum

Type 2 DATAllegro (now Microsoft), Oracle

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 43 / 133

Page 44: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MP Data Appliances

Data Appliances (5)Raw Computing Power Needed

Data appliances rely on:I Many, high-performance, high-capacity components, such as:

I multiple top-end processors with excellent caching performance in thepresence of massive amounts of RAM,

I multiple top-end storage units, with redundancy for reliability and forhigh-degree of parallelism, and

I top-end interconnect to avoid slow down when in transit;

I Balancing strategies to extract the best performance of suchcomponents.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 44 / 133

Page 45: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Data Appliances (6)2007 DATAllegro v3: A Type 2 Data Appliance (1)

I An appliance comprises multiplenodes, in a one-master,many-slaves relationship.

I The master node is responsible forquery optimization, parallelization,concurrency, etc.

I Slave nodes are responsible forstoring data and executing theQEPs sent by the master node.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 45 / 133

Page 46: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Data Appliances (7)2007 DATAllegro v3: A Type 2 Data Appliance (2)

I Each node runs an open sourceDBMS that is highly-, finely-tunedfor the required query workloads(OLAP in the case of DATAllegro).

I Storage used a RAID (RedundantArray of Independent Drives)design intent on maximizing readperformance.

I It uses top-end commoditycomponents for each node andinterconnects them with top-endnetwork.

I If a node fails, another node picksup the role and load until it is slidout and a replacement is slid in.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 46 / 133

Page 47: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Data Appliances (8)Scan-Heavy Strategy

I As data is loaded, it is automatically hash-partitioned across the slavenodes.

I In addition, range- and hash-partitioning are used within a node tocapitalize on the RAID storage.

I Tables can be replicated and/or partitioned.I The query optimizer makes the decision between:

I running the query within a node using replicasI running the query across nodes using partitioning

I The query optimizer is also fine-tuned to make it possible to usesequential scans and hash joins.

I Transfer units off storage are very large (e.g., 24-MB blocks).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 47 / 133

Page 48: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Data Appliances (9)Index-Light Strategy

I The index-light approach means that often one order-of-magnitudeless storage space is needed, even without compression.

I The index-light approach implies not just less hardware but also lessadministration (to decide, design, maintain and make use of indices)and more consistent performance at a lower price/performance ratio.

I Rather than being slower at finding exactly the true positives, use rawpower to read and process even the false positives faster.

I Indices can still be used: most data appliances are (or contain) afully-fledged DBMS.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 48 / 133

Page 49: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Data Appliances (10)2011 The Oracle Big Data Approach = US$ 0.55M + US$ 2M

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 49 / 133

Page 50: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Summary21st Century DBMSs: Massively-Parallel Data Processing

I A new breed of data management solutions has emerged recently thatis a response to the need to lower TCO even in the presence ofmassive volumes of data and complex query workloads.

I The notion of a computing appliance first emerged in networkmanagement, then guided the development of integratedhardware/software products in the enterprise search market and is nowbeing used to underpin cutting-edge solutions for OLAP querying.

I Data appliances use massively-parallel shared-nothing architectures forperformance.

I They configure and tune the software and hardware to perform wellwith much reduced administration overheads.

I This is achieved by a combination of raw power and simplified,index-light, scan-heavy QEPs.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 50 / 133

Page 51: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

An Example MPP Data Appliance

Advanced Database Management Systems21st Century DBMSs: Massively-Distributed Data Processing (1)

Alvaro A A Fernandes

School of Computer Science, University of Manchester

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 51 / 133

Page 52: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Outline

Data Appliances v. Cluster-Based Schemes

Massively-Distributed Cluster-Based Processing

The Map-Reduce Computational Model

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 52 / 133

Page 53: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Appliances v. Clusters

Data Appliances v. Cluster-Based Schemes (1)TCO, Again

I Data appliances are perceived as having succeeded in reducing theadministration and operation components of TCO, but theiracquisition costs are in the order of tens of thousands per terabyte.

I Even though, by definition, appliances are designed, sold and deployedas an integrated hardware/software solution, there are twocomponents to their acquisition cost:

I the hardware, i.e., the top-end components that combine to producethe raw computing power without which the simplified QEPs would notdeliver performance, and

I the software, i.e., the partitioning and scheduling components thatensure that computing power is made the most use of and thatconstitute the competitive ground for vendors.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 53 / 133

Page 54: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Appliances v. Clusters

Data Appliances v. Cluster-Based Schemes (2)Major Types

Recall:

Type 0 appliances use customized hardware. They are distinctive inusing custom chips (or field-programmable gate arrays) andaggressively push computation to them in order to obtainbetter performance.

Type 1 appliances are custom assemblies of standard hardware thatdo not make use of chip-level tuning.

Type 2 appliances preconfigure and tune standard software andhardware into a coherent, tightly-coupled unit component.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 54 / 133

Page 55: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Appliances v. Clusters

Data Appliances v. Cluster-Based Schemes (3)Clusters as “Type 3” Appliances

I Cluster-based approaches can be seen as an attempt to move onwardsfrom Type 2 data appliances just as Type 2 appliances moved fromType 1 and Type 0 ones, i.e., in the direction of non-proprietarytechnologies.

I Thus, cluster-based schemesI can deliver performance even without specially configured and tuned

assemblies of top-end hardware and network components, andI use open-source partitioning and scheduling software.

I In this way, cluster-based schemes promise to lower the acquisitioncomponent of TCO and not just the administration and operationones.

I While data appliances could be argued to be scale-up designs,cluster-based schemes are scale-out designs.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 55 / 133

Page 56: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Data ManagementAdvanced for Keyword-Based Querying, Incipient for Anything More Complex

I For partitioning and scheduling to be simple enough to carry out in ageneric fashion, the parallel and distributed tasks must be even morestringently constrained than relational operators.

I The tasks involved in keyword-based search are an example.

I The tasks involved in frame-based image processing are another.

I In this respect, one of the major difficulties in query processing is datadependency (e.g., partitioning is sometimes attribute- andlocation-sensitive).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 56 / 133

Page 57: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Computing (1)Partitioning and Scheduling (1)

I The grain of parallelization dependson the grain at which we can splita task into multiple independentunits.

I The scheduling problem then is toassign sub-tasks to processingelements (i.e., threads, or nodes).

I Once sub-tasks are finished, thepartitions are merged back intocomplete results.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 57 / 133

Page 58: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Computing (2)Partitioning and Scheduling (2)

I The decision space is complex, and requires answers to the followingquestions (among others):

I What if we cannot split the tasks into independent sub-tasks?I How do we assign sub-tasks to nodes?I What if we have more sub-tasks than nodes?I How do we merge sub-results into results?I How do we know all the nodes have finished?

I The common difficulty in all these is the need for nodes tocommunicate and access shared resources.

I It is crucial to achieve task independence by avoiding sharing state.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 58 / 133

Page 59: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Computing (3)Partitioning and Scheduling (3)

Example (Expression-LevelIndependence)

I When independent branches of analgebraic expression commute and donot access (i.e., make no reference to)shared state, they can be executed inany order.

I In the following expression

x := (a * b) + (y * z)

since + commutes, a compiler (or aCPU scheduler) can execute the left-and the right-hand side in any order.

Example (Function-LevelIndependence)

I This is also true, but harder toautomate, at the level of entirefunctions.

I In the following expression

x := foo(a) + bar(b)

if both foo( ) and bar( ) do notaccess shared state, they can beparallelized, with the assignment to x

becoming the merge/synchronizationpoint that blocks waiting for them tocomplete.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 59 / 133

Page 60: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Computing (4)Detecting Dependencies Automatically is Hard

I In the last example, there is independence between foo( ) andbar( ) and dependence between each one of them and x.

I For a partitioner/scheduler infrastructure, detecting these propertiesis hard.

I The inability to do so prevents massive parallelization at the coarsegrains that are needed to process massive volumes of data.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 60 / 133

Page 61: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Computing (5)When It Can Be Done

I When task-level independence is ensured, in cluster-based computing(as well as in data appliances), a single-master, many-slaves approachcan be employed:

1. The master initially owns the data.2. The master spawns several workers to process the partitions it creates.3. The master waits for the workers to complete before merging results.

I Daisy-chaining leads to workers that consume from and produce forother workers.

I Queues can be used to allow n : m relationships between producingand consuming workers.

I In a distributed cluster, location transparency for both tasks and datais necessary.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 61 / 133

Page 62: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

MD Cluster-Based Processing

Cluster-Based Computing (6)But How Can It Be Done?

I One approach to circumventing this obstacle is to limit theexpressiveness of the computation performed by individual tasks insuch a way as to ensure task independence.

I One computational model that has acquired prominence recently (dueto its widespread use in Google, Yahoo and other web-basedcompanies) is referred to as the map-reduce computational model.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 62 / 133

Page 63: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (1)Roots in Functional Programming (1)

I The map-reduce model takes its name from its roots in the functionalprogramming paradigm (of which concrete examples are Haskell,Standard ML and Miranda, among others).

I In (pure) functional programs, functions are side-effect free.

I Recall our previous examples: in functional languages, two functionsused in the same expression are guaranteed not to share any state.

I Instead of side-effecting shared data structures, functions in purefunctional programs create completely new ones.

I They are, therefore, inherently parallelizable.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 63 / 133

Page 64: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (2)Roots in Functional Programming (2)

I Consider a function foo that takes a list of numbers, computes a sum of itselements and adds to the latter the length of the input list.

I The following definition (in Haskell syntax) uses the sum and length

primitives:

>> let foo x = sum x + length x

>> foo [1,2,3]

9

I Now, consider a function bar that takes a list of numbers and computes thesquare of applying foo to it.

I The definition (in Haskell syntax) could be:

>> let bar x = foo x * foo x

>> bar [1,2,3]

81

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 64 / 133

Page 65: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (3)Roots in Functional Programming (3)

I Since neither foo (or the primitives it relies on) nor bar interfere withanother, if they appear as operands of a binary commutative function (suchas +), they can be evaluated in any order:

>> foo [1,2,3] + bar [1,2,3] == bar [1,2,3] + foo [1,2,3]

True

I We can define a function append that takes an element and a list andappends the element to the end of the list in the following (convoluted way)without ever relying on shared state:

1. Reverse the input list2. Stick the input element at the front of the results3. Reverse the latter result and return

I The definition in Haskell could be:

>> let append l ls = reverse (l : rev) where rev = reverse ls

>> append 1 [3,2]

[3,2,1]

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 65 / 133

Page 66: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (4)Roots in Functional Programming (4)

I Another important characteristic of functional programming languages isthat functions can be passed as parameters to other functions.

I In particular, we can define second-order functions, i.e., functions thattake functions as arguments.

I For example, we can define a function that takes a function and anargument, and applies the former to the latter twice.

>> let twice f x = f (f x)

>> twice (+ 1) 1

3

>> twice (* 3) 3

27

I In the examples, (+ 1) is a function that adds 1 to the argument it isapplied to, and (* 3) is a function that triples the argument it is applied to.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 66 / 133

Page 67: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (5)Roots in Functional Programming (5)

I The map-reduce computational model has this name because it is centredaround two higher-order functions that are well-known and well-studied infunctional programming, viz., map and fold (sometimes also referred to asreduce).

I map takes as arguments a unary function and a list, applies the former toeach element of the latter, and returns the resulting list.

I fold takes as arguments a binary and associative function, a value(interpreted as the initialization of an accumulator) and a list.

I It traverses the list applying the input function to each element and thecurrent value of the accumulator, updating the latter each time.

I It returns the final value in the accumulator once it reaches the end of thelist.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 67 / 133

Page 68: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (6)Map and Fold(s): Examples (1)

I The general form taken by theapplication of a mapper function toa list is shown in the figure.

I To the right, a function (+ 1) thatincrements the elements of a list byone is applied.

I Note that the function could beBoolean-valued (i.e., a predicate),e.g., (> 3).

I Does this suggest σx>3(R) to you?

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 68 / 133

Page 69: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (7)Map and Fold(s): Examples (2)

I The general form taken by theapplication of a reducer function to alist is shown in the figure.

I To the right, a function (+) thatadds the elements of a list (with theinitializer set to zero) is applied.

I Does this suggest γSUM(R) to you?

I The fold operation has two versions:foldl moves left-to-right in the list,foldr moves right-to-left.

I They are equivalent for commutativeoperations (e.g., addition), but notfor non-commutative ones (e.g.,subtraction).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 69 / 133

Page 70: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (8)Map and Fold(s): Examples (3)

>> map (+ 2) [3, 4, 3, 8, 4, 1]

[5,6,5,10,6,3]

>> map (> 3) [3,2,4,6,8]

[False,False,True,True,True]

>> foldl (+) 0 [3, 4, 3, 8, 4, 1]

23

>> sum [3, 4, 3, 8, 4, 1] == foldl (+) 0 [3, 4, 3, 8, 4, 1]

True

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 70 / 133

Page 71: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (9)Map and Fold(s): Examples (4)

>> foldl (+) 0 (map (+ 2) [3, 4, 3, 8, 4, 1])

35

>> foldl (*) 1 (map (+ 2) [3, 4, 3, 8, 4, 1])

27000

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 71 / 133

Page 72: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (10)Map and Fold(s): Examples (5)

>> foldl (*) 1 [3, 4, 3, 8, 4, 1]

1152

>> sum [3, 4, 3, 8, 4, 1] + foldl (*) 1 [3, 4, 3, 8, 4, 1]

1175

>> foldl (*) 1 [3, 4, 3, 8, 4, 1] + sum [3, 4, 3, 8, 4, 1]

1175

>> (sum [3, 4, 3, 8, 4, 1] + foldl (*) 1 [3, 4, 3, 8, 4, 1])

== (foldl (*) 1 [3, 4, 3, 8, 4, 1] + sum [3, 4, 3, 8, 4, 1])

True

>> (foldl (-) 0 [3, 4, 3, 8, 4, 1]) == ((((((0-3)-4)-3)-8)-4)-1)

True

>> (foldr (-) 0 [3, 4, 3, 8, 4, 1]) == (3-(4-(3-(8-(4-(1-0))))))

True

>>

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 72 / 133

Page 73: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

The Map-Reduce Computational Model (11)Implicit Parallelism in map

I In functional programming, applying the mapper function to anelement does not have any impact on the result of applying the samemapper function to any other element

I If the order of application of the mapper is immaterial, it can beapplied in parallel.

I The map-reduce computational model exploits this to the full.

I This is the way in which it limits the expressiveness of thecomputation performed by individual tasks so as to ensure taskindependence and hence be free to execute tasks in massively-parallelmode.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 73 / 133

Page 74: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

Summary21st Century DBMSs: Massively-Distributed Data Processing (1)

I Cluster-based schemes hold the promise of going one step further interms of commoditization than Type-2 data appliances.

I By constraining the computational model, it is possible to runmassively-parallel computations without application developers havingto design their solutions in parallel terms.

I One such computational model, founded on functional programming,centres around the well-known, well-studied map and foldhigher-order functions.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 74 / 133

Page 75: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce

Advanced Database Management Systems21st Century DBMSs: Massively-Distributed Data Processing (2)

Alvaro A A Fernandes

School of Computer Science, University of Manchester

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 75 / 133

Page 76: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Outline

Map-Reduce Engines

Map-Reduce in Query Processing

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 76 / 133

Page 77: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (1)Motivation

I The motivation is to process terabytes of data in parallel acrossthousands of processing elements without requiring the applicationdeveloper to write any other code than mapper and reducer functions.

I The best-known map-reduce engine is Google’s MapReduce/GFS.

I GFS stands for Google File System, which is the distributedstorage-level infrastructure relied upon in Google’s MapReduce engine.

I Yahoo has contributed an open-source version to the ApacheSoftware Foundation, called Hadoop/DFS.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 77 / 133

Page 78: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (2)Functionalities

I A map-reduce engine automatically parallelizes and distributes theexecution of the mapper and reducer functions that characterize anapplication.

I Hence, it is an infrastructure for automatic partitioning andscheduling.

I It is highly-fault-tolerant, i.e., it is extremely resilient when nodes (ortasks in nodes) fail.

I It provides monitoring tools and exports a simple (if restricted)abstraction to application developers.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 78 / 133

Page 79: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (3)The Programming/Execution Model (1)

I The programming model (i.e., the abstractions with which anapplication developer designs a solution to a problem) uses thefunctional programming approach we described above.

I Developers implement two functions with the following interfaces:

map ( in_key, in_value )

-> (out_key, intermediate_value) list

reduce (out_key, intermediate_value list)

-> out_value list

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 79 / 133

Page 80: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (4)The Programming/Execution Model (2)

I The mapper function is fed data items (e.g., lines out of a file, rowsout of a database) in the form of (in key, in value) pairs.

I The role of the mapper function is to transform each one of the latterinto an (out key, intermediate value) pair.

I Note that the map-reduce engine requires the mapper to:

1. apply to one element only2. associate to the result an output key

I The results of the map phase are held in a barrier, which is whereintermediate values are left waiting.

I By removing from the writer of the mapper function, any control overthe grain of the task, a map-reduce engine can take decisions on taskpartitioning and parallel scheduling.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 80 / 133

Page 81: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (5)The Programming/Execution Model (3)

I The engine waits for the map phase to finish.

I When it is, all the intermediate values for a given output key areavailable in the barrier where they are combined to form a list peroutput key.

I The reducer function is fed such lists into one or more (typically one)final value for that same output key.

I By causing the writer of the mapper function to assign an output key,a map-reduce engine creates an opportunity to parallelize thereduction phase too, since each reduction task can operate on listsassociated with different output keys.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 81 / 133

Page 82: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (6)The Programming/Execution Model (4)

I As far as implicit parallelization goes:I the mapper functions run in parallel, creating different intermediate

values from different input data sets and emitting them with an outputkey, with which the engine can parallelize the reduce functions;

I the reducer functions run in parallel, operating on different output keyvalues.

I The only bottleneck is that the reduce phase cannot complete untilthe map phase is completed.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 82 / 133

Page 83: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (7)An Example Map-Reduce Computation

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 83 / 133

Page 84: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (8)Example Mapper and Reducer from Google: Counting Word Occurrences

map(String input_key, String input_value):

// input_key: document name

// input_value: document contents

for each word w in input_value:

EmitIntermediate(w, "1");

reduce(String output_key, Iterator intermediate_values):

// output_key: a word

// output_values: a list of counts

int result = 0;

for each v in intermediate_values:

result += ParseInt(v);

Emit(AsString(result));

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 84 / 133

Page 85: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (9)Locality Effects

I The master program divvies up tasks based on where data is located.

I For example, map tasks preferably run on the same node where thedata file is, or at least in the same rack.

I Map tasks are given 64-MB blocks (which is the size of the chunksserved by the underlying Google File System).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 85 / 133

Page 86: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (10)Fault Tolerance

I The master detects worker failures and

1. Re-executes completed and in-progress map tasks.2. Re-executes in-progress reduce tasks.

I The master detects when an (in key, in value) pair causes a map taskto crash and skips that when re-executing.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 86 / 133

Page 87: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce Engines

Map-Reduce Engines (11)Some Optimizations

I Since the reduce task cannot complete until the map task iscomplete, a single slow component can rate-limit the whole process.

I Therefore, the master replicates slow-going map tasks in severalcomponents, keeps the first to finish and ignores the rest.

I So-called combiner tasks can be scheduled in the same machine as amapper to perform a mini-reduce and save bandwidth before the realreduce phase starts.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 87 / 133

Page 88: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (1)Early Days

I There are preliminary accounts [Yang et al., 2007] as to how amap-reduce engine could act as a fully-functional query processingengine.

I There is evidence [Jiang et al., 2010] that parallel DBMSs stilloutperform a map-reduce engine, but the latter is not a specialistdesign for query processing, of course.

I Yahoo has been designing an imperative, high-level language, calledPig Latin [Olston et al., 2008], to express query-level operations overa map-reduce engine.

I However, as hinted above, selection and group-by aggregation seemto translate fairly directly to map-reduce computations.

I So, for at least some OLAP workloads, a map-reduce engine may yetcome to compete with data appliances.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 88 / 133

Page 89: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (2)A Worked-Out Example (1)

I Assume that a relation with the following schema:

Employees (emp_no:int, dept_name:str, salary:real)

has been horizontally fragmented per branch name and that the latterhas domain {’sales’, ’manufacturing’}.

I Thus, the fragments are:

Employees1 ← σdept name=′sales′(Employees)

Employees2 ← σdept name=′manufacturing ′(Employees)

and, therefore, Employees can be reconstructed as:

Employees ← Employees1 ∪ Employees2

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 89 / 133

Page 90: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (3)A Worked-Out Example (2)

I Consider now the following SQL query over the distributed databaseabove:

SELECT SUM(A.salary)

FROM Employees A

WHERE A.salary > 1000

GROUP BY A.dept_name

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 90 / 133

Page 91: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (4)A Worked-Out Example (3)

map(String input_key, TupleSet input_value):

// input_key: a fragment-defining attribute value

// input_value: the tuples in that fragment

// output_key: the GROUP BY attribute value

// intermediate_value: aggregation attribute value

// that satisfies the WHERE clause

for each tuple T in input_value:

if T.salary > 1000

EmitIntermediate(T.dept_name, T.salary);

// the barrier contains all (group-name, group-member) pairs

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 91 / 133

Page 92: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (5)A Worked-Out Example (4)

// reduce gets (group-name, group-member) pairs from the barrier

// as if hashed buckets

reduce(String output_key, Iterator intermediate_values):

// output_key: the group-by attribute value

// output_value: the partition contents defined by it

int result = 0;

for each v in intermediate_values:

result += v;

Emit((output_key, result));

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 92 / 133

Page 93: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (6)A Worked-Out Example (5)

I The analysis of the above functions in terms of relational algebra is asfollows.

I In this case, the mapper implements the following query:

B ← πdept name,salary (σsalary>1000(Employeesj))

I Because Employees is fragmented on dept name, the parallelizationcriterion has already been made explicit, as it were.

I In relational terms, the barrier holds the result of running the abovequery in parallel over each fragment j ∈ {1, 2}.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 93 / 133

Page 94: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Map-Reduce in Query Processing (7)A Worked-Out Example (6)

I The reducer implements the following query:

V ←dept name γsum(salary)(B)

I The result produced by each reducer instance running in parallel is a(single tuple) vertical fragment of the final result of the query, so toobtain the latter we use an iterated union:⋃

k∈dom(dept name)

Vk

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 94 / 133

Page 95: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Summary21st Century DBMSs: Massively-Distributed Data Processing (2)

I Massively-distributed processing over commodity clusters has proveditself in settings where the tasks that are parallelized have constrainedexpressiveness.

I Currently, it is an open question whether a map-reduce engine of thekind used by Google and Yahoo can be used for the kind of complexquery workloads that data appliances are being used for.

I If so, massively-parallel cluster-based schemes could come to be seenas Type 3 appliances, with an appealing TCO proposition in all ofacquisition, administration and operation.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 95 / 133

Page 96: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Map-Reduce in Query Processing

Advanced Database Management Systems21st Century DBMSs: NoSQL (or NOSQL)

Alvaro A A Fernandes

School of Computer Science, University of Manchester

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 96 / 133

Page 97: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

Outline

NoSQL: Why

NoSQL: What

NoSQL: When

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 97 / 133

Page 98: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: Why

Why Anything Other than SQL?Different Rates of Growth, Underlying Inflexibility

I There is a perception that the growth in data volumes causes SQLengines to fail to cope with the velocity aspect of big data.

I There is a perception that the variety of big data cannot beaccommodated by the relational model underlying SQL engines.

I NoSQL (or NOSQL) engines aim to respond to these perceivedshortcomings.

I When people refer to cloud databases, there is often an implicitreference to NoSQL databases, but we will not pursue the cloudaspects of the matter in this course unit.

I As we have seen, Stonebraker and Cattell (among others) argue thatthese shortcomings may be addressed without renouncing SQLengines and their underlying foundations.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 98 / 133

Page 99: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: Why

NoSQL or NOSQL? (1)No? Not Only?

I There is no consensus on whether the slogan isI ’No SQL!’?I ’Not only SQL!’?

I Which interpretation is adopted matters because ’NoSQL’ postulatesthat SQL has no role to play, whereas ’NOSQL’ postulates that SQLhas a role to play but is not, alone, enough.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 99 / 133

Page 100: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: Why

NoSQL or NOSQL? (2)Is It Really About SQL?

I But, is SQL (and, by implication, the relational model, calculi andalgebra) the right bone of contention or is SQL merely a stand-in forrelational DBMS architectures (and OLTP more specifically)?

I Indeed, there seem to be two sources of dissatisfaction:I the strictures of the relational model (essentially, the integrity

constraints, and not just the domain, key, and referential ones, but thenormal forms too, since they coerce the data into regular records),

I the strictures of how SQL engines coerce applications into runningunder certain architectural constraints that are perceived asperformance leaks (most notably, enforcing ACID transactionalsemantics) in big data contexts.

I The perception is, on the one hand, that classical OLTP DBMSscannot linearly scale response time on big data, and, on the other,that big data cannot be coerced into a strict relational view of theworld.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 100 / 133

Page 101: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

NoSQL (1)Six Characteristic Abilities

To [Cattell, 2010] six abilities, together, distinguish NoSQL databases:

1. To horizontally scale the throughput of simple-operation workloads overmany (potentially thousands of) servers.

2. To replicate and distribute data (through partitioning) over those (thousandsof) servers.

3. To expose a simple call-level interface or protocol (in contrast to aJDBC-like SQL binding).

4. To offer BASE guarantees only (i.e., a weaker concurrency and recoverymodel than the ACID guarantees offered by SQL-based DBMSs).

5. To make use (non-stop, 24 x 7 x 4 x 12) of distributed indexes efficiently forreplication-rich, elastic provision of data storage in both primary andsecondary memory.

6. To cope with (non-stop, 24 x 7 x 4 x 12) variations in the structure ofobjects stored.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 101 / 133

Page 102: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

NoSQL (2)Breakthroughs

As proofs-of-concept, the following systems have been influential:

1. memcached.org showed that indexes held in primary memory couldlead to scalability by distribution and replication of objects over manynodes.

2. Dynamo [DeCandia et al., 2007] showed that basic availability waspossible in the presence of massively-distributed, elastically scalable,highly-replicated storage if applications did not require stricterguarantees than eventual consistency.

3. Bigtable [Chang et al., 2008] showed that persistent extensiblerecord stores could scale to thousands of nodes.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 102 / 133

Page 103: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (1)DHTs as a Distributed Storage Structure

I (Ring-based) distributed hash tables (DHTs) implement distributedstorage schemes by partitioning the stored objects.

I Each key-value pair (k, v) is stored in the server at position h(k),where the range of h is [0, 2n − 1] where n is the number of servers.

I This is reminiscent of hash-based partitioning we have seen before.

I The API, as we have seen before, is put(key, value),get(key):value.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 103 / 133

Page 104: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (2)Key Space Partitioning in Ring-Based DHTs

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 104 / 133

Page 105: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (3)Problems to Be Solved

1. How do we route an operation like get(k) to the right server, i.e.,h(k)? A client only knows one server. It does not (and should not)necessarily know who is h(k) (i.e., what its position is).

2. How do we avoid disruption when n grows or shrinks to n ± 1? Weshould not need to reorganize the whole storage space (i.e., causedata movement everywhere).

3. How do we replicate for availability? We want the solutions to thetwo previous problems to also work when data is replicated.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 105 / 133

Page 106: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (4)Routing (1)

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 106 / 133

Page 107: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (5)Routing (2)

I The naıve way to route is it for servers to know/store who theirone-hop neighbours are.

I When you get a request you cannot serve, route it to your (clockwise)next-hop neighbour.

I This is O(n), so we must try to do better.

I To do better, we memorize a so-called finger table, whereby a servera knows/stores the positions of a, a + 20, a + 21, . . . , a + 2n−1.

I When you get a request you cannot serve, route it to the node in yourfinger table that is (clockwise) closest to the destination h(k).

I This is O(log(n)), so we will do better.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 107 / 133

Page 108: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (6)Adding/Removing Servers (1)

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 108 / 133

Page 109: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-Based DHTs for Scalability (7)Adding/Removing Servers (2)

I To add a new Server X:I Assign a random (unassigned) value in the key space as the position of

X.I Say X then lies between Server C and Server D.I Call C the (clockwise) last-hop neighbour of X, and D the next-hop.I Keys between the new server (X) and its next-hop neighbour (D),

remain with the latter.I Keys between the new server (X) and its last-hop neighbour (C),

become the responsibility of the former.

I To remove a server, its keys become the responsibility of its next-hopneighbour.

I Note that all changes are limited to a one-hop neighbourhood, i.e.,there is minimal disruption and overhead.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 109 / 133

Page 110: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (8)Replication in Ring-Based DHTs (1)

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 110 / 133

Page 111: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Ring-based DHTs for Scalability (9)Replication in Ring-Based DHTs (2)

I Replication is desirable since it increases the resilience to failure,avoids contention due to bottlenecks, and increases opportunities forparallelism.

I Ring-based DHTs allow for elegant replication (in the sense that thesolutions to routing and reconfiguration need only obvious extensionsin the presence of replication).

I If r is the degree of replications, then we assign a key k to the serversat position h(k), h(k) + 1, . . . , h(k) + r − 1.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 111 / 133

Page 112: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Approaches to Transactional Guarantees (1)ACID Effects on Availability and Scalability

I Guaranteeing ACID can be expensive due to the need topessimistically log, lock, and latch.

I Most DBMSs use the classical two-phase commit protocol (2PC),which is succinctly illustrated in [Alberton, 2011], to enforce ACIDproperties on transactions.

I 2PC relies on a central coordinator and so has a single-point of failure(compromising availability) and a performance bottleneck(compromising scalability).

I A distributed alternative exists, viz., the Paxos algorithm.

I Megastore [Baker et al., 2011] uses it to implement a NoSQL storewith ACID guarantees.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 112 / 133

Page 113: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Approaches to Transactional Guarantees (2)The BASE Alternative

I The BASE alternative to ACID optimistically avoids locking andlatching and pays the price of not always being in a consistent state.

I The need for locking and latching is because of hard state (i.e.,destructive assignment).

I If we adopt a notion of soft state (e.g., allow the coexistence ofdifferent versions of the state of a variable, or attribute), then we canpostpone the resolution of conflicts.

I Unfortunately, this also means that only the application can resolveconflicts (on which, recall Stonebraker-Cattell Rule 7).

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 113 / 133

Page 114: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (1)First, Multiversion Concurrency Control (1)

I Multiversion concurrency control (MVCC) introduced the idea ofstoring timestamped information about read and write events in orderto avoid locking pessimistically.

I Thus, rather than destructively assigning, one sees a history of events,of which some are accesses and some are changes.

I Each transaction gets a timestamp.

I There are multiple transactions.

I A write by a transaction with timestamp t cannot complete if there isany running transaction with a timestamp earlier than t.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 114 / 133

Page 115: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (1)First, Multiversion Concurrency Control (2)

I Objects have read timestamps.

I If a transaction T with timestamp t ′ tries to write onto an object owith a read timestamp t > t ′, then T is aborted and restarted with anew timestamp.

I Otherwise, i.e., if t < t ′, then T is allowed to write, o is versionedinto o ′ and the read and write timestamps of o ′ are set to t ′.

I MVCC incurs the cost of storing multiple versions of objects.

I MVCC enables application to reap the benefits of non-blocking reads.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 115 / 133

Page 116: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (2)A Variation on MVCC Timestamps

I Dynamo [DeCandia et al., 2007] uses vector clocks to establishwhether different versions of the same object are causally related.

I A vector clock is represented as a list of (node, counter) pairs, ratherthan just a timestamp as in MVCC.

I One vector clock is associated with every version of every object.

I We can tell that two versions of an object are on parallel branches orelse are causally related by examining their vector clocks.

I If the counters on the first object’s clock are less-than-or-equal to allof the nodes in the second clock, then the first is an ancestor of thesecond and can be forgotten (e.g., garbage-collected.)

I Otherwise, the two changes are considered to be in conflict andrequire reconciliation.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 116 / 133

Page 117: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (3)An Example (1)

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 117 / 133

Page 118: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (4)An Example (2)

I A client writes a new object.

I The node (say Sx) that handles the write for this key increases itscounter and uses it to create the data’s vector clock.

I The system now has the object D1 and its associated clock [(Sx, 1)].

I The client updates the object.

I Assume the same node handles this request as well.

I The system now also has object D2 and its associated clock [(Sx, 2)].D2 descends from D1 and therefore over-writes D1, however theremay be replicas of D1 lingering at nodes that have not yet seen D2.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 118 / 133

Page 119: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (5)An Example (3)

I Let us assume that the same client updates the object again and adifferent server (say Sy) handles the request.

I The system now has data D3 and its associated clock [(Sx, 2), (Sy,1)].

I Next assume a different client reads D2 and then tries to update it,and another node (say Sz) does the write.

I The system now has D4 (a descendant of D2) whose version clock is[(Sx, 2), (Sz, 1)].

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 119 / 133

Page 120: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (6)An Example (4)

I A node that is aware of D1 or D2 could determine, upon receiving D4and its clock, that D1 and D2 are overwritten by the new data andcan be garbage collected.

I A node that is aware of D3 and receives D4 will find that there is nocausal relation between them.

I In other words, there are changes in D3 and D4 that are not reflectedin each other.

I Both versions of the data must be kept and presented to a client(upon a read) for semantic reconciliation.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 120 / 133

Page 121: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: What

Vector Clocks for Soft-State Eventual Consistency (7)An Example (5)

I Now assume some client reads both D3 and D4 (the context willreflect that both values were found by the read).

I The read’s context is a summary of the clocks of D3 and D4, namely[(Sx, 2), (Sy, 1), (Sz, 1)].

I If the client performs the reconciliation and node Sx coordinates thewrite, Sx will update its sequence number in the clock.

I The new data D5 will have the following clock: [(Sx, 3), (Sy, 1), (Sz,1)].

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 121 / 133

Page 122: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

When to Use NoSQL? When to Use SQL? When to UseNOSQLShifting, Ever-Changing Technological Landscape

I The first thing to note is that, for now, it is false that one size fitsall, i.e., no single approach is valid for all users/applications.

I SQL and NoSQL are complementary:I SQL can scale on big data and retain ACID guarantees for OLTP.I Queries are crucial in OLAP productivity too.I NoSQL is more flexible to cope with data variety and may pay less

overheads due to BASE guarantees only.I However, NoSQL dumps the complex semantics that SQL takes on

itself on application programmers.

I We still need some way of dealing with machine-generated andphysical-world streamed data.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 122 / 133

Page 123: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

Summary21st Century DBMSs: NoSQL (or NOSQL)

I In spite of terminological confusion, distributed storage systems thatscale horizontally over flexible data types and deliver excellentavailability at the cost of soft-state eventual (andapplication-delegated) consistency are now significant players in thedata management landscape.

I NoSQL stores seem complementary to SQL stores, so NOSQL isprobably the most appropriate reading.

I The loss of queries is significant, so much so that there are initiativesin place to endow NOSQL stores with a QL of their own.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 123 / 133

Page 124: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

Acknowledgements (1)

The material presented mixes original material by the author as well asmaterial adapted from

I [Monash, 2007a, Monash, 2007b]

I [Stonebraker and Cattell, 2011]

I [Cattell, 2010]

I [DeCandia et al., 2007]

The author gratefully acknowledges the work of the authors cited whileassuming complete responsibility any for mistake introduced in theadaptation of the material.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 124 / 133

Page 125: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

Acknowledgements (2)

***Portions of the material presented are modifications based on work createdand shared by Google and used according to terms described in theCreative Commons 2.5 Attribution License:

http://creativecommons.org/licenses/by/2.5/

The original content was authored by Aaron Kimball, SierraMichels-Slettvet, Christophe Bisciglia, Hannah Tang, Albert Wong, AlexMoshchuk et al. and can be accessed from

http://code.google.com/edu/content/parallel.html

The current author is grateful to Google and the authors of the originalcontent for sharing their work. The current author assumes responsibilityany for mistake introduced in the modifications made.***

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 125 / 133

Page 126: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (1)

Alberton, L. (2011).NoSQL databases: Why, what and when.Talk at UK PHP Conference.http:

//www.slideshare.net/quipo/nosql-databases-why-what-and-when.

Baker, J., Bond, C., Corbett, J., Furman, J. J., Khorlin, A., Larson, J., Leon,J.-M., Li, Y., Lloyd, A., and Yushprakh, V. (2011).Megastore: Providing scalable, highly available storage for interactiveservices.In Franklin, M., editor, CIDR, pages 223–234. www.crdrdb.org.

http://www.cidrdb.org/cidr2011/Papers/CIDR11 Paper32.pdf.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 126 / 133

Page 127: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (2)

Brewer, E. A. (2000).Towards robust distributed systems (abstract).In Neiger, G., editor, PODC, page 7. ACM.http://doi.acm.org/10.1145/343477.343502.

Cattell, R. (2010).Scalable sql and nosql data stores.SIGMOD Record, 39(4):12–27.http://doi.acm.org/10.1145/1978915.1978919.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 127 / 133

Page 128: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (3)

Chang, F., Dean, J., Ghemawat, S., Hsieh, W. C., Wallach, D. A.,Burrows, M., Chandra, T., Fikes, A., and Gruber, R. E. (2008).Bigtable: A distributed storage system for structured data.ACM Trans. Comput. Syst., 26(2).http://doi.acm.org/10.1145/1365815.1365816.

DeCandia, G., Hastorun, D., Jampani, M., Kakulapati, G., Lakshman,A., Pilchin, A., Sivasubramanian, S., Vosshall, P., and Vogels, W.(2007).Dynamo: amazon’s highly available key-value store.In Bressoud, T. C. and Kaashoek, M. F., editors, SOSP, pages 205–220.ACM.

http://doi.acm.org/10.1145/1294261.1294281.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 128 / 133

Page 129: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (4)

Gilbert, S. and Lynch, N. A. (2002).Brewer’s conjecture and the feasibility of consistent, available,partition-tolerant web services.SIGACT News, 33(2):51–59.http://doi.acm.org/10.1145/564585.564601.

Harizopoulos, S., Abadi, D. J., Madden, S., and Stonebraker, M.(2008).Oltp through the looking glass, and what we found there.In [Wang, 2008], pages 981–992.

http://doi.acm.org/10.1145/1376616.1376713.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 129 / 133

Page 130: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (5)

Jiang, D., Ooi, B. C., Shi, L., and Wu, S. (2010).The performance of mapreduce: An in-depth study.PVLDB, 3(1):472–483.http://vldb.org/pvldb/vldb2010/pvldb vol3/E03.pdf.

Monash, C. A. (2007a).Design choices in mpp data warehousing.Technical report, Monash Research White Paper.http://www.monash.com/DATAllegro-V3.pdf.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 130 / 133

Page 131: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (6)

Monash, C. A. (2007b).Index-light mpp data warehousing.Technical report, Monash Research White Paper.http://www.monash.com/MPP-Appliance.pdf.

Olston, C., Reed, B., Srivastava, U., Kumar, R., and Tomkins, A.(2008).Pig latin: a not-so-foreign language for data processing.In [Wang, 2008], pages 1099–1110.

http://doi.acm.org/10.1145/1376616.1376726.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 131 / 133

Page 132: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (7)

Stonebraker, M. and Cattell, R. (2011).10 rules for scalable performance in ’simple operation’ datastores.Commun. ACM, 54(6):72–80.http://doi.acm.org/10.1145/1953122.1953144.

Wang, J. T.-L., editor (2008).Proceedings of the ACM SIGMOD International Conference onManagement of Data, SIGMOD 2008, Vancouver, BC, Canada, June10-12, 2008. ACM.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 132 / 133

Page 133: Advanced Database Management Systemsstudentnet.cs.manchester.ac.uk/pgt/2012/COMP60731/... · DBMSs, Then and Now Issues for Classical DBMSs (1) Not Only Structured, Semi- and Unstructured

NoSQL: When

References (8)

Yang, H.-C., Dasdan, A., Hsiao, R.-L., and Jr., D. S. P. (2007).Map-reduce-merge: simplified relational data processing on largeclusters.In Chan, C. Y., Ooi, B. C., and Zhou, A., editors, SIGMODConference, pages 1029–1040. ACM.http://doi.acm.org/10.1145/1247480.1247602.

AAAF (School of CS, Manchester) Advanced DBMSs 2012-2013 133 / 133