I have been reading more about subdocuments and have arrived at a quandary.
Subdocuments seem to be widely recommended for more complex data modeling, in particular granular access control and lazy loading.
Yet, because subdocuments are independent, correct me if I’m wrong, you lose all atomicity across document boundaries. The CRDT will not resolve conflicts across document boundaries, e.g. Subdocuments nested within Y.Map, as opposed to simply nested Y.Maps.
Am I missing something? Is this a limitation of YJS? Granular access control is a requirement on my project, and lazy loading a necessity due to an expected up to 1 million+ nodes in a user’s tree. At the same time, I need conflicts to be handled by the CRDT across different levels of the tree, just like a nested Y.Map.
Thanks so much for your input!
P.S. RxDB is an offline-first database that does not support transactions and instead offers revisions and conflict handling. Not sure if the points made there also apply to YJS, at least in a general sense.