You are on page 1of 25

NoSQL & NewSQL

Immanuel Trummer

itrummer@cornell.edu

www.itrummer.org
Reading List
• https://cassandra.apache.org/

• Data Consistency Properties and the Trade-offs in Commercial


Cloud Storages: the Consumers’ Perspective, H. Wada et al,
CIDR 2011

• https://www.infoq.com/articles/cap-twelve-years-later-how-the-
rules-have-changed/, E. Brewer.

• H-Store: A High-Performance, Distributed Main Memory


Transaction Processing System, R. Kallman et al., 2008.

• NewSQL vs. NoSQL for New OLTP, M. Stonebraker, 2011.



https://www.youtube.com/watch?v=uhDM4fcI2aI

Slides by Immanuel Trummer, Cornell University


Terminology Warning

• Consistency so far: database satisfies all constraints

• Now: consistency means ~ all replicas appear in sync

• Terminology from distributed systems community

Slides by Immanuel Trummer, Cornell University


Consistency vs. Availability

Site 1 Site 2

Inventory: Copy 1 Inventory: Copy 2

Slides by Immanuel Trummer, Cornell University


Consistency vs. Availability

Site 1 Site 2

Inventory: Copy 1 Inventory: Copy 2

Slides by Immanuel Trummer, Cornell University


Consistency vs. Availability

Site 1 Site 2

Inventory: Copy 1 Inventory: Copy 2

Buy DVD!

Slides by Immanuel Trummer, Cornell University


Consistency vs. Availability

Site 1 Site 2

-1 DVD
Inconsistent!

Inventory: Copy 1 Inventory: Copy 2

Buy DVD!

Slides by Immanuel Trummer, Cornell University


Consistency vs. Availability

Site 1 Site 2

Not
available!
Inventory: Copy 1 Inventory: Copy 2

Buy DVD!

Slides by Immanuel Trummer, Cornell University


The CAP Theorem
Partition 

Tolerance
C

ty
on

li
bi
si

ila
st
en

a
Av
y c

Slides by Immanuel Trummer, Cornell University


The CAP Theorem
Partition 

Tolerance

Not 

Possible!
C

ty
on

li
bi
si

ila
st
en

a
Av
y c

Slides by Immanuel Trummer, Cornell University


The CAP Theorem
Partition 

Tolerance

Traditional
 NoSQL

DBMS Systems
Not 

Possible!
C

ty
on

li
bi
si

ila
st
en

a
Av
y c

Slides by Immanuel Trummer, Cornell University


Eventual Consistency

• Traditional DBMS choose consistency over availability

• This is not ideal in scenarios such as online shopping

• Here, we want to be available at all costs

• Need to accept inconsistency according to CAP

• This inconsistency is resolved eventually

Slides by Immanuel Trummer, Cornell University


BASE Transactions

• BASE =

• Basically Available

• Soft State

• Eventually Consistent

Slides by Immanuel Trummer, Cornell University


NoSQL
• Systems that move away from traditional SQL DBMS

• Broad term covering many aspects such as

• Reduced consistency (BASE)

• Non-SQL query languages

• Non-relational data models

• ...

Slides by Immanuel Trummer, Cornell University


Apache Cassandra
• Distributed system, every node has the same role

• Wide column store ~ rows have different columns

• Supports CQL, simpler than SQL (e.g., no joins)

• Supports replication for fault tolerance

• Goal: scale linearly when adding new nodes

• Eventually consistent with tunable consistency

Slides by Immanuel Trummer, Cornell University


CAP Criticism

• Focuses on an extreme case: full partitions are rare

• Simplifies tension between conflicting design goals

• E.g., can decide A vs. C for single transactions

• E.g., consistency is not a binary property

• ...

Slides by Immanuel Trummer, Cornell University


NewSQL

• "Traditional SQL": ACID at the expense of performance

• NoSQL: give up ACID for higher performance

• NewSQL: new ideas for ACID with high performance

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions

• No user input needed

• Transactions ~ templates

• Modern Hardware

• Main memory often fits entire DB

• Distributed systems common

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions


Design

• No user input needed

Implications


?
Transactions ~ templates

• Modern Hardware

• Main memory often fits entire DB

• Distributed systems common

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions

• No user input needed

• Transactions ~ templates

• Modern Hardware

• Main memory often fits entire DB

• Distributed systems common

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions

• No user input needed

• Transactions ~ templates

• Modern Hardware

• Main memory often fits entire DB


Main memory DBMS

• Distributed systems common

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions

• No user input needed

• Transactions ~ templates

• Modern Hardware

• Main memory often fits entire DB


Main memory DBMS
Replication for 

• Distributed systems common
fault tolerance

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions

Serial Execution!

(Single Site Txs)
• No user input needed

• Transactions ~ templates

• Modern Hardware

• Main memory often fits entire DB


Main memory DBMS
Replication for 

• Distributed systems common
fault tolerance

Slides by Immanuel Trummer, Cornell University


H-Store: Observations
• Modern Transaction Workloads

• Short running transactions

Serial Execution!

(Single Site Txs)
• No user input needed

• Transactions ~ templates
Exploit Pre-processing

• Modern Hardware

• Main memory often fits entire DB


Main memory DBMS
Replication for 

• Distributed systems common
fault tolerance

Slides by Immanuel Trummer, Cornell University


H-Store Overview
Schema Cluster Info

OLTP Application
Workload Stored Proc.

Deployment Time
Transaction Initiator
Deployment Framework

Run Time
Database Designer Messaging Fabric

Query Optimizer
Transaction Manager
Stored Proc. Executor
Compiled Stored Proc.
Query Execution Engine
Physical Layout
System Catalogs
Query Plans

H-Store: A High-Performance, Distributed Main Memory Transaction Processing System, 



R. Kallman et al.
Slides by Immanuel Trummer, Cornell University

You might also like