Skip to content
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

支持多设备操作不同文档后云端同步合并 #5092

Closed
88250 opened this issue Jun 3, 2022 · 8 comments
Closed

支持多设备操作不同文档后云端同步合并 #5092

88250 opened this issue Jun 3, 2022 · 8 comments
Assignees

Comments

@88250
Copy link
Member

88250 commented Jun 3, 2022

前期讨论 #5091 #4157

新的同步算法 #5142

@ssfdust
Copy link
Contributor

ssfdust commented Jun 6, 2022

云端可否提供一个api,返回当前服务器时间的时间戳,用来校验当前设备与云端的时间差。假如时间差超过5分钟,则提示用户“当前设备与云端时差过大,若同步可能会造成文件覆盖的问题,建议校验后同步。Windows时间校验教程: https://docs.microsoft.com/zh-cn/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings ”提供一个忽略按钮和取消按钮。

@88250
Copy link
Member Author

88250 commented Jun 6, 2022

经过实验探索,这个同步方案不够稳定,实现细节容易导致 bug。

估计得继续考虑新的方案,将本地库变更和网络解耦,类似 git 的策略。

@ssfdust
Copy link
Contributor

ssfdust commented Jun 6, 2022

sad 要不直接用git管理吧.... (懒人发言...

@88250
Copy link
Member Author

88250 commented Jun 6, 2022

完全使用 git 也是个方向,早期我们做过线上尝试,但当时用的是 SSH 协议。理想中的算法就是类似 git,本地有个库,然后可以合并,发生冲突可以解决。考虑到一些实际情况,比如冲突解决对于用户来说比较困难,不过应该可以用类似现在的覆盖策略。这样没有冲突的文件可以自动合并,冲突的就直接优先本地变更。

如果要用 git,应该是可以用 HTTP 协议对接服务端,但是这样的话性能和成本会有问题,云端存储用的是对象存储,意味着网络传输要走两次(用户 - 服务端 - OSS),所以估计也不大现实,也许魔改一下 git 也是个路线……

综合考虑下来,我们需要一个支持本地文件系统和网络传输分离的方案,本地文件系统可以类似 git repo,单独提交(或者快照),支持历史数据查询和回滚;网络支持 HTTP 协议,传输实际数据时支持直接对接 OSS;支持分布式数据合并,且合并算法要灵活。最后,要支持跨平台。

能满足需求的开源工具目前似乎没有,只能继续考虑看下。

@ssfdust
Copy link
Contributor

ssfdust commented Jun 6, 2022

好像有类似的开源的工具,看看这个合适不合适?
https://golangexample.com/a-version-control-system-to-manage-large-files/

@88250
Copy link
Member Author

88250 commented Jun 6, 2022

@ssfdust 后续参考一下,直接用的话估计不得行。

@woniuxia
Copy link

woniuxia commented Jun 7, 2022

这个同步功能想做好真的太难了。
辛苦D大~

@88250 88250 mentioned this issue Jun 9, 2022
18 tasks
@88250
Copy link
Member Author

88250 commented Jun 11, 2022

@ssfdust 感谢之前你提供的建议,我们参考 ArtiVC 开了个新项目 DejaVu,以后逐步进行改造迁移 #5142

@88250 88250 removed the Enhancement label Jun 28, 2022
@88250 88250 removed this from the backlog milestone Jun 28, 2022
@88250 88250 closed this as completed Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants