Java 服务器和浏览器客户端之间乐观对象复制的解决方案?

发布于 2024-10-06 05:54:56 字数 788 浏览 1 评论 0 原文

我正在构建一个系统,多个用户需要同时创建、查看和修改一组对象。

  • 该系统计划在 Java 服务器和现代浏览器客户端上运行(我可以选择哪些)。
  • 它需要在网络和服务器中断时具有鲁棒性,用户界面不得阻止修改,修改需要存储在本地并在连接恢复时发布。
  • 在正常操作下,更改应以亚秒级延迟进行复制。
  • 网络延迟和带宽、CPU 资源不太可能是大问题,规模约为数十到数百个客户端。
  • 这些对象可以被视为原子值的结构和结构集(即树)。看来对象之间的引用是不必要的。
  • 我对属性级别上的最后写入获胜冲突解决方案感到满意,对快照一致性没有任何特殊要求。我想通过用户界面报告写入冲突。
  • 最初,我希望解决服务器和多个客户端之间的复制问题。将来我可能也需要多层树。任意复制结构不是必需的,但会使故障转移或多主机变得更容易。

我遇到的问题是在系统之间复制对象的更改。分布式并发很困难,我想将这种复杂性委托给知道自己在做什么的人。有哪些库/框架可以帮助完成复制部分?

我已经找到了 XSTM ,它的使命似乎几乎正是我所需要的,但不幸的是 GWT 部分似乎并没有尚未准备好,该项目的未来似乎还不确定。

如果没有什么真正有用的东西,那么我正在寻找什么算法对此有好处?

我目前正在考虑一些受 DVCS 和运营转型启发的事情。服务器将接受对象的更改集并拒绝冲突的写入。客户端将跟踪最后已知的服务器状态和本地所做的更改,检测已发布的更改和本地更改之间的冲突,并在收到的服务器状态之上重新调整不冲突的本地更改。

I'm building a system where multiple users need to create, view and modify a set of objects concurrently.

  • The system is planned to run on a Java server and modern browser clients (I get to pick which ones).
  • It needs to be robust in face of network and server outages, the user interface must not block for modifications, modifications need to be stored locally and published when connectivity returns.
  • Under normal operation changes should replicate with sub-second latency.
  • Network latency and bandwidth, cpu resources are unlikely to be big issues, scale is on the order of tens to hundreds of clients.
  • The objects can be considered as structures of atomic values and sets of structures (i.e. trees). It seems that references between objects are unnecessary.
  • I'm happy with last-write-wins conflict resolution on the attribute level, don't have any particular requirements for snapshot consistency. I would like to report write conflicts through the UI though.
  • Initially I'm looking to solve replication between a server and multiple clients. In the future I'll probably need multi-level trees too. Arbitrary replication structures are not necessary, but would make failover or multi-master easier.

The issue that I'm in trouble with is replicating changes to the objects between systems. Distributed concurrency is hard and I'd like to delegate that complexity to someone who knows what he's doing. What libraries/frameworks are out there that would help with the replication part?

I already found XSTM and its mission seems to be almost exactly what I need, but unfortunately the GWT part doesn't seem to be ready yet and the project seems to have an uncertain future.

If there's nothing really useful out there, then I'm looking for ideas on what algorithms would be good for this?

I'm currently thinking of something inspired by DVCS and operational transform. The server would accept change-sets for objects and reject conflicting writes. Clients would track the last known server state and locally made changes, detect conflicts between published changes and local changes and rebase unconflicting local changes on top of received server state.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逆光下的微笑 2024-10-13 05:54:56

某些分布式数据库如 Cassandra 是一个选项吗?它提供的可能超出您的需要,但至少需要 3 个节点运行。

Is some distributed database as Cassandra an option ? It probably provides more than you need and needs at lest 3 nodes running though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文