-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
persist in redis #2
Comments
It really depends on your use case. If you want to be able to replay every single keystroke in the history of a document, you have to save every single operation. If you expect that clients get out of sync for a long time and want them to catch up and integrate the edits they did while they were offline, you have to store every operation. Otherwise, you can just wait until the users have paused editing (no new operations for a few seconds), merge all new operations and write them as a single operation to redis. In this case, redis is used only as a history, not as a store for operations that might be needed when a client sends an operation that has to be transformed against old operations. There isn't a ready-made solution for saving the operations in redis from the JavaScript implementation. Since I don't have much time at the moment, you'll have to come up with a solution yourself. But there is a lua script that runs in redis using the new scripting feature. It can be called with two keys (the key of the document and the key of the operations list), a revision number and optionally the a new operation (as a JSON string) and returns all operations since the given revision number (including the transformed new operation). It uses a linked list and does an Kind Regards, |
thank you very much! I will have a look and see how far I can get |
FYI, I made a blog post with instructions on how to get OT in Redis up and running. Hope it helps! https://blog.sffc.xyz/post/182052412225/operational-tranformation-in-redis |
Hi, I am really interested in this project,
What would be the best way to store in redis? Should I store every operation ?
thanks
The text was updated successfully, but these errors were encountered: