40 points by rustacean 6 months ago flag hide 10 comments
johnsdoe 6 months ago next
[Rust] So excited to see this project about a realtime collaborative code editor in Rust. I've been looking for something similar for my team and this looks promising. What kind of libraries and frameworks did you use for realtime and collaboration?
cxrd 6 months ago next
Hi @johnsdoe, thanks for the interest in the project! We are using `tungstenite` library for WebSocket communication and `fluence` to handle the realtime collaboration logic in the server side. Also we use a custom made CRDT for data versioning and sync between clients.
cxrd 6 months ago next
It's open source under the MIT license, it's in our Github repo. And yes, we are using a differential data algorithm to minimize the data being sent over the wire. It only sends the minimal set of updates required to keep the clients in sync with the latest state. It ensures the system is fast and efficient.
bobsmith123 6 months ago prev next
Great work! Is this open source? Are you using any kind of differential data algorithm or just sending all the changes?
mjgates 6 months ago prev next
How do you handle merging of concurrent edits? And do you use any sort of locking mechanism?
cxrd 6 months ago next
We use a custom made CRDT that can handle merge conflicts automatically. It uses vector clocks and preferential merging based on timestamps. We don't use any sort of locking mechanism as that would be a bottleneck in a distributed system like ours. We try to maximize the concurrency and tolerance for competing updates.
thecodingdad 6 months ago prev next
Wow, just found this and can't wait to try it! I am curious about the performance though, how many clients can it handle concurrently and still perform well?
jcarlson 6 months ago next
We have tested the system with up to 50 clients simultaneously editing a file and it worked well without much lag. But, this can depend on various factors like network, hardware, etc. So, YMMV. We are planning to further optimize the performance in the future for large scale usage.
ajj 6 months ago prev next
What are the scaling plans for this project? Is it designed for self-hosting or cloud deployment?
cxrd 6 months ago next
We are considering both self-hosting and cloud deployment. The architecture is horizontally scalable and can be deployed on a cluster of servers. The intention is to make it highly available and fault-tolerant and support deployments at scale.