Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow closely CRDT #80

Open
medikoo opened this issue Nov 15, 2017 · 0 comments
Open

Follow closely CRDT #80

medikoo opened this issue Nov 15, 2017 · 0 comments
Assignees

Comments

@medikoo
Copy link
Owner

medikoo commented Nov 15, 2017

More info here: https://serverless.com/blog/crdt-explained-supercharge-serverless-at-edge/

DBJS data replication across instances is already implemented mostly according to CRDT rules.

Still it doesn't support operations as increment and insert (technically in dbjs collections are sets, so are unordered, although order is guaranteed and follows operation timestamp. It could more adequate to apply depth first traversal as defined in CRDT).

Additionally it's not as intelligent in handling unordered set operations on collections, where we replace whole collection (in below case a map) with a new value. e.g. having following order of operations

  1. Client A issues operation A1:foo = { mar: 1, bar: 2 }
  2. Client B receives operation A1
  3. Client B issues operation B1: foo = { mar: 4, bar: 7 }
  4. Client A issues operation A2: foo.mar = 3
  5. Client B receives operation A2
  6. Client A receives operation B1

Will result in foo being { mar:3, bar: 7 } in both clients, when it should be { mar: 4, bar: 7 } (as foo.mar = 3 edit was made on stale version of object, which in a meantime was replaced in context of B)

@medikoo medikoo self-assigned this Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant