CRDTs merge concurrent edits. Why not concurrent creation?
4 hours ago
- #CRDT
- #Data Synchronization
- #Concurrency
- Mergeable Containers in Loro address concurrent child container creation issues where offline edits appear lost after syncing due to different container IDs from concurrent operations.
- The new API methods like ensureMergeableList, ensureMergeableText, etc., allow child containers to be identified by logical position in a Map, not by operation ID, ensuring shared access across peers.
- Mergeable Containers use a synthetic ContainerID derived from parent map and key, along with a binary marker in the parent map slot to control visibility, preventing accidental activation elsewhere.
- Use cases include dynamic child containers like date-keyed lists, schema migrations, and per-user subdocuments, where eager initialization isn't feasible.
- Existing setContainer/insertContainer behavior remains unchanged for distinct child objects, ensuring backward compatibility.
- Appendix includes reproducible examples showing the issue and fix in Loro, Yjs, and Automerge, highlighting data loss in concurrent scenarios.