Re:Eventual Consistency in Real-time Web Apps
by josephg on Tuesday June 17, 2014 @02:36PM
(#7906112)
OT also won't lose data under pressure.
The biggest downsides of CRDTs are that your data ends up much bigger (although usually by a constant multiple), and nobody has figured out how to edit JSON documents using CRDTs yet.
Its not all that surprising that CRDTs will be larger - imagine a stream of operations happening to a document (think about them like tiny git commits, if that helps). You can end up with a lot of changes for a small document (tens of thousands of changes for a single page of text isn't unheard of). CRDTs in effect embed the history of operations into the document, while OT stores them separately. As such, with OT you can eventually migrate the operation log to secondary storage (or throw it away). You can never really do that with CRDTs.
The JSON problem is harder, and obviously very important for realtime web apps that do more than text editing. Decent CRDTs will be trivial to add to ShareJS when they're ready.
The biggest downsides of CRDTs are that your data ends up much bigger (although usually by a constant multiple), and nobody has figured out how to edit JSON documents using CRDTs yet.
Its not all that surprising that CRDTs will be larger - imagine a stream of operations happening to a document (think about them like tiny git commits, if that helps). You can end up with a lot of changes for a small document (tens of thousands of changes for a single page of text isn't unheard of). CRDTs in effect embed the history of operations into the document, while OT stores them separately. As such, with OT you can eventually migrate the operation log to secondary storage (or throw it away). You can never really do that with CRDTs.
The JSON problem is harder, and obviously very important for realtime web apps that do more than text editing. Decent CRDTs will be trivial to add to ShareJS when they're ready.