josephg / ShareJS

Collaborative editing in any app
Other
4.97k stars 456 forks source link

Combine operations retroactively #318

Open kctess5 opened 10 years ago

kctess5 commented 10 years ago

Is there currently a way to merge past operations? I can see large collaborative documents amassing tens of or even hundreds of thousands of operations over time, which is pretty data and runtime inefficient. It makes much more sense to keep old (like a few months old) changes that are on a larger scale - say sentences long changes instead of letter long changes. I would imagine that this would allow you to retrieve document state at an earlier time more efficiently, considering that you would need to invert and apply less operations.

Some kind of support for retroactively combining operations while maintaining intention preservation would be great.

Something that would also be great, but is perhaps out of the scope of this library would be to maintain a redis copy of the data in memory for active documents (with an arbitrary definition of "active"), and then merge an arbitrary number of changes and push a small number of larger operations to the main database every once in a while. This would theoretically greatly reduce database traffic and also speed up the process of sending out applied changes to the other clients.

As is the same with my previous issue request, I might end up tackling this myself if there is no current support for it - so any suggestions would be welcome.

devongovett commented 10 years ago

:+1: For reference, see also https://github.com/share/livedb/issues/25 and https://github.com/share/livedb-mongo/pull/7

devongovett commented 10 years ago

@kctess5 did you ever make any progress on this?