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
Convergent Replicated Data Types
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Patrick Van Stee
December 14, 2012
Programming
870
4
Share
Convergent Replicated Data Types
Patrick Van Stee
December 14, 2012
More Decks by Patrick Van Stee
See All by Patrick Van Stee
Raft: Consensus for Rubyists
vanstee
141
7.5k
Elixir and Ecto
vanstee
5
990
Bootstrap
vanstee
8
840
HTTP API Design for iOS Applications
vanstee
11
710
Consensus: An Introduction to Raft
vanstee
21
3.2k
Pour Over Brewing Method
vanstee
1
410
Celluloid & DCell
vanstee
4
600
Map Reduce & Ruby
vanstee
10
900
Other Decks in Programming
See All in Programming
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
4
450
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
2k
AIエージェントの隔離技術の徹底比較
kawayu
0
450
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
3
1.2k
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
310
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
2
380
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
160
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
790
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
150
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.8k
Odyssey Design
rkendrick25
PRO
2
670
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Designing for humans not robots
tammielis
254
26k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Tell your own story through comics
letsgokoyo
1
940
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
Transcript
Convergent Replicated Data Types
@vanstee
[email protected]
Patrick Van Stee
“Structuring data so conflict resolution is automatic”
Dynamo Trade consistency for availability and partition tolerance
Node 1 Node 2 { a: “200” } { a:
“-3000” } :(
Node 1 Node 2 { a: “200” } { a:
“-3000” } { a: “200”, a: “-3000” } Riak
CRDT •Counter •Set •Graph •List •Tree
CRDT •Counter •Set •Graph •List •Tree
Counter •Can only be increased •Merge: use largest value
Chat Room Karma Fault-Tolerant Distributed
Serious Business { SB[PVS]: 0} Serious Coding { SB[PVS]: 1}
# PVS++ { SC[PVS]: 0} { SC[PVS]: 5} # PVS += 5 { SB[PVS]: 2} # PVS++ Merge { SB[PVS]: 2, SC[PVS]: 5} { SB[PVS]: 1, SC[PVS]: 5} { SB[PVS]: 2, SC[PVS]: 5} { PVS: 7}
What about decrements? Use separate counters for positive and negative.
Take the difference for the result.
Serious Business { SB[PVS+]: 0, SB[PVS-]: 0 } Serious Coding
{ SB[PVS+]: 1, SB[PVS-]: 0 } # PVS++ { SB[PVS+]: 0, SB[PVS-]: 0 } { SB[PVS+]: 5, SB[PVS-]: 0 } # PVS += 5 { SB[PVS+]: 1, SB[PVS-]: 1 } # PVS-- Merge { PVS+: 6, PVS-: 1 } { PVS+: 6, PVS-: 0 } { PVS+: 6, PVS-: 1 } { PVS: 5 }
Set •Can only be added to •Merge: take the union
Serious Business { PVS: [ ] } Serious Coding {
PVS: [] } { PVS: [] } { PVS: [ ] } Merge { PVS: [ , ] } { PVS: [ , ] } { PVS: [ , , ] } { PVS: [ , , ] }
Hold on, Can we remove stuff? Use separate sets for
added and removed elements.
Serious Business { PVS+: [ ], PVS-: [] } Serious
Coding { PVS+: [], PVS-: [] } { PVS+: [], PVS-: [] } { PVS+: [ ], PVS-: [] } Merge { PVS+: [ , ], PVS-: [ ] } { PVS+: [ ], PVS-: [ ] } { PVS+: [ , ], PVS-: [] } { PVS+: [ , ], PVS-: [ ] } { PVS: [ ] }
But wait, we can only remove once?
U-Set •Append unique values to all set members •Garbage collection
becomes an issue
basho/riak_dt Demo
Use Cases •Like button •Page Views •Shopping Cart
Reference •INRIA paper •basho/riak_dt •RICON talk
Beginning Ruby on Rails Course bignerdranch.com/classes/beginning_ruby_on_rails