Document Sync.
Real-time collaborative editing with CRDT conflict resolution, on serverless AWS.
- React
- Python
- AWS Lambda
- API Gateway
- DynamoDB
- Yjs
- Terraform
- GitHub Actions
The problem
Two people editing the same document at the same time is the hard case in collaborative software. Last-write-wins silently destroys work: whoever saves second overwrites the first person's edit with no warning and no way back. Getting this right means the merge has to happen at the data-structure level, not the save button.
Approach
Propagated changes over WebSockets through API Gateway to Lambda handlers, keeping the whole path serverless with no connection servers to run.
Persisted document state in DynamoDB so sessions survive disconnects and reconnecting clients resync from durable state.
Used CRDTs (via Yjs) for conflict resolution, so concurrent edits to the same region of a document merge deterministically rather than overwriting.
Defined the infrastructure in Terraform and automated deployment through GitHub Actions, making the whole stack reproducible.
Outcome
- Concurrent edits to the same region merge instead of overwriting — no silent data loss.
- Fully serverless: no WebSocket servers to provision, patch or scale.
- Infrastructure and deploys are reproducible from source via Terraform and GitHub Actions.
In full
A real-time collaborative editor where multiple users edit one document simultaneously, with changes propagating over WebSockets through API Gateway to Lambda handlers and state persisted in DynamoDB. CRDT-based conflict resolution means concurrent edits to the same region merge instead of overwriting, and deployment is automated through GitHub Actions with infrastructure defined in Terraform.