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
Patrick Van Stee
December 14, 2012
Programming
860
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.4k
Elixir and Ecto
vanstee
5
990
Bootstrap
vanstee
8
830
HTTP API Design for iOS Applications
vanstee
11
690
Consensus: An Introduction to Raft
vanstee
21
3.1k
Pour Over Brewing Method
vanstee
1
400
Celluloid & DCell
vanstee
4
600
Map Reduce & Ruby
vanstee
10
890
Other Decks in Programming
See All in Programming
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
550
Programming with a DJ Controller — not vibe coding
m_seki
3
140
10 Tips of AWS ~Gen AI on AWS~
licux
5
430
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
140
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
270
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
160
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
220
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
210
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
t *testing.T は どこからやってくるの?
otakakot
1
700
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
390
Featured
See All Featured
A Soul's Torment
seathinner
6
2.7k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
410
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
170
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
540
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
420
Odyssey Design
rkendrick25
PRO
2
580
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Six Lessons from altMBA
skipperchong
29
4.2k
Unsuck your backbone
ammeep
672
58k
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