Two approaches to collaborative editing:
Operational Transformation (OT): Transform operations based on concurrent changes. If User A inserts at position and User B deletes position , transform A's insert to position . Google Docs uses OT.
CRDTs (Conflict-free Replicated Data Types): Data structures that merge automatically. No central server needed. Used by Figma.
OT is simpler but needs a central server. CRDTs are complex but enable peer-to-peer and offline editing.