aizatto / crdt-prototype

Prototyping CRDT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Purpose:

  • Prototype to test implementing CRDT into Logbook

Open Source Examples

Y.js

Notes:

  • Hard to deconstruct

Conclave

https://conclave-team.github.io/conclave-site/

Conclave is a peer-to-peer, real-time, collaborative text editor built from scratch in JavaScript. Intrigued by collaborative text editors such as Google Docs, we set out to build our own. This case study walks you through our journey from the initial idea to our research of current academic literature and finally to our design and implementation of the final product.

Notes:

  • No longer maintained

Algorithms

  • CRDT
  • Diff

CRDT

Also known as:

  • Conflict-free replicated data type
  • Commutative replicated data type
  • Convergent replicated data type

See packages/shared/src/CRDTStructure.ts

Properties:

  • Every character/token has some metadata:
    • token
    • franctional index position
    • non unique id
    • window

Links:

Diff

Problems with diff package:

  • Uses different keywords than the paper
  • Uses let when it should use const
  • Has "callback" support
  • Has large inline functions execEditLength
  • The while loop can be easily forgotten
  • function extractCommon modifies the state of an argument
  • Uses an array as a map
  • Makes it hard to understand the paper that it is based on
  • Assign multiple variables on the same line
  • Uses similar worded variables, bestPath and basePath
  • Undefined variable: useLongestToken

About

Prototyping CRDT


Languages

Language:TypeScript 96.3%Language:HTML 3.7%