Real-time layer: WebSocket connections. Client sends operations. Server transforms and broadcasts to all editors.
Persistence: Periodic snapshots + operation log. Rebuild document by replaying operations on last snapshot.
Presence: Show who's editing where. Cursor positions broadcast every ms.
Version history: Store snapshots at intervals. Named versions on user request. Allow rollback.
Keep the real-time path fast. Heavy operations (version snapshots, export) happen asynchronously.