derekkraan/delta_crdt_ex
소개
DeltaCrdt를 사용해 Elixir로 분산 애플리케이션을 구축하세요
기타 프로젝트측정된 스타 증가
- in 24h
- +1
- in 7 days
- +1
- in 15 days
- +1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalDeltaCrdt
DeltaCrdt implements a key/value store using concepts from Delta CRDTs, and relies on MerkleMap for efficient synchronization.
There is a (slightly out of date) introductory blog post and the (very much up to date) official documentation on hexdocs.pm is also very good.
The following papers have been used to implement this library:
Delta State Replicated Data Types – Almeida et al. 2016Efficient Synchronization of State-based CRDTs – Enes et al. 2018
Usage
Documentation can be found on hexdocs.pm.
Here's a short example to illustrate adding an entry to a map:
# start 2 Delta CRDTs
{:ok, crdt1} = DeltaCrdt.start_link(DeltaCrdt.AWLWWMap)
{:ok, crdt2} = DeltaCrdt.start_link(DeltaCrdt.AWLWWMap)
# make them aware of each other
DeltaCrdt.set_neighbours(crdt1, [crdt2])
# show the initial value
DeltaCrdt.read(crdt1)
%{}
# add a key/value in crdt1
DeltaCrdt.put(crdt1, "CRDT", "is magic!")
DeltaCrdt.put(crdt1, "magic", "is awesome!")
# read it after it has been replicated to crdt2
DeltaCrdt.read(crdt2)
%{"CRDT" => "is magic!", "magic" => "is awesome!"}
# get only a subset of keys
DeltaCrdt.take(crdt2, ["magic"])
%{"magic" => "is awesome!"}
# get one value
DeltaCrdt.get(crdt2, "magic")
"is awesome!"
# Other map-like functions are available, see the documentation for details.
⚠️ Use atoms carefully : Any atom contained in a key or value will be replicated across all nodes, and will never be garbage collected by the BEAM.
Telemetry metrics
DeltaCrdt publishes the metric [:delta_crdt, :sync, :done].
Installation
The package can be installed by adding delta_crdt to your list of dependencies in mix.exs:
def deps do
[
{:delta_crdt, "~> 0.6.3"}
]
end
관련 프로젝트 살펴보기
불러오는 중…