All Projects β†’ PsychoLlama β†’ graph-crdt

PsychoLlama / graph-crdt

Licence: MIT License
Commutative graphs made for real-time, offline-tolerant replication

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to graph-crdt

dipa
dipa makes it easy to efficiently delta encode large Rust data structures.
Stars: ✭ 243 (+417.02%)
Mutual labels:  state, delta
statemachine-go
🚦 Declarative Finite-State Machines in Go
Stars: ✭ 47 (+0%)
Mutual labels:  state
particule
Fine-grained atomic React state management library
Stars: ✭ 31 (-34.04%)
Mutual labels:  state
knockout-store
State management for Knockout apps.
Stars: ✭ 37 (-21.28%)
Mutual labels:  state
movie-booking
An example for booking movie seat, combined of Android Data Binding, State Design Pattern and Multibinding + Autofactory. iOS version is: https://github.com/lizhiquan/MovieBooking
Stars: ✭ 80 (+70.21%)
Mutual labels:  state
eventrix
Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.
Stars: ✭ 35 (-25.53%)
Mutual labels:  state
stateview
Stateview is a react render solution for Multi-State View.
Stars: ✭ 40 (-14.89%)
Mutual labels:  state
crdt
Dart implementation of Conflict-free Replicated Data Types (CRDTs)
Stars: ✭ 55 (+17.02%)
Mutual labels:  crdt
stoxy
Stoxy is a state management API for all modern Web Technologies
Stars: ✭ 73 (+55.32%)
Mutual labels:  state
vue-vuex-persist
vuexζŒδΉ…εŒ–ζ’δ»Ά
Stars: ✭ 16 (-65.96%)
Mutual labels:  state
diamond-types
The world's fastest CRDT. WIP.
Stars: ✭ 654 (+1291.49%)
Mutual labels:  crdt
netty-queue
Simple queue: java, json-rest, netty
Stars: ✭ 21 (-55.32%)
Mutual labels:  crdt
yorkie-js-sdk
Yorkie JavaScript SDK
Stars: ✭ 57 (+21.28%)
Mutual labels:  crdt
reactive state
An easy to understand reactive state management solution for Flutter.
Stars: ✭ 19 (-59.57%)
Mutual labels:  state
sworm
A user-friendly distributed process registry and process supervisor
Stars: ✭ 20 (-57.45%)
Mutual labels:  crdt
rdoc
Conflict-free replicated JSON implementation in native Go
Stars: ✭ 76 (+61.7%)
Mutual labels:  crdt
RxReduxK
Micro-framework for Redux implemented in Kotlin
Stars: ✭ 65 (+38.3%)
Mutual labels:  state
ADE9078-3PhaseWattmeter
An Isolated design for a demo board using the Analog Devices ADE9078 3 phase AC wattmeter. Design allows both WYE (STAR) and Delta (TRIANGLE) distributions to be measured along with Blondel and non-Blondel measurement schemes. The project includes a SPI based Arduino style library.
Stars: ✭ 24 (-48.94%)
Mutual labels:  delta
closeable-map
Application state management made simple: a Clojure map that implements java.io.Closeable.
Stars: ✭ 42 (-10.64%)
Mutual labels:  state
xstate-viz
Visualizer for XState machines
Stars: ✭ 274 (+482.98%)
Mutual labels:  state

Distributed Graph Engine

Travis branch

Designed for serializing arbitrary data structures, making offline edits, and seamlessly merging changes back in. All data is observable and event driven.

For the technical, graph-crdt is a modified version of a LWW-E-Set with inline garbage collection using lamport clocks and JavaScript's lexicographic comparison on deterministically serialized JSON for the predetermined conflict resolution bias.

Maintenance notice

If it isn't obvious from the lack of recent commits, graph-crdt is unmaintained.

I'm still pursuing the concepts through the mytosis framework along with more ambitious ideas, but development has kinda paused there too. I hit some project burnout.

What for?

This graph library aims to ease the complexity of synchronizing complex and interconnected state between peers, without assuming centralized authority.

How does it work?

Truly offline systems cannot rely on any form of collaboration. They must (at some point) assume the editor is in complete isolation, such as a smartphone that lost cell service, or a server who's network is unreachable.

You have a few options:

  • Block writes
    Probably the worst experience, block all writes until the network heals. This is essentially the same as losing socket connection to your database (Rethink, Neo4j, Redis, MySQL, etc.)

  • Defer the updates
    You allow writes on the offline machine, wait for the network to heal, then publish them. If not handled perfectly, you're susceptible to merge hell on an active production environment.

  • Use a CRDT
    CRDTs (Convergent Replicated Data Types) are similar to the option above, but come with additional guarantees: regardless of the order which updates are received in, every machine will arrive at the exact same result every time, and if implemented correctly, make merge conflicts impossible.

graph-crdt uses Lamport time to track state mutation and resolves concurrent edit conflicts using a deterministic sorting algorithm.

This library opts for the latter, implementing a delta graph CvRDT. However, as great as they may seem, there are some cons (some specific to this library):

  • You need more data.
    Merges need a state integer on each field.

  • There is no "true" delete.
    You can remove the value, but some metadata has to stay around.

  • It only plays nice with other CRDTs.
    To merge two states, both must have the CRDT metadata (though this library allows you to upgrade nearly any data).

Features

  • Commutative, idempotent, conflict-resolved Node unions.
  • Delta emission on Node and Graph unions.
  • Time travel (track and selectively apply deltas).

Documentation

All the API docs can be found here.

Roadmap

  1. Node field tombstones.
  2. Graph member tombstones.
  3. Custom conflict resolvers.
  4. A new data structure (this one is a surprise).

Disclaimer

Although I have working experience with decentralized systems (at GunDB), I'm still a n00b. This library is my best understanding of CvRDTs and how they operate. I'm open to most suggestions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].