influxdata / influxdata/ui

move notebook storage layer to yjs

Open
#2,818 4 comments 0 reactions 1 assignee Claimed by @asalem1 View on GitHub
area/notebooks enhancement team/automation team/ui team/unity
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

we currently store our notebooks in localstorage, pool the change events, and push changes to persist in postgres. This effectively has a "last save wins" resource model on the api level, where the last user to save an open notebook without refreshing the state will wipe out the work of all other users. As a prereq for multiple users being able to work off the same notebook, we need a persistance model that isn't so prone to data loss through update collisions. This is typically done through either resource locking (only one person can edit at a time), operational transforms (atomic collision resolution), or crdts (magic). of these solutions, the one that offers the best user experience with the least ux intrusion, and with fun things like offline support (surviving a phone going through a tunnel while typing, not like.. off grid notebooks) or audit logging / undo history for notebooks, would be an implementation of CRDT using the yjs library.

to fully get sharing, we're going to have to implement a redis chatroom server over websockets, but before we can start iterating on that design, we need the frontend storage mechanism to be defined in yjs so that we can start generating the events.

the outcome of this should keep the notebooks current feature of syncing between tabs on the same browser, and still save notebooks to postgres while we write the chat room nodes

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.