For collaboration we use a modified version of sharedb (
https://github.com/share/sharedb). Its using the operational transformation algorithm (
https://en.m.wikipedia.org/wiki/Operational_transformation). We will be publishing an article about tech stack at out blog within few days :)