The CAT Theorem Shegufta Ahsan, Indranil Gupta

Slides:



Advertisements
Similar presentations
Wyatt Lloyd * Michael J. Freedman * Michael Kaminsky David G. Andersen * Princeton, Intel Labs, CMU Dont Settle for Eventual : Scalable Causal Consistency.
Advertisements

Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services Authored by: Seth Gilbert and Nancy Lynch Presented by:
Failure Detection The ping-ack failure detector in a synchronous system satisfies – A: completeness – B: accuracy – C: neither – D: both.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Replication Steve Ko Computer Sciences and Engineering University at Buffalo.
NoSQL Databases: MongoDB vs Cassandra
Reporter: Haiping Wang WAMDM Cloud Group
What Should the Design of Cloud- Based (Transactional) Database Systems Look Like? Daniel Abadi Yale University March 17 th, 2011.
MS CLOUD DB - AZURE SQL DB Fault Tolerance by Subha Vasudevan Christina Burnett.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 18: Replication Control All slides © IG.
NoSQL and NewSQL Justin DeBrabant CIS Advanced Systems - Fall 2013.
NoSQL Database.
Massively Parallel Cloud Data Storage Systems S. Sudarshan IIT Bombay.
Databases with Scalable capabilities Presented by Mike Trischetta.
PCAP Project: Probabilistic CAP and Adaptive Key-value Stores
© , OrangeScape Technologies Limited. Confidential 1 Write Once. Cloud Anywhere. Building Highly Scalable Web applications BASE gives way to ACID.
Modern Databases NoSQL and NewSQL Willem Visser RW334.
High Throughput Computing on P2P Networks Carlos Pérez Miguel
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Trade-offs in Cloud.
CAP + Clocks Time keeps on slipping, slipping…. Logistics Last week’s slides online Sign up on Piazza now – No really, do it now Papers are loaded in.
CSE 486/586 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
CAP Theorem Justin DeBrabant CIS Advanced Systems - Fall 2013.
Lecture 8: Databases and Data Infrastructure CS 6071 Big Data Engineering, Architecture, and Security Fall 2015, Dr. Rozier.
Scale up Vs. Scale out in Cloud Storage and Graph Processing Systems
University of Illinois at Urbana-Champaign
CSE 486/586 Distributed Systems Consistency --- 3
CSE 486/586 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Transactions on Replicated Data Steve Ko Computer Sciences and Engineering University at Buffalo.
Data and Information Systems Laboratory University of Illinois Urbana-Champaign Data Mining Meeting Mar, From SQL to NoSQL Xiao Yu Mar 2012.
Database Applications (15-415) NoSQL Databases Lecture 24, November 27, 2016 Mohammad Hammoud.
CSCI5570 Large Scale Data Processing Systems
University of Illinois at Urbana-Champaign
Cloud Computing and Architecuture
A free and open-source distributed NoSQL database
Trade-offs in Cloud Databases
CSE 486/586 Distributed Systems Consistency --- 1
Operational & Analytical Database
Modern Databases NoSQL and NewSQL
NOSQL.
CPS 512 midterm exam #1, 10/7/2016 Your name please: ___________________ NetID:___________ /60 /40 /10.
CSCI5570 Large Scale Data Processing Systems
Strong Consistency & CAP Theorem
Database Concepts.
Strong Consistency & CAP Theorem
Introduction to NewSQL
NOSQL databases and Big Data Storage Systems
The SNOW Theorem and Latency-Optimal Read-Only Transactions
Strong Consistency & CAP Theorem
Massively Parallel Cloud Data Storage Systems
CSE 486/586 Distributed Systems Consistency --- 3
NoSQL Databases An Overview
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
CSE 486/586 Distributed Systems Consistency --- 1
EEC 688/788 Secure and Dependable Computing
Benchmarking Cloud Serving Systems with YCSB
EEC 688/788 Secure and Dependable Computing
Lecture 21: Replication Control
Atomic Commit and Concurrency Control
EECS 498 Introduction to Distributed Systems Fall 2017
CONSISTENCY IN DISTRIBUTED SYSTEMS
Transaction Properties: ACID vs. BASE
EEC 688/788 Secure and Dependable Computing
NoSQL databases An introduction and comparison between Mongodb and Mysql document store.
Global Distribution.
Lecture 21: Replication Control
CSE 486/586 Distributed Systems Consistency --- 3
CSE 486/586 Distributed Systems Consistency --- 1
Communication Driven Remapping of Processing Element (PE) in Fault-tolerant NoC-based MPSoCs Chia-Ling Chen, Yen-Hao Chen and TingTing Hwang Department.
Presentation transcript:

The CAT Theorem Shegufta Ahsan, Indranil Gupta Department of Computer Science University of Illinois at Urbana-Champaign DPRG: http://dprg.cs.uiuc.edu

Contributions A new impossibility theorem ``CAT’’ for transaction-based distributed databases C – Contention A – Abort Rate T – Throughput Experimental Validation with 3 databases 1 NewSQL 2 Traditional RDBMs

NoSQL database systems Apache Cassandra, Riak, Dynamo, Voldemort… Basic CRUD operations Create, Read, Update, Delete Low latency High availability Weak consistency

CAP Theorem [Brewer 00, Gilbert&Lynch 02] Consistency Partition-tolerance Availability RDBMSs (non-replicated) Cassandra, Riak, Dynamo, Voldemort HBase, HyperTable, BigTable, Spanner Starting point for NoSQL Revolution A distributed storage system can achieve at most two of C, A, and P. Consistency – all nodes see same data/updates in order Availability – all reads/writes succeed Partition tolerance – C and A even under partitions When partition-tolerance is important, you have to choose between consistency and availability PACELC Variant [Abadi 12]: under partitions, choose between latency and consistency

New Consistency Models and New CAPs Strong (e.g., Sequential) Eventual Causal Red-Blue CRDTs Per-key sequential Probabilistic Since “eventual” NoSQL systems emergence, many have strengthened consistency while maintaining throughput In SOSP 2015: Six papers supporting ACID with high throughput Yesquel [Microsoft Research/VMWare], Tapir [U. Washington], Callas [U. Texas- Austin] FaRM [Microsoft Research], RIFL [Stanford], DrTM [SJTU] (Others: Hyperdex [Cornell]) Some researchers say CAP theorem invalid Others say “P” in CAP should = “Performance” (Throughput) In 2012 Brewer clarified some of his positions, including why the often-used "two out of three" concept can be misleading or misapplied

CAP Alive, Impractical CAP theorem is true, formally proved There is a gap between the CAP theorem and the practical needs of today’s systems Partitions are relatively rare Availability is a fuzzy term Need for a new theorem that captures performance limitations of ACID systems Our CAT Theorem In 2012 Brewer clarified some of his positions, including why the often-used "two out of three" concept can be misleading or misapplied

CAP vs CAT CAP CAT Consistency Contention Availability Abort Rate C – Contention A – Abort Rate T – Throughput CAP vs CAT CAP CAT Consistency Contention Availability Abort Rate Partition Tolerance Throughput

CAT Definitions Contention: How much transactions overlap with each other Abort Rate : Fraction of submitted transactions that are aborted Throughput: Committed Transactions Per Second (TPS)

CAT Definitions (And Analogies to CAP) Contention: How much transactions overlap with each other Strongly consistent (Zero contention): Immutable NoSQL System ACID System supporting only read-only transactions Abort Rate : Fraction of submitted transactions that are aborted From client viewpoint: Transaction Abort in ACID ≅ Unavailability for a CRUD op in NoSQL Throughput: Committed Transactions Per Second (TPS)

CAT Theorem No transactional database can support arbitrarily high levels of contention while yielding both a zero abort rate as well as high throughput. (Or: Can’t get all 3 of C, A, T) (CAT theorem does not replace, but sits alongside CAP theorem) When there are non zero contention in the system, the abort rate grows as the square of the throughput and thus the abort rate can not be zero

Some Simple CAT Scenarios C – Contention A – Abort Rate T – Throughput Some Simple CAT Scenarios Scenario-I (C and A): Executing one transaction at a time (zero contention)  zero Abort rate, but low Throughput Scenario-II (C and T): Executing all transactions concurrently  high Throughput, but increases the Abort rate Scenario-III (A and T): Immutable database/Read-only transactions  both high Throughput and zero Abort rate

CAT Theorem “Proof” [Gray et al 96] C – Contention A – Abort Rate T – Throughput CAT Theorem “Proof” [Gray et al 96] When there is contention across transactions, the abort rate increases at least as Square of the throughput of the system Third to fifth power of transaction size

Measurements

Measuring Contention Our “Contention Level” metric C – Contention A – Abort Rate T – Throughput Measuring Contention Our “Contention Level” metric For a set of concurrent transactions Common Objects are those objects that are accessed by at least 2 transactions in a set of concurrent transaction Contention Level = (total accesses to common objects) / (total number of accesses) Lies in [0,1]

Measuring Contention Example: Three concurrent transactions: C – Contention A – Abort Rate T – Throughput Measuring Contention Example: Three concurrent transactions: T1 = {obj1, obj2, obj3} T2 = {obj4, obj2, obj5} T3 = {obj5, obj6, obj7} Total number of common object accesses: 4 Total number of objects accessed: 9 Contention Level = 4/9 = 0.44

Contention Level Vs. Vs. Jim Gray’s contention metric (Equation 1, works for Uniform Distribution only) Overestimates abort rate Vs. Real abort probability (based on serial equivalence rules) Not exact, but parallel trend

Systems Chosen for Validation Yesquel [Microsoft Research/VMWare SOSP 2015] Amazon RDS Microsoft SQL (Fail: Tapir) (Fail: Hyperdex) (Unavailable: Callas)

Experimental Setup Yesquel : All experiments were run on EmuLab cluster (3 servers, up to 7 clients). We wrote a benchmarking tool in C++ (similar to YCSB+T) MS Azure SQL, Amazon RDS : publicly available APIs were used. We wrote the same benchmarking tool (YCSB+T) in C# and Java Database contained total 1000 keys, total 10K transactions Clients continuously send transactions one at a time

Variables η = length of the transaction η = 4 → { perform transaction on keys a,b,c,d} η = 8 → { perform transaction on keys a,b,c,d,e,f,g,h} α = Zipfian co-efficient. Higher value means some objects more popular. α = 0.1, Total keys = 10 Total calls = 1000 α = 0.9, Total keys = 10 Total calls = 1000

Y = Yesquel, A = AWS RDS, M = MS SQL C – Contention A – Abort Rate T – Throughput Y = Yesquel, A = AWS RDS, M = MS SQL

Y = Yesquel, A = AWS RDS, M = MS SQL C – Contention A – Abort Rate T – Throughput Y = Yesquel, A = AWS RDS, M = MS SQL As Contention Increases Abort Rate Rises Aggregate Throughput Rises

Y = Yesquel, A = AWS RDS, M = MS SQL C – Contention A – Abort Rate T – Throughput Y = Yesquel, A = AWS RDS, M = MS SQL CA Scenario: 1 Client only = No Contention Zero Abort rate But Lowest Aggregate Throughput

Y = Yesquel, A = AWS RDS, M = MS SQL C – Contention A – Abort Rate T – Throughput Y = Yesquel, A = AWS RDS, M = MS SQL With Rising Contention Per-client Throughput Decreases

Y = Yesquel, A = AWS RDS, M = MS SQL C – Contention A – Abort Rate T – Throughput Y = Yesquel, A = AWS RDS, M = MS SQL MS SQL > AWS RDS (>? Yesquel): Surprising(?)

Zero Contention (AT Scenario, Yesquel) C – Contention A – Abort Rate T – Throughput Zero Contention (AT Scenario, Yesquel) All Read-only transactions → zero Abort rate Increasing number of clients → Throughput rises linearly When there is no contention, there are no aborts and throughput rises linearly

Effect of Transaction Overlap Y = Yesquel A = AWS RDS M = MS SQL Effect of Transaction Overlap Contention can also be increased by Increasing transaction “overlap” Increasing Zipf Coefficient (α): Increases Contention Level Increases Abort Rate Decreases Throughput

Effect of Transaction Length η Y = Yesquel A = AWS RDS M = MS SQL Effect of Transaction Length η Contention can also be increased by Increasing transaction length Result – same as before: Increases Contention Level Increases Abort Rate Decreases Throughput

Takeaways Transactional databases don’t mesh with CAP Theorem Our new CAT Theorem states new, practical, impossibility Cannot support high Contention, and achieve zero Aborts, and high Throughput, all at once. Inspired by Jim Gray’s paper New Contention Level metric Validated with a NewSQL System (Yesquel) and 2 traditional RDBMSs (AWS RDS, MS SQL) Further Directions: CAP-like variants for transactional systems Interplay of CAP and CAT theorems CAT applied to transactional shared-memory models http://dataconomy.com/sql-vs-nosql-vs-newsql-finding-the-right-solution/ PACELC : https://brooker.co.za/blog/2014/07/16/pacelc.html DPRG: http://dprg.cs.uiuc.edu

Backup Slides

Summary A new impossibility theorem ``CAT’’ for transaction-based distributed databases : No transactional database can support arbitrarily high levels of contention while yielding both a zero abort rate as well as a high throughput CAT sits alongside the classical CAP and its variants We propose a new Metric to measure the contention in a system http://dataconomy.com/sql-vs-nosql-vs-newsql-finding-the-right-solution/ PACELC : https://brooker.co.za/blog/2014/07/16/pacelc.html

CAT Theorem No transactional database can support arbitrarily high levels of contention while yielding both a zero abort rate as well as a high throughput Jim Gray 1996:: The dangers of replication and a solution When there are non zero contention in the system, the abort rate grows as the square of the throughput and thus the abort rate can not be zero

NewSQL systems Modern relational database management systems Provide the same scalable performance of NoSQL Supports Online Transaction Processing (OLTP) Maintains ACID guarantees Atomicity Consistency Isolation Durability

CAP-NoSQL Vs CAT-NewSQL CAP – originally intended for CRUD supporting NoSQL system CAT – intended for transactional/NewSQL system “abort” in NewSql ↔ “unavailability” in NoSQL Contention across transaction is an important factor In CRUD, an immutable system supports strong consistency In transactional system, if all transactions are read-only, there will be no abort

Our Contribution Transactional-based distributed database (NewSQL) systems need a more practical version of a CAP-like impossibility theorem One that is focused on realistic metrics: Abort rate Throughput We propose the CAT impossibility theorem C – Contention A – Abort Rate T – Throughput We propose a new Metric to measure the contention in a system