medikoo / medikoo/dbjs

Follow closely CRDT

Open
#80 0 comments 0 reactions 1 assignee View on GitHub

@medikoo is already working on this.

Since Nov 15, 2017.

Dominant language
JavaScript
Stars
27
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.