SlideShare a Scribd company logo
1 of 71
Download to read offline
A NoSQL Rollercoaster
Saturday, November 6, 2010
Saturday, November 6, 2010
IMS
The Hierarchical
Database
(1966)
Vern Watts
Saturday, November 6, 2010
“A Relational
Model for Large
Shared
Databanks”
(1970)
Ted Codd
Saturday, November 6, 2010
“"SEQUEL: A
Structured
English Query
Language"
Don Chamberlin & Ray
Boyce
(1974)
Don Chamberlin
Saturday, November 6, 2010
ACID
(late 1970’s)
Jim Gray
Saturday, November 6, 2010
“NoSQL”
coined
(1998)
Carlo Strozzi
Saturday, November 6, 2010
“NoSQL” Reintroduced
(2008)
Eric Evans
Saturday, November 6, 2010
select fun, profit from
real_world where
relational=false?
Saturday, November 6, 2010
“In striving to make every
user happy, a technology an
actually leave the majority
unhappy.”
“Every good idea is
generalized to its level of
inapplicability.”
(Peter Principle)
Saturday, November 6, 2010
Saturday, November 6, 2010
Why?
Saturday, November 6, 2010
Internet Scale
• Massive data
collections
• Huge number of
requests
• Coming from
geographic areas
across the globe
• 24/7
Saturday, November 6, 2010
Total Cost of Ownership
• The price of a license
• The price of support
• The price of hardware
Saturday, November 6, 2010
Availability
Saturday, November 6, 2010
Data Models
Saturday, November 6, 2010
Column Oriented
…
key
named
column
named
column
named
column
named
column
named
column
Column Family ≈ Table
Empty cells are
cheap (sparse
table)
Can grow “indefinitely”
Schemaless
No
secundary
indexes
Saturday, November 6, 2010
Column Oriented + Super Columns
…
key
named
column
named
column
named
column
named
column
named
column
…
named
column
named
column
named
column
…
Super Columns
Saturday, November 6, 2010
Key Value Store
•Schemaless
•Versioning
1011
0110
Saturday, November 6, 2010
Graph Database
SPARQL?
Saturday, November 6, 2010
Document Store
Improved
Indexing
<persons>
<person>
<name>Wilfred</name>
<surname>Springer
</person>
…
</persons>
[{ "Name" :
"Wilfred",
"Surname" :
"Springer"},
…
]
JSON
XML
Serverside
Processing
Saturday, November 6, 2010
Challenges
Saturday, November 6, 2010
CAP
Theorem
Eric Brewer
Saturday, November 6, 2010
Availability Consistency
Partition
Tolerance
Pick two
Saturday, November 6, 2010
Consistency
Consistency
Strong
Consistency
Weak
Consistency
Eventual
Consistency
Other
Causal
Consistency
Read-your-
writes
Consistency
Session
Consistency
Monotonic Read
Consistency
Monotonic Write
Consistency
Saturday, November 6, 2010
Strong Consistency
A
B
C
1
2
2
2
0 value = "foo"
value = "bar"
value = "bar"
value = "bar"
value = "bar"
After the update, any subsequent access will return the
updated value.
Saturday, November 6, 2010
Weak Consistency
A
B
C
1 value = "bar"
value = "bar" /
"foo"
value = "bar" / "foo"
value = "bar" / "foo"
0 value = "foo"
>1
>1
>1
The system does not guarantee that at any given point in
the future subsequent access will return the updated
value
Saturday, November 6, 2010
Eventual Consistency
If no updates are made to the object, eventually all
accesses will return the last updated value.
A
B
C
1 value = "bar"
value = "bar"
value = "bar"
value = "bar"
0 value = "foo"
t
t
t
t ≥ 1
Saturday, November 6, 2010
Session Consistency
Within the “session”, the system guarantees read-your-
writes consistency
2 value = "foo"
Session 1
Session 2
A
B
C
1 value = "bar"
0 value = "foo"
2 value = "bar"
Saturday, November 6, 2010
Partition Tolerance
A
writes new value
replicates
new value
reads new
value
Saturday, November 6, 2010
Partition Tolerance
A
writes new value
replicates
new value
reads new
value
!
Saturday, November 6, 2010
Partition Tolerance
A
writes new value
fails to
replicate
new value
reads old
value
Saturday, November 6, 2010
Partition Tolerance
A
failing attempt
to write a new
value
fails to
replicate
new value
Saturday, November 6, 2010
Byzantine Failures
Saturday, November 6, 2010
Faults that might
occur in a
distributed
system
•Lying
•Fabrication of messages
•Collisions
•Selective non-participation
Saturday, November 6, 2010
Byzantine
Generals
Problem
Saturday, November 6, 2010
Solution
Strategies
Saturday, November 6, 2010
Strong
Consistency
1
Saturday, November 6, 2010
Παξοί
Saturday, November 6, 2010
Leader Proposer
Acceptor Learner
Four Roles
Saturday, November 6, 2010
Paxos in a Nutshell
Request
Propose
Promise
Accept
Accepted
Response
Saturday, November 6, 2010
Processors
combine
various
roles
Consensus
based on
majority vote
Paxos guarantees
progress for 2F + 1
processors in face of
failure of F processors
Saturday, November 6, 2010
“Either Paxos,
Paxos with
cruft, or
broken”
Mike Burrows
(Google Chubby)
Saturday, November 6, 2010
Partitioning
2
Saturday, November 6, 2010
Consistent Hashing
Key K
A
B
C
D
E
F
G
H
Saturday, November 6, 2010
High
Availability
3
Saturday, November 6, 2010
Replication
A
B
C
D
E
F
G
H
Saturday, November 6, 2010
W = 3
N = 4
R = 2
A
Replication Factor
Saturday, November 6, 2010
W = 3
N = 4
R = 2
A
Reconciliation during reads
Reconciliation
Saturday, November 6, 2010
Handling
Temporary
Failures
4
Saturday, November 6, 2010
Problem
Reconcilation
?
Alice Ben CathyDave
Wednesday?
Thursday
Tuesday
What's it gonna be?
Tuesday ThursdayX
? ? ?
Saturday, November 6, 2010
Vector Clocks
date = Wednesday
vclock = Alice:1
date = Tuesday
vclock = Alice:1, Ben:1
date = Tuesday
vclock = Alice:1, Ben:1, Dave:1
date = Tuesday
vclock = Alice:1, Cathy:1
date = Thursday
vclock = Alice:1, Ben:1, Cathy:1, Dave:2
Saturday, November 6, 2010
Conflict Resolution
date = Tuesday
vclock = Alice:1, Ben:1, Dave:1
date = Thursday
vclock = Alice:1, Ben:1, Cathy:1, Dave:2
6
Saturday, November 6, 2010
Recovering from
permanent
failures
5
Saturday, November 6, 2010
What if nodes die permantly?
A
B
C
D
E
F
G
H
Saturday, November 6, 2010
Merkle Trees
#
#
#
#
#
#
#
#
#
#
#
#
#
#
Saturday, November 6, 2010
Enough is enough!!!
Saturday, November 6, 2010
Conclusions
Saturday, November 6, 2010
Conclusions
Scale!!!
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Control
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Control
Take control
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Control
Take control
Understand your options
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Control
Take control
Understand your options
Fun!!!
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Control
Take control
Understand your options
Fun!!!
Changes your way of thinking
Saturday, November 6, 2010
Conclusions
Scale!!!
No free ride
You gain some
You lose some
Choice
Control
Take control
Understand your options
Fun!!!
Changes your way of thinking
Saturday, November 6, 2010
No SQL!!!
wilfredspringer@gmail.com
Saturday, November 6, 2010
BASE
• Basically Available
• Soft State
• Eventually Consistent
Saturday, November 6, 2010

More Related Content

More from Wilfred Springer

More from Wilfred Springer (9)

Unfiltered Unveiled
Unfiltered UnveiledUnfiltered Unveiled
Unfiltered Unveiled
 
Scala in your organisation
Scala in your organisationScala in your organisation
Scala in your organisation
 
Unfiltered Unveiled
Unfiltered UnveiledUnfiltered Unveiled
Unfiltered Unveiled
 
NoSQL
NoSQLNoSQL
NoSQL
 
Byzantine Generals
Byzantine GeneralsByzantine Generals
Byzantine Generals
 
Eventually Consistent
Eventually ConsistentEventually Consistent
Eventually Consistent
 
Into the Wild
Into the WildInto the Wild
Into the Wild
 
OOPSLA Talk on Preon
OOPSLA Talk on PreonOOPSLA Talk on Preon
OOPSLA Talk on Preon
 
Preon (J-Fall 2008)
Preon (J-Fall 2008)Preon (J-Fall 2008)
Preon (J-Fall 2008)
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

NoSQL Rollercoaster