P2PDocs is a peer-to-peer collaborative text editor built for the Distributed Systems course at the University of Udine. Multiple peers can edit the same document without a central server, handling concurrency, network partitions, and offline edits.
Project overview#

The editor uses Conflict-Free Replicated Data Types (CRDTs) for automatic conflict resolution and causal broadcast for ordered message delivery across peers.
Technical contributions#
1. LSEQ CRDT implementation#
We used the LSEQ strategy to preserve user intent across concurrent edits:
- Rational position vectors for dense ordering
- Peer-ID tagging to break ties on concurrent edits
- An AVL order-statistic tree for
O(log n)insertions and deletions
2. Network layer#
- Echo-Wave protocol for reliable operation propagation
- Neighbor handshake to sync newly joined peers
- Crash recovery backed by ETS (Erlang Term Storage)
3. Testing and validation#
We wrote unit tests in ExUnit and multi-node integration tests in Docker to simulate partitions and node failures:
./start_n_instances_for_tests.sh 5 # Launch 5 peers
./disconnect.sh 2 # Simulate node failureTeam#
Distributed Systems course project built with Elixir, Node.js, and Docker:
Future work#
From our final report, natural next steps would be Markdown formatting support, real-time cursor tracking, and trimming vector clock growth.
Learn more#
- Project report: Report.pdf
- Source code: github.com/lilvirgola/P2PDocs








