SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
Conflict-Free
Replicated Data Types
(CRDTs)
PyCon 2022
Rotational Labs rotational.io
Replication
and Conflict
01
Talk Outline
Introduction to
CRDTs
02
CRDTs in Python
03
Demo
04
Key
Takeaways
05
Rotational Labs rotational.io
About Us
Rebecca Bilbro
Patrick Deziel
Patrick is a software
engineer & machine
learning specialist. He was
employee #1 at Rotational
Labs.
He’s also a rock climbing
enthusiast.
Rebecca is a machine learning
engineer & distributed
systems researcher. She’s
Founder/ CTO at Rotational
Labs
She prefers earth-bound
activities.
Rotational Labs rotational.io
–Leslie Lamport
“A distributed system is one in which the failure of
a computer you didn’t even know existed can
render your own computer unusable.”
Rotational Labs rotational.io
Replication and
Conflict
01
What is consistency and why is it so hard to achieve?
Rotational Labs rotational.io
RB PD
Rotational Labs rotational.io
Rotational Labs rotational.io
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "f4a87d2f",
"metadata": {},
"outputs": [],
"source": [
"import warningsn"
,
"import pandas as pdn"
,
"from yellowbrick.datasets import load_bikesharen"
,
"from yellowbrick.regressor import ResidualsPlotn"
,
"from sklearn.linear_model import LinearRegressionn"
,
"from sklearn.model_selection import train_test_split"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "712ed090",
"metadata": {},
"outputs": [],
"source": []
}
],
…
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "311d6947",
"metadata": {},
"outputs": [],
"source": [
"import warningsn"
,
"import pandas as pdn"
,
"from yellowbrick.datasets import load_bikesharen"
,
"from yellowbrick.regressor import ResidualsPlotn"
,
"from sklearn.linear_model import LinearRegressionn"
,
"from sklearn.model_selection import train_test_splitn"
,
"# let’s try sklearn.model_selection.TimeSeriesSplit"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9cbea4df",
"metadata": {},
"outputs": [],
"source": []
}
],
…
}
Rotational Labs rotational.io
{
…
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)"
,
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python"
,
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
{
…
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.2 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python"
,
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2-final"
}
},
"nbformat": 3,
"nbformat_minor": 21
}
Context: A Single Server
1 2
3
4
5
6
Rotational Labs rotational.io
1 2
3
4
5
6
It is always consistent
(responds predictably to
requests) - that’s convenient!
But what if there’s a failure? The entire system becomes
unavailable. Data loss can occur for information stored on
volatile memory. This is why we need distributed systems!
Inconsistency & Concurrency
PUT(x, 42)
ok
GET(x)
not found
Rotational Labs rotational.io
PUT(x, 42)
PUT(x, 27)
GET(x) → ?
Servers in a distributed system need to
communicate to remain in the same state.
Communication takes time (latency); more
servers means more latency.
Delays in communication can allow two
clients to perform operations concurrently.
From the system’s perspective, they happen
at the same time.
Time in a Distributed System
Due to clock drift, we can’t expect any two nodes
in a distributed system to have the same
perception of physical time.
In the absence of specialized hardware
(Spanner), logical clocks can be used to impose
a partial ordering of events.
To obtain a total ordering of events, we need
some arbitrary mechanism to break ties (e.g., the
node name).
Rotational Labs rotational.io
PUT(x, 42, t=Alice@1)
PUT(x, 27, t=Bob@2)
GET(x) → 27
Introduction to
CRDTs
02
Conflict-Free Replicated Data Types
Rotational Labs rotational.io
CRDT: A data structure designed for replication
CRDTs are a good alternative to more expensive,
heavyweight coordination methods, such as:
Some representation of mutable state.
Some function M which merges two states and
produces a deterministic value.
M’s operations are idempotent, associative, and
commutative…
A = M(A, A)
M(A, B) = M(B, A)
M(A, M(B, C)) = M(C, (M(A, B))
…not unlike a Python set!
Locking
(shared lock, x-lock, etc)
Limits collaboration
between users
Consensus algorithms
(Paxos, Raft, ePaxos)
Network-intensive,
difficult to implement
Key Intuition:
We can combine multiple CRDTs
to make more complex CRDTs
Rotational Labs rotational.io
Simple CRDTs
Grow-only Counter
● A monotonically increasing counter across all replicas, each of which is assigned a unique ID
● The counter value at any point in time is equal to the sum of all values across the replicas
● Can be implemented using a dict() in Python
Grow-only Set
● A set which only supports adding new items
● No way to “delete” an item
● Similar to Python’s set()
Rotational Labs rotational.io
Compound CRDTs
Positive-Negative Counters
Combination of two Grow-only Counters, supports incrementation and decrementation
Two-Phase Sets
Combination of two Grow-only Sets, one is a “tombstone” set to support deletion
Last-Write-Wins-Element-Set
Improvement on Two-Phase Set which includes a timestamp to allow for items to be “undeleted”
Observed-Remove Set
Similar to Last-Write-Wins-Element-Set but uses unique tags rather than timestamps
Sequence CRDTs
Implements an ordered set with familiar list operations such as append, insert, remove.
We can use this to build a collaborative editor!
Rotational Labs rotational.io
CRDTs in Python
03
An Example Implementation
Rotational Labs rotational.io
Rotational Labs rotational.io
Hypothesis
We can compound a few CRDTs together to create a collaborative “notebook” ala Jupyter
Our composite CRDT needs to support the following operations
● High level operations: Insert and Remove notebook “cells”
● Low level operations: Insert and Remove characters within each cell
● Support merging at both the notebook level and the cell level to enable consistency
Key understanding
● Individual cell data can be represented by Sequence CRDTs
● The list of “cells” in a notebook is also a Sequence!
A Practical Example…
To achieve eventual consistency, each peer needs to agree on:
1. The set of operations
2. The order of operations
To achieve a total ordering of operations:
1. Assign each operation a unique ID based on client name and timestamp, e.g. INSERT(0, “a”) ⇒ alice@1
2. Lower timestamp values always go first
3. Order by client name to break ties
alice@1 -> bob@2 -> alice@3 -> bob@3
Total Ordering of Operations
Realizing the Object Order
Note: Object payloads are generic, so
we can nest Sequences within
Sequences. This advantage comes from
Python being dynamically typed!
alice@1
“a”
alice@2
“c”
bob@5
“b”
alice@5
“d”
bob@3
“x”
Merging Sequences
INSERT(“c”, before=end) ⇒ bob@1
INSERT(“a”, before=end) ⇒ alice@1
INSERT(“b”, after=alice@1) ⇒ bob@2
do(alice@1) ⇒ [“a”]
do(bob@1) ⇒ [“a”, “c”]
do(bob@2) ⇒ [“a”, “b”, “c”]
do(alice@1) ⇒ [“a”]
do(bob@1) ⇒ [“a”, “c”]
do(bob@2) ⇒ [“a”, “b”, “c”]
Demo
04
Synchronizing Collaboration
Rotational Labs rotational.io
Sequence: Composite CRDT containing ordered set of items
Notebook: Contains a Sequence of Cells
Cell: Contains a Sequence of characters
GCounter: The shared logical clock
GSet: The entire history of operations
Operation: A single insert or delete performed by a node
OpId: Unique identifier for operations
Object: Represents an item in a sequence
GCounter
class GCounter:
"""Implements a grow-only counter CRDT. It must be instantiated with a network-unique ID."""
...
def add(self, value):
"""Adds a non-negative value to the counter."""
if value < 0:
raise ValueError("Only non-negative values are allowed for add()"
)
self.counts[self.id] += value
def merge(self, other):
"""Merges another GCounter with this one."""
if not isinstance(other, GCounter):
raise ValueError("Incompatible CRDT for merge(), expected GCounter"
)
for id, count in other.counts.items():
self.counts[id] = max(self.counts.get(id, 0), count)
return self
def get(self):
"""Returns the current value of the counter."""
return sum(self.counts.values())
Rotational Labs rotational.io
Sequence.merge
def merge(self, other):
# Merge the two Sequences
self.merge_operations(other)
other.merge_operations(
self)
...
# Recursive merge of the sub-sequences
for i in range(len(this_sequence)):
if isinstance(this_sequence[i], Sequence) andisinstance(other_sequence[i], Sequence):
this_sequence[i].merge(other_sequence[i])
this_sequence[i].id =self.id
return self
def merge_operations(self, other):
# Sync the local clock with the remote clock and apply the unseen operations
self.clock = self.clock.merge(other.clock)
patch_ops = other.operations.get().difference(
self.operations.get())
patch_log = sorted(patch_ops, key=cmp_to_key(
self.compare_operations))
for op in patch_log:
op.do(
self.objects)
# Merge the two operation logs
self.operations = self.operations.merge(other.operations)
Rotational Labs rotational.io
ObjectTree
class ObjectTree():
"""Add-only data structure which stores a sequence of Objects."""
def __init__(self):
self.roots = []
def find_insert(self, target, object, iter):
for root, i, obj in iter:
op = obj.operation
if op == target:
# We found the target
return root, i
elif op.target == target and object.operation < op:
# Same target (conflicting operations), so order the operations
return root, i
return None, -1
def insert_node(self, target, object):
root, i = self.find_insert(target, object, self.enumerate_nodes)
if root is None:
self.roots[-1].nodes.append(
object)
else:
root.nodes.insert(i,object)
Rotational Labs rotational.io
Key Takeaways
05
Possibilities for Real Time Collaboration
Rotational Labs rotational.io
CRDT Limitations, Possibilities, and Resources
Limitations
● Eventual strong consistency
● Append-only data type
● Buffer size limitations
● Increasing egress costs
● Need for compaction/pruning
Rotational Labs rotational.io
Applications
● Testing
● Merging
● Branching
● Commenting
● Metadata Resolution
● Collaborative Editing
Resources
● eirene: a client for collaborative Python development with CRDT
● nbdime: tools for diffing and merging of Jupyter Notebooks
● peritext: a CRDT for rich-text collaboration
● Martin Kleppmann — CRDTs: The hard parts
● Michael Whittaker — Consistency in Distributed Systems
Thank you!
Rotational Labs rotational.io

Mais conteúdo relacionado

Mais procurados

NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서
NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서
NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서영준 박
 
Game Physics Engine Development (게임 물리 엔진 개발)
Game Physics Engine Development (게임 물리 엔진 개발)Game Physics Engine Development (게임 물리 엔진 개발)
Game Physics Engine Development (게임 물리 엔진 개발)Bongseok Cho
 
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1 나무기술(주) 최유석 20170912
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1  나무기술(주) 최유석 20170912Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1  나무기술(주) 최유석 20170912
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1 나무기술(주) 최유석 20170912Yooseok Choi
 
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템Chaeone Son
 
『게임을 움직이는 기술과 발상』 - 미리보기
『게임을 움직이는 기술과 발상』 - 미리보기『게임을 움직이는 기술과 발상』 - 미리보기
『게임을 움직이는 기술과 발상』 - 미리보기복연 이
 
[기획 최정진] 포폴 소개
[기획 최정진] 포폴 소개[기획 최정진] 포폴 소개
[기획 최정진] 포폴 소개정진 최
 
NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사
NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사 NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사
NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사 Imseong Kang
 
How I ended up with three degrees in three departments
How I ended up with three degrees in three departmentsHow I ended up with three degrees in three departments
How I ended up with three degrees in three departmentsSangwoong Yoon
 
뉴비라이터를 위한 게임라이팅 일반론
뉴비라이터를 위한 게임라이팅 일반론뉴비라이터를 위한 게임라이팅 일반론
뉴비라이터를 위한 게임라이팅 일반론sinnoske
 
5 tips for your HTML5 games
5 tips for your HTML5 games5 tips for your HTML5 games
5 tips for your HTML5 gamesErnesto Jiménez
 
한국힙합 인스타 팔로윙 네트워크 분석
한국힙합 인스타 팔로윙 네트워크 분석한국힙합 인스타 팔로윙 네트워크 분석
한국힙합 인스타 팔로윙 네트워크 분석POSTECH
 
다면평가의장단점
다면평가의장단점다면평가의장단점
다면평가의장단점dongseonkim
 
[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장
[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장
[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장Dylan Ko
 
Recommendation System History
Recommendation System HistoryRecommendation System History
Recommendation System HistoryTae Young Lee
 
김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011
김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011
김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011devCAT Studio, NEXON
 
그럴듯한 랜덤 생성 컨텐츠 만들기
그럴듯한 랜덤 생성 컨텐츠 만들기그럴듯한 랜덤 생성 컨텐츠 만들기
그럴듯한 랜덤 생성 컨텐츠 만들기Yongha Kim
 
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기Hoyoung Choi
 
게임 개발에 자주 사용되는 디자인 패턴
게임 개발에 자주 사용되는 디자인 패턴게임 개발에 자주 사용되는 디자인 패턴
게임 개발에 자주 사용되는 디자인 패턴예림 임
 

Mais procurados (20)

국민디자인단 운영툴킷 통합본 (ppt)
국민디자인단 운영툴킷 통합본 (ppt)국민디자인단 운영툴킷 통합본 (ppt)
국민디자인단 운영툴킷 통합본 (ppt)
 
NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서
NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서
NDC 2014 Beyond Code: <야생의 땅:듀랑고>의 좌충우돌 개발 과정 - 프로그래머가 챙겨주는 또 다른 개발자 사용 설명서
 
Game Physics Engine Development (게임 물리 엔진 개발)
Game Physics Engine Development (게임 물리 엔진 개발)Game Physics Engine Development (게임 물리 엔진 개발)
Game Physics Engine Development (게임 물리 엔진 개발)
 
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1 나무기술(주) 최유석 20170912
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1  나무기술(주) 최유석 20170912Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1  나무기술(주) 최유석 20170912
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1 나무기술(주) 최유석 20170912
 
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
 
『게임을 움직이는 기술과 발상』 - 미리보기
『게임을 움직이는 기술과 발상』 - 미리보기『게임을 움직이는 기술과 발상』 - 미리보기
『게임을 움직이는 기술과 발상』 - 미리보기
 
[기획 최정진] 포폴 소개
[기획 최정진] 포폴 소개[기획 최정진] 포폴 소개
[기획 최정진] 포폴 소개
 
NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사
NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사 NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사
NDC 2018 '야생의 땅: 듀랑고' 초반 플레이 변천사
 
How I ended up with three degrees in three departments
How I ended up with three degrees in three departmentsHow I ended up with three degrees in three departments
How I ended up with three degrees in three departments
 
뉴비라이터를 위한 게임라이팅 일반론
뉴비라이터를 위한 게임라이팅 일반론뉴비라이터를 위한 게임라이팅 일반론
뉴비라이터를 위한 게임라이팅 일반론
 
5 tips for your HTML5 games
5 tips for your HTML5 games5 tips for your HTML5 games
5 tips for your HTML5 games
 
한국힙합 인스타 팔로윙 네트워크 분석
한국힙합 인스타 팔로윙 네트워크 분석한국힙합 인스타 팔로윙 네트워크 분석
한국힙합 인스타 팔로윙 네트워크 분석
 
행동 트리
행동 트리행동 트리
행동 트리
 
다면평가의장단점
다면평가의장단점다면평가의장단점
다면평가의장단점
 
[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장
[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장
[우리가 데이터를 쓰는 법] 모바일 게임 로그 데이터 분석 이야기 - 엔터메이트 공신배 팀장
 
Recommendation System History
Recommendation System HistoryRecommendation System History
Recommendation System History
 
김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011
김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011
김동건, 구세대 개발자의 신세대 플레이어를 위한 게임 만들기, NDC2011
 
그럴듯한 랜덤 생성 컨텐츠 만들기
그럴듯한 랜덤 생성 컨텐츠 만들기그럴듯한 랜덤 생성 컨텐츠 만들기
그럴듯한 랜덤 생성 컨텐츠 만들기
 
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기
 
게임 개발에 자주 사용되는 디자인 패턴
게임 개발에 자주 사용되는 디자인 패턴게임 개발에 자주 사용되는 디자인 패턴
게임 개발에 자주 사용되는 디자인 패턴
 

Semelhante a Conflict-Free Replicated Data Types (PyCon 2022)

SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsDatabricks
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).pptAlok Kumar
 
Large volume data analysis on the Typesafe Reactive Platform
Large volume data analysis on the Typesafe Reactive PlatformLarge volume data analysis on the Typesafe Reactive Platform
Large volume data analysis on the Typesafe Reactive PlatformMartin Zapletal
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMax Kleiner
 
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)PROIDEA
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDBBuilding a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDBCody Ray
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And AnswerJagan Mohan Bishoyi
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...Jan Margeta
 
Madeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareMadeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareESUG
 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerCisco Canada
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxpetabridge
 
And Then There Are Algorithms
And Then There Are AlgorithmsAnd Then There Are Algorithms
And Then There Are AlgorithmsInfluxData
 
How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit testEugenio Lentini
 
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?SegFaultConf
 
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
C* Summit 2013: Time is Money Jake Luciani and Carl YeksigianC* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
C* Summit 2013: Time is Money Jake Luciani and Carl YeksigianDataStax Academy
 
Deep learning with kafka
Deep learning with kafkaDeep learning with kafka
Deep learning with kafkaNitin Kumar
 

Semelhante a Conflict-Free Replicated Data Types (PyCon 2022) (20)

SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDs
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Large volume data analysis on the Typesafe Reactive Platform
Large volume data analysis on the Typesafe Reactive PlatformLarge volume data analysis on the Typesafe Reactive Platform
Large volume data analysis on the Typesafe Reactive Platform
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
 
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDBBuilding a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
Qt for beginners
Qt for beginnersQt for beginners
Qt for beginners
 
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
 
Madeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareMadeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable Hardware
 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data center
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptx
 
And Then There Are Algorithms
And Then There Are AlgorithmsAnd Then There Are Algorithms
And Then There Are Algorithms
 
How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit test
 
Flink internals web
Flink internals web Flink internals web
Flink internals web
 
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
 
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
C* Summit 2013: Time is Money Jake Luciani and Carl YeksigianC* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
 
Deep learning with kafka
Deep learning with kafkaDeep learning with kafka
Deep learning with kafka
 

Mais de Rebecca Bilbro

Data Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in ProductionData Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in ProductionRebecca Bilbro
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine LearningRebecca Bilbro
 
Anti-Entropy Replication for Cost-Effective Eventual Consistency
Anti-Entropy Replication for Cost-Effective Eventual ConsistencyAnti-Entropy Replication for Cost-Effective Eventual Consistency
Anti-Entropy Replication for Cost-Effective Eventual ConsistencyRebecca Bilbro
 
The Promise and Peril of Very Big Models
The Promise and Peril of Very Big ModelsThe Promise and Peril of Very Big Models
The Promise and Peril of Very Big ModelsRebecca Bilbro
 
Beyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusBeyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusRebecca Bilbro
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningRebecca Bilbro
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scaleEuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scaleRebecca Bilbro
 
Visual diagnostics at scale
Visual diagnostics at scaleVisual diagnostics at scale
Visual diagnostics at scaleRebecca Bilbro
 
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Rebecca Bilbro
 
A Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsA Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsRebecca Bilbro
 
The Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistThe Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistRebecca Bilbro
 
Learning machine learning with Yellowbrick
Learning machine learning with YellowbrickLearning machine learning with Yellowbrick
Learning machine learning with YellowbrickRebecca Bilbro
 
Escaping the Black Box
Escaping the Black BoxEscaping the Black Box
Escaping the Black BoxRebecca Bilbro
 
Data Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword CorpusData Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword CorpusRebecca Bilbro
 
Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Rebecca Bilbro
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersYellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersRebecca Bilbro
 
Visualizing the model selection process
Visualizing the model selection processVisualizing the model selection process
Visualizing the model selection processRebecca Bilbro
 
NLP for Everyday People
NLP for Everyday PeopleNLP for Everyday People
NLP for Everyday PeopleRebecca Bilbro
 

Mais de Rebecca Bilbro (20)

Data Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in ProductionData Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in Production
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning
 
Anti-Entropy Replication for Cost-Effective Eventual Consistency
Anti-Entropy Replication for Cost-Effective Eventual ConsistencyAnti-Entropy Replication for Cost-Effective Eventual Consistency
Anti-Entropy Replication for Cost-Effective Eventual Consistency
 
The Promise and Peril of Very Big Models
The Promise and Peril of Very Big ModelsThe Promise and Peril of Very Big Models
The Promise and Peril of Very Big Models
 
Beyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusBeyond Off the-Shelf Consensus
Beyond Off the-Shelf Consensus
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine Learning
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scaleEuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scale
 
Visual diagnostics at scale
Visual diagnostics at scaleVisual diagnostics at scale
Visual diagnostics at scale
 
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
 
A Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsA Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and Distributions
 
Words in space
Words in spaceWords in space
Words in space
 
The Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistThe Incredible Disappearing Data Scientist
The Incredible Disappearing Data Scientist
 
Camlis
CamlisCamlis
Camlis
 
Learning machine learning with Yellowbrick
Learning machine learning with YellowbrickLearning machine learning with Yellowbrick
Learning machine learning with Yellowbrick
 
Escaping the Black Box
Escaping the Black BoxEscaping the Black Box
Escaping the Black Box
 
Data Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword CorpusData Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword Corpus
 
Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersYellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformers
 
Visualizing the model selection process
Visualizing the model selection processVisualizing the model selection process
Visualizing the model selection process
 
NLP for Everyday People
NLP for Everyday PeopleNLP for Everyday People
NLP for Everyday People
 

Último

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 

Último (20)

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 

Conflict-Free Replicated Data Types (PyCon 2022)

  • 1. Conflict-Free Replicated Data Types (CRDTs) PyCon 2022 Rotational Labs rotational.io
  • 2. Replication and Conflict 01 Talk Outline Introduction to CRDTs 02 CRDTs in Python 03 Demo 04 Key Takeaways 05 Rotational Labs rotational.io
  • 3. About Us Rebecca Bilbro Patrick Deziel Patrick is a software engineer & machine learning specialist. He was employee #1 at Rotational Labs. He’s also a rock climbing enthusiast. Rebecca is a machine learning engineer & distributed systems researcher. She’s Founder/ CTO at Rotational Labs She prefers earth-bound activities. Rotational Labs rotational.io
  • 4. –Leslie Lamport “A distributed system is one in which the failure of a computer you didn’t even know existed can render your own computer unusable.” Rotational Labs rotational.io
  • 5. Replication and Conflict 01 What is consistency and why is it so hard to achieve? Rotational Labs rotational.io
  • 6. RB PD Rotational Labs rotational.io
  • 7. Rotational Labs rotational.io { "cells": [ { "cell_type": "code", "execution_count": 1, "id": "f4a87d2f", "metadata": {}, "outputs": [], "source": [ "import warningsn" , "import pandas as pdn" , "from yellowbrick.datasets import load_bikesharen" , "from yellowbrick.regressor import ResidualsPlotn" , "from sklearn.linear_model import LinearRegressionn" , "from sklearn.model_selection import train_test_split" ] }, { "cell_type": "code", "execution_count": null, "id": "712ed090", "metadata": {}, "outputs": [], "source": [] } ], … } { "cells": [ { "cell_type": "code", "execution_count": 1, "id": "311d6947", "metadata": {}, "outputs": [], "source": [ "import warningsn" , "import pandas as pdn" , "from yellowbrick.datasets import load_bikesharen" , "from yellowbrick.regressor import ResidualsPlotn" , "from sklearn.linear_model import LinearRegressionn" , "from sklearn.model_selection import train_test_splitn" , "# let’s try sklearn.model_selection.TimeSeriesSplit" ] }, { "cell_type": "code", "execution_count": null, "id": "9cbea4df", "metadata": {}, "outputs": [], "source": [] } ], … }
  • 8. Rotational Labs rotational.io { … "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)" , "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python" , "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.3" } }, "nbformat": 4, "nbformat_minor": 5 } { … "metadata": { "kernelspec": { "display_name": "Python 3.8.2 64-bit", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python" , "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.2-final" } }, "nbformat": 3, "nbformat_minor": 21 }
  • 9. Context: A Single Server 1 2 3 4 5 6 Rotational Labs rotational.io 1 2 3 4 5 6 It is always consistent (responds predictably to requests) - that’s convenient! But what if there’s a failure? The entire system becomes unavailable. Data loss can occur for information stored on volatile memory. This is why we need distributed systems!
  • 10. Inconsistency & Concurrency PUT(x, 42) ok GET(x) not found Rotational Labs rotational.io PUT(x, 42) PUT(x, 27) GET(x) → ? Servers in a distributed system need to communicate to remain in the same state. Communication takes time (latency); more servers means more latency. Delays in communication can allow two clients to perform operations concurrently. From the system’s perspective, they happen at the same time.
  • 11. Time in a Distributed System Due to clock drift, we can’t expect any two nodes in a distributed system to have the same perception of physical time. In the absence of specialized hardware (Spanner), logical clocks can be used to impose a partial ordering of events. To obtain a total ordering of events, we need some arbitrary mechanism to break ties (e.g., the node name). Rotational Labs rotational.io PUT(x, 42, t=Alice@1) PUT(x, 27, t=Bob@2) GET(x) → 27
  • 12. Introduction to CRDTs 02 Conflict-Free Replicated Data Types Rotational Labs rotational.io
  • 13. CRDT: A data structure designed for replication CRDTs are a good alternative to more expensive, heavyweight coordination methods, such as: Some representation of mutable state. Some function M which merges two states and produces a deterministic value. M’s operations are idempotent, associative, and commutative… A = M(A, A) M(A, B) = M(B, A) M(A, M(B, C)) = M(C, (M(A, B)) …not unlike a Python set! Locking (shared lock, x-lock, etc) Limits collaboration between users Consensus algorithms (Paxos, Raft, ePaxos) Network-intensive, difficult to implement
  • 14. Key Intuition: We can combine multiple CRDTs to make more complex CRDTs Rotational Labs rotational.io
  • 15. Simple CRDTs Grow-only Counter ● A monotonically increasing counter across all replicas, each of which is assigned a unique ID ● The counter value at any point in time is equal to the sum of all values across the replicas ● Can be implemented using a dict() in Python Grow-only Set ● A set which only supports adding new items ● No way to “delete” an item ● Similar to Python’s set() Rotational Labs rotational.io
  • 16. Compound CRDTs Positive-Negative Counters Combination of two Grow-only Counters, supports incrementation and decrementation Two-Phase Sets Combination of two Grow-only Sets, one is a “tombstone” set to support deletion Last-Write-Wins-Element-Set Improvement on Two-Phase Set which includes a timestamp to allow for items to be “undeleted” Observed-Remove Set Similar to Last-Write-Wins-Element-Set but uses unique tags rather than timestamps Sequence CRDTs Implements an ordered set with familiar list operations such as append, insert, remove. We can use this to build a collaborative editor! Rotational Labs rotational.io
  • 17. CRDTs in Python 03 An Example Implementation Rotational Labs rotational.io
  • 18. Rotational Labs rotational.io Hypothesis We can compound a few CRDTs together to create a collaborative “notebook” ala Jupyter Our composite CRDT needs to support the following operations ● High level operations: Insert and Remove notebook “cells” ● Low level operations: Insert and Remove characters within each cell ● Support merging at both the notebook level and the cell level to enable consistency Key understanding ● Individual cell data can be represented by Sequence CRDTs ● The list of “cells” in a notebook is also a Sequence! A Practical Example…
  • 19. To achieve eventual consistency, each peer needs to agree on: 1. The set of operations 2. The order of operations To achieve a total ordering of operations: 1. Assign each operation a unique ID based on client name and timestamp, e.g. INSERT(0, “a”) ⇒ alice@1 2. Lower timestamp values always go first 3. Order by client name to break ties alice@1 -> bob@2 -> alice@3 -> bob@3 Total Ordering of Operations
  • 20. Realizing the Object Order Note: Object payloads are generic, so we can nest Sequences within Sequences. This advantage comes from Python being dynamically typed! alice@1 “a” alice@2 “c” bob@5 “b” alice@5 “d” bob@3 “x”
  • 21. Merging Sequences INSERT(“c”, before=end) ⇒ bob@1 INSERT(“a”, before=end) ⇒ alice@1 INSERT(“b”, after=alice@1) ⇒ bob@2 do(alice@1) ⇒ [“a”] do(bob@1) ⇒ [“a”, “c”] do(bob@2) ⇒ [“a”, “b”, “c”] do(alice@1) ⇒ [“a”] do(bob@1) ⇒ [“a”, “c”] do(bob@2) ⇒ [“a”, “b”, “c”]
  • 23. Sequence: Composite CRDT containing ordered set of items Notebook: Contains a Sequence of Cells Cell: Contains a Sequence of characters GCounter: The shared logical clock GSet: The entire history of operations Operation: A single insert or delete performed by a node OpId: Unique identifier for operations Object: Represents an item in a sequence
  • 24. GCounter class GCounter: """Implements a grow-only counter CRDT. It must be instantiated with a network-unique ID.""" ... def add(self, value): """Adds a non-negative value to the counter.""" if value < 0: raise ValueError("Only non-negative values are allowed for add()" ) self.counts[self.id] += value def merge(self, other): """Merges another GCounter with this one.""" if not isinstance(other, GCounter): raise ValueError("Incompatible CRDT for merge(), expected GCounter" ) for id, count in other.counts.items(): self.counts[id] = max(self.counts.get(id, 0), count) return self def get(self): """Returns the current value of the counter.""" return sum(self.counts.values()) Rotational Labs rotational.io
  • 25. Sequence.merge def merge(self, other): # Merge the two Sequences self.merge_operations(other) other.merge_operations( self) ... # Recursive merge of the sub-sequences for i in range(len(this_sequence)): if isinstance(this_sequence[i], Sequence) andisinstance(other_sequence[i], Sequence): this_sequence[i].merge(other_sequence[i]) this_sequence[i].id =self.id return self def merge_operations(self, other): # Sync the local clock with the remote clock and apply the unseen operations self.clock = self.clock.merge(other.clock) patch_ops = other.operations.get().difference( self.operations.get()) patch_log = sorted(patch_ops, key=cmp_to_key( self.compare_operations)) for op in patch_log: op.do( self.objects) # Merge the two operation logs self.operations = self.operations.merge(other.operations) Rotational Labs rotational.io
  • 26. ObjectTree class ObjectTree(): """Add-only data structure which stores a sequence of Objects.""" def __init__(self): self.roots = [] def find_insert(self, target, object, iter): for root, i, obj in iter: op = obj.operation if op == target: # We found the target return root, i elif op.target == target and object.operation < op: # Same target (conflicting operations), so order the operations return root, i return None, -1 def insert_node(self, target, object): root, i = self.find_insert(target, object, self.enumerate_nodes) if root is None: self.roots[-1].nodes.append( object) else: root.nodes.insert(i,object) Rotational Labs rotational.io
  • 27. Key Takeaways 05 Possibilities for Real Time Collaboration Rotational Labs rotational.io
  • 28. CRDT Limitations, Possibilities, and Resources Limitations ● Eventual strong consistency ● Append-only data type ● Buffer size limitations ● Increasing egress costs ● Need for compaction/pruning Rotational Labs rotational.io Applications ● Testing ● Merging ● Branching ● Commenting ● Metadata Resolution ● Collaborative Editing Resources ● eirene: a client for collaborative Python development with CRDT ● nbdime: tools for diffing and merging of Jupyter Notebooks ● peritext: a CRDT for rich-text collaboration ● Martin Kleppmann — CRDTs: The hard parts ● Michael Whittaker — Consistency in Distributed Systems
  • 29. Thank you! Rotational Labs rotational.io