(评论)
(comments)
原始链接: https://news.ycombinator.com/item?id=38489307
然而,将更改从源推送到远程数据库会产生与经典两阶段提交相同的潜在不一致问题。 此外,对于多个并发编辑者实时修改磁盘上的数据库,设计变得更加困难。 尽管 SQLSync 支持“仅本地”模式,在这种模式下,它不维护返回远程服务器的链接,但这可能会导致多个断开连接的位置发生冲突的更改。 为了减轻冲突并确保在多个断开连接的设备(例如手机)上同时编辑相同内容时的最终一致性,作者使用多版本并发控制扩展了 CRDT [8]。 最后,为了最大限度地减少客户端设备和主服务器之间的数据传输成本,可以采用中间层来存储本地编辑,然后再推送到源服务器。 然而,这带来了额外的开销,并且需要开发分布式版本控制算法; 它超出了本文的范围,因此我们不会详细讨论它。 参考:
[6] M. Stone 等人,SQL 事务:性能分析和设计影响,Proc。 国际会议 数据管理 (SIGMOD) (ICSD),第 1-14 页,1976 年 4 月。 [7] T. Gray 等人,与关系数据库系统的交互,Commun。 ACM SIGCAT 计算系统实验特刊 (SIGCIS),卷。 13、编号。 1975 年 7 月 3 日。 [8] Y. Z. Wang 等人,在没有全局锁定的情况下实现分布式数据库:Crdt 概念和定理,arXiv:cs/000619v1,2000 年 2 月。
He’s a seasoned database architect. With SQLsync he’s made a way for frontend developers to query and update a remote database as if it was completely located right in the browser. Because it basically is. The power of WASM makes it possible to ship a whole SQLite database to the browser. The magic is in how it syncs from multiple clients with a clever but simple reactive algorithm.
It’s a radical attack on the whole problem. Much of our work as developers is about syncing data. When you start looking at React and REST APIs as a kind of sync procedure, this approach can open a lot of new possibilities. You don’t have to write a weird bespoke database of trees of objects fetched and cached from the API any more. You can just update and query it locally, with all the power of a relational database.
reply