Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CAP Theorem
Search
Michał Łomnicki
November 21, 2012
Technology
2
120
CAP Theorem
Michał Łomnicki
November 21, 2012
Tweet
Share
More Decks by Michał Łomnicki
See All by Michał Łomnicki
DDD, Rails and persistence
mlomnicki
1
270
Forget Ruby. Forget CoffeeScript. Do SOA
mlomnicki
1
120
Having fun with legacy apps
mlomnicki
1
62
[PL] Transakcje w bazach danych
mlomnicki
1
170
Ruby Tricks 2
mlomnicki
3
60
SchemaPlus
mlomnicki
1
40
Other Decks in Technology
See All in Technology
データの品質が低いと何が困るのか
kzykmyzw
6
1.1k
一度 Expo の採用を断念したけど、 再度 Expo の導入を検討している話
ichiki1023
1
160
CZII - CryoET Object Identification 参加振り返り・解法共有
tattaka
0
340
Cloud Spanner 導入で実現した快適な開発と運用について
colopl
1
510
室長と気ままに学ぶマイクロソフトのビジネスアプリケーションとビジネスプロセス
ryoheig0405
0
360
クラウドサービス事業者におけるOSS
tagomoris
0
210
Classmethod AI Talks(CATs) #16 司会進行スライド(2025.02.12) / classmethod-ai-talks-aka-cats_moderator-slides_vol16_2025-02-12
shinyaa31
0
100
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
240
2024.02.19 W&B AIエージェントLT会 / AIエージェントが業務を代行するための計画と実行 / Algomatic 宮脇
smiyawaki0820
12
2.9k
7日間でハッキングをはじめる本をはじめてみませんか?_ITエンジニア本大賞2025
nomizone
2
1.8k
偶然 × 行動で人生の可能性を広げよう / Serendipity × Action: Discover Your Possibilities
ar_tama
1
1.1k
Helm , Kustomize に代わる !? 次世代 k8s パッケージマネージャー Glasskube 入門 / glasskube-entry
parupappa2929
0
250
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
223
9.3k
BBQ
matthewcrist
87
9.5k
Being A Developer After 40
akosma
89
590k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
What's in a price? How to price your products and services
michaelherold
244
12k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Navigating Team Friction
lara
183
15k
Raft: Consensus for Rubyists
vanstee
137
6.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
133
33k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Transcript
CAP Theorem The art of choice @mlomnicki
CAP Theorem by Eric Brewer in 2000 Proven in 2002
by Seth Gilbert & Nancy Linch
CAP Theorem Consistency Availability Partition tolerance At most 2 of
3 properties may be satisfied
CAP Theorem
RDBMS (single-site and cluster) Consistency Availability Partition tolerance
Distributed RDBMS Consistency Availability Partition tolerance
NoSQL Consistency Availability Partition tolerance ...also DNS is AP
BigTable Consistency Availability Partition tolerance P is on GFS side
Prevayler/Madeleine Consistency Availability Partition tolerance
NewSQL Consistency Availability Partition tolerance Impossible according to the theory
...but Stonebraker doesn't agree
Real life stories
What you think you have
What you really have
..to be fair
The art of choice Scalability over Consistency Consistency over Scalability
Forfeit Partition Tolerance Consistent system - easy High Availability -
hard known & proven HA workarounds Facebook - MySQL + memcache Vertical scalability
Forfeit Consistency High Availability Horizontal scalability - better "Eventually consistent"
(BASE) HA = race conditions workarounds?
What you need Extremely efficient Reliable (in data sense)
ACID Atomicity Consistency Isolation Durability
BASE Basically Available Soft state Eventual consistency
ACID people don't care ...but think data is consistent anyway
you can't enforce consistency at ActiveRecord level
BASE consistency relaxed to make horizontal scalability easier inconsistencies handled
by developer
beware of vendors they don't always tell the truth NoSQL
is never ACID-compilant NoSQL - lack of atomic operations across documents/collections Prevayler - poor isolation HBase - poor durability
SQL is ACID except MySQL with MyISAM MVCC over locking
but must follow the rules foreign keys, unique indexes transaction isolation levels
Links CAP preso CAP proof CAP explained CAP and NoSQL
Comparision Stonbraker on CAP Sharding limits more on CAP
Questions?