SlideShare a Scribd company logo
CRDTs
for engineers
1Thursday, June 27, 13
CRDT
• Conflict-Free (amongst others)
• Replicated
• Data
• Type
2Thursday, June 27, 13
CRDT
• Conflict-Free (amongst others)
• Replicated
• Data - obvious
• Type - obvious
3Thursday, June 27, 13
Replicated
• Build to be used in distributed systems
• multiple replicas can be changed
concurrently
• do not require locking
4Thursday, June 27, 13
Conflict-Free
• the big one!
• replica merges with predictable behavior!
• predictable =:= desired?
5Thursday, June 27, 13
big words
• Associative
• Commutative
• Idempotent
6Thursday, June 27, 13
Associative
• operations can be applied in any order
• x ∧ (y ∧ z) = (x ∧ y) ∧ z
7Thursday, June 27, 13
Commutative
• The values of operations can be swapped.
• x ∧ y = y ∧ x
• together
• we don’t need to care about order
8Thursday, June 27, 13
Idempotent
• not impotent!
• applying twice does not change a thing.
• f(f(x)) = f(x)
9Thursday, June 27, 13
Types
• CmRDT message based
• CvRDT state based (v for vector)
• can be emulated
10Thursday, June 27, 13
CmRDT
• based on messages
• requires messages to be delivered
• needs controls of messages (complex)
11Thursday, June 27, 13
CvRDT
• Based on the objects state
• independent from underlaying structure
• that’s good!
12Thursday, June 27, 13
LWW register
VaTa VbTb
VbTb
Ta =< Tb
13Thursday, June 27, 13
G Set
M1 Merge M2
14Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
15Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
16Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
B B
17Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
B B
18Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
B B C
C
19Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
B B C
C
20Thursday, June 27, 13
G Set
A
M1 Merge M2
AA
B B C
CD D
D
Union
21Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
0 0 0
0 0 0
0 0 0
M1 M2 Merge
0
0
0
M3
0 0 0 0
= Max
= Max
= Max
SumSumSumSum
22Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
0 0 0
0 0 0
M1 M2 Merge
1
0
0
M3
1 1 1 1
= Max
= Max
= Max
SumSumSumSum
23Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
0 0 0
M1 M2 Merge
1
4
0
M3
5 5 5 5
= Max
= Max
= Max
SumSumSumSum
24Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
0 0 0
M1 M2 Merge
1
4
0
M3
5 5 5 5
= Max
= Max
= Max
SumSumSumSum
25Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
5 0 5
M1 M2 Merge
1
4
5
M3
10 5 10 10
= Max
= Max
= Max
SumSumSumSum
26Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
5 0 5
M1 M2 Merge
1
4
5
M3
10 5 10 10
= Max
= Max
= Max
SumSumSumSum
27Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
5 0 5
M1 M2 Merge
1
4
5
M3
10 5 10 10
= Max
= Max
= Max
SumSumSumSum
28Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
5 7 7
M1 M2 Merge
1
4
7
M3
10 12 12 12
= Max
= Max
= Max
SumSumSumSum
29Thursday, June 27, 13
G Counter
Master 1
Master 2
Master 3
1 1 1
4 4 4
5 7 7
M1 M2 Merge
1
4
7
M3
10 12 12 12
= Max
= Max
= Max
SumSumSumSum
30Thursday, June 27, 13
now it’s like lego
31Thursday, June 27, 13
PN Counter
Increments Decrements
G Counter G Counter
32Thursday, June 27, 13
2P Set
Additions Deletions
G Set G Set
33Thursday, June 27, 13
2P Set
• Can only be added once
• Deleted for good
34Thursday, June 27, 13
35Thursday, June 27, 13
PN Set
7 A
0 B
3 C
-2 D
PN Counter
A
C
36Thursday, June 27, 13
PN Set
• Partial merges can lead to negative values
• Adds might (temporarily) have no effect
37Thursday, June 27, 13
OR Set
M1,1 A
M1,1 A
M2,1 A
M1,2 B
M1,3 A
A
B
2P Set
38Thursday, June 27, 13
OR Set
39Thursday, June 27, 13
OR Set
M1,1 A M1,1 A A
40Thursday, June 27, 13
OR Set
M1,1 A M1,1 A A
M1,2 B B
41Thursday, June 27, 13
OR Set
M1,1 A M1,1 A A
M1,2 B BM2,1 B
42Thursday, June 27, 13
OR Set
M1,1 A M1,1 A A
M1,2 B BM2,1 B
M1,2 B
43Thursday, June 27, 13
OR Set
M1,1 A M1,1 A A
M1,2 B BM2,1 B
M1,2 B
M1,3 B
44Thursday, June 27, 13
OR Set
M1,1 A M1,1 A A
M1,2 B M2,1 B
M1,2 B
M1,3 B
M2,1 B
M1,3 B
M2,1 B
M1,3 B
45Thursday, June 27, 13
OR Set
• Elements have a unique ID
• delete
• Elements might ‘reappear’ after a merge
• lots of trash
46Thursday, June 27, 13
Questions?
• Code?
• C-x C-+
• https://github.com/Licenser/ecrdt
• more links there!
47Thursday, June 27, 13

More Related Content

What's hot

板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!
notargs
 
ヤフーでは開発迅速性と品質のバランスをどう取ってるか
ヤフーでは開発迅速性と品質のバランスをどう取ってるかヤフーでは開発迅速性と品質のバランスをどう取ってるか
ヤフーでは開発迅速性と品質のバランスをどう取ってるか
Yahoo!デベロッパーネットワーク
 
Arduinoとgpsと有効数字
Arduinoとgpsと有効数字Arduinoとgpsと有効数字
Arduinoとgpsと有効数字
j_rocket_boy
 
FreeBSD 12.0 RELEASE!
FreeBSD 12.0 RELEASE!FreeBSD 12.0 RELEASE!
FreeBSD 12.0 RELEASE!
Yuichiro Naito
 
[UEFN_Verse] Player and agent and fort_character
[UEFN_Verse] Player and agent and fort_character[UEFN_Verse] Player and agent and fort_character
[UEFN_Verse] Player and agent and fort_character
7nap
 
Continue break goto_에_대한_고찰
Continue break goto_에_대한_고찰Continue break goto_에_대한_고찰
Continue break goto_에_대한_고찰
중선 곽
 
Gradle handson
Gradle handsonGradle handson
Gradle handson
Nemoto Yusuke
 
NFTゲーム Stepn でブロックチェーンを学ぶ
NFTゲーム Stepn でブロックチェーンを学ぶNFTゲーム Stepn でブロックチェーンを学ぶ
NFTゲーム Stepn でブロックチェーンを学ぶ
雅仁 冨元
 
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
yoku0825
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
Yoshiki Shibukawa
 
マーク&スイープ勉強会
マーク&スイープ勉強会マーク&スイープ勉強会
マーク&スイープ勉強会
7shi
 
Lightweight Keycloak
Lightweight KeycloakLightweight Keycloak
Lightweight Keycloak
Hiroyuki Wada
 
Unityプロファイラについて
UnityプロファイラについてUnityプロファイラについて
Unityプロファイラについて
Mio Ku-tani
 
Sqlアンチパターン(メタデータトリブル)
Sqlアンチパターン(メタデータトリブル)Sqlアンチパターン(メタデータトリブル)
Sqlアンチパターン(メタデータトリブル)Tomoaki Uchida
 
自律的なチームを作るために —組織心理学・臨床心理学の応用—
自律的なチームを作るために —組織心理学・臨床心理学の応用—自律的なチームを作るために —組織心理学・臨床心理学の応用—
自律的なチームを作るために —組織心理学・臨床心理学の応用—
MILI-LLC
 
アジャイルな見積りと計画づくり勉強会
アジャイルな見積りと計画づくり勉強会アジャイルな見積りと計画づくり勉強会
アジャイルな見積りと計画づくり勉強会
Arata Fujimura
 
Reactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfire
Reactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfireReactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfire
Reactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfire
Yahoo!デベロッパーネットワーク
 

What's hot (18)

板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!
 
ヤフーでは開発迅速性と品質のバランスをどう取ってるか
ヤフーでは開発迅速性と品質のバランスをどう取ってるかヤフーでは開発迅速性と品質のバランスをどう取ってるか
ヤフーでは開発迅速性と品質のバランスをどう取ってるか
 
Arduinoとgpsと有効数字
Arduinoとgpsと有効数字Arduinoとgpsと有効数字
Arduinoとgpsと有効数字
 
FreeBSD 12.0 RELEASE!
FreeBSD 12.0 RELEASE!FreeBSD 12.0 RELEASE!
FreeBSD 12.0 RELEASE!
 
[UEFN_Verse] Player and agent and fort_character
[UEFN_Verse] Player and agent and fort_character[UEFN_Verse] Player and agent and fort_character
[UEFN_Verse] Player and agent and fort_character
 
Continue break goto_에_대한_고찰
Continue break goto_에_대한_고찰Continue break goto_에_대한_고찰
Continue break goto_에_대한_고찰
 
Gradle handson
Gradle handsonGradle handson
Gradle handson
 
NFTゲーム Stepn でブロックチェーンを学ぶ
NFTゲーム Stepn でブロックチェーンを学ぶNFTゲーム Stepn でブロックチェーンを学ぶ
NFTゲーム Stepn でブロックチェーンを学ぶ
 
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
サーバーが完膚なきまでに死んでもMySQLのデータを失わないための表技
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
 
マーク&スイープ勉強会
マーク&スイープ勉強会マーク&スイープ勉強会
マーク&スイープ勉強会
 
Lightweight Keycloak
Lightweight KeycloakLightweight Keycloak
Lightweight Keycloak
 
V for Vendetta
V for VendettaV for Vendetta
V for Vendetta
 
Unityプロファイラについて
UnityプロファイラについてUnityプロファイラについて
Unityプロファイラについて
 
Sqlアンチパターン(メタデータトリブル)
Sqlアンチパターン(メタデータトリブル)Sqlアンチパターン(メタデータトリブル)
Sqlアンチパターン(メタデータトリブル)
 
自律的なチームを作るために —組織心理学・臨床心理学の応用—
自律的なチームを作るために —組織心理学・臨床心理学の応用—自律的なチームを作るために —組織心理学・臨床心理学の応用—
自律的なチームを作るために —組織心理学・臨床心理学の応用—
 
アジャイルな見積りと計画づくり勉強会
アジャイルな見積りと計画づくり勉強会アジャイルな見積りと計画づくり勉強会
アジャイルな見積りと計画づくり勉強会
 
Reactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfire
Reactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfireReactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfire
Reactを使ったYahoo!地図の技術刷新への挑戦 #yjbonfire
 

Recently uploaded

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 

Recently uploaded (20)

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 

CRDTs for engineers