Description
Problem
JupyterLab has an abstraction layer called modelDB in the observables package, which currently serves as a proxy for the Yjs shared types. At the time real-time collaboration was being implemented in JupyterLab using Yjs, there was the question of whether to drop modelDB or keep it as an abstraction layer on top of Yjs, and it was decided to keep it so that another CRDT backend could be used, if needed. There are a number of issues with that:
- Yjs has features that modelDB doesn't have, which therefore cannot be used, for instance:
- deep observability,
- transaction support.
- since data lives in both models, memory is duplicated.
- since there is a double binding between modelDB and Yjs, special care must be taken in order to avoid circular dependencies.
All of this results in additional complexity, for really no benefit because JupyterLab already depends on jupyter-ydoc which depends on Yjs, so JupyterLab is not CRDT-agnostic (although I agree the CRDT-specific part is well contained in jupyter-ydoc).
Additionally, as Jupyter is moving towards server-side execution, new issues start to appear because the modelDB abstraction doesn't exist in the backend, where we directly use pycrdt (Python bindings to Yrs, the Rust port of Yjs). Therefore we cannot communicate at the modelDB level between the backend and the frontend.
Finally, the possibility of using another CRDT library in the future is getting smaller as Yjs is getting more and more popular. The only real alternative is Automerge that a team of JupyterLab developers evaluated and which was eventually discarded.
Proposed Solution
I propose to drop modelDB altogether from the JupyterLab code base, and directly use Yjs instead.
See jupyterlab/jupyterlab#16481 for more discussions.
@jupyterlab/jupyterlab-council Let's vote:
-
Jason Weill (@JasonWeill):
- yes
- no
- abstain
-
Afshin Darian (@afshin):
- yes
- no
- abstain
-
Alex Bozarth (@ajbozarth):
- yes
- no
- abstain
-
Andrii Ieroshenko (@andrii-i):
- yes
- no
- abstain
-
Steve Silvester (@blink1073):
- yes
- no
- abstain
-
Nicolas Brichet (@brichet):
- yes
- no
- abstain
-
Damián Avila (@damianavila):
- yes
- no
- abstain
-
Eric Charles (@echarles):
- yes
- no
- abstain
-
Brian Granger (@ellisonbg):
- yes
- no
- abstain
-
Eric Gentry (@ericsnekbytes):
- yes
- no
- abstain
-
Frederic Collonval (@fcollonval):
- yes
- no
- abstain
-
Fernando Perez (@fperez):
- yes
- no
- abstain
-
Gabriel Fouasnon (@gabalafou):
- yes
- no
- abstain
-
Isabela Presedo-Floyd (@isabela-pf):
- yes
- no
- abstain
-
Paul Ivanov (@ivanov):
- yes
- no
- abstain
-
Jason Grout (@jasongrout):
- yes
- no
- abstain
-
Jeremy Tuloup (@jtpio):
- yes
- no
- abstain
-
Michał Krassowski (@krassowski):
- yes
- no
- abstain
-
Martha Cryan (@marthacryan):
- yes
- no
- abstain
-
Mehmet Bektas (@mbektas):
- yes
- no
- abstain
-
R Ely (@ohrely):
- yes
- no
- abstain
-
Rosio Reyes (@RRosio):
- yes
- no
- abstain
-
Sylvain Corlay (@SylvainCorlay):
- yes
- no
- abstain
-
Zach Sailer (@Zsailer):
- yes
- no
- abstain
EDIT: I added @RRosio, @SylvainCorlay and @Zsailer to the list of voters, according to this list.