Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Convergent Replicated Data Types
Search
Patrick Van Stee
December 14, 2012
Programming
910
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Convergent Replicated Data Types
Patrick Van Stee
December 14, 2012
Transcript
23 slides
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
More Decks by Patrick Van Stee
See All by Patrick Van Stee
Raft: Consensus for Rubyists
vanstee
143
7.9k
Elixir and Ecto
vanstee
5
1k
Bootstrap
vanstee
8
870
HTTP API Design for iOS Applications
vanstee
11
740
Consensus: An Introduction to Raft
vanstee
21
3.4k
Pour Over Brewing Method
vanstee
1
450
Celluloid & DCell
vanstee
4
630
Map Reduce & Ruby
vanstee
10
950
Other Decks in Programming
See All in Programming
AI Augmentation Techniques with Liberty
ivargrimstad
1
490
GraphQL の onError と Nullability のこれから
quramy
0
220
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
570
SODA - FACT BOOK(EN)
sodainc
1
250
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
100
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
120
はじめてのPLATEAU
nokonoko1203
1
650
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
エラーチャンネルのボールを拾い続けて鍛えるエンジニアの地力 / phpcon-niigata2026
meihei3
1
190
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
110
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
680
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
270
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
Marketing to machines
jonoalderson
1
6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
600
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
480
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
How GitHub (no longer) Works
holman
316
150k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640