Skip to content

Yjs as the source of truth #331

@lihebi

Description

@lihebi

TL;DR Yjs should write the database.


The current architecture is centered around the browser (yjs <-> browser <-> DB):

  • browser (ui/) talk to yjs for peer-syncing
  • browser (ui/) talk to DB for data persistence

Since multiple users can have multiple instance of browsers accessing the same repo, this approach has several problems:

  • we have some complicated logic to handle when and which user should write the DB.
  • there might be consistency issue between Yjs and DB due to bugs

The ideal workflow should be centered around Yjs (browser <-> Yjs <-> DB):

  • browser talk to yjs for peer-syncing
  • Yjs talk to DB for data persistence

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions