GitHub user chuzhe-as-a-dev created a discussion: XA模式下的全局可串行性|Global 
serializability in XA mode

大家好,我是上海交通大学的数据库研究人员,我们最近在数据库顶会VLDB 
2025上发表了一篇论文([论文](https://chuzhe.me/assets/pdf/2025%20-%20Sonata-%20Multi-Database%20Transactions%20Made%20Fast%20and%20Serializable.pdf)、[PPT](https://chuzhe.me/assets/pdf/2025%20-%20Sonata-%20Multi-Database%20Transactions%20Made%20Fast%20and%20Serializable%20(slides).pdf)),高效地实现了跨DB全局可串行性(Global
 
Serializability)的隔离保障,并基于Seata的XA模式构建并开源了[原型实现](https://ipads.se.sjtu.edu.cn:1312/opensource/sonata)。如果社区对这一特性感兴趣的话,欢迎将其集成,我也会提供力所能及的帮助!

全局可串行性是跨DB事务下最强的隔离级别,能够保障跨节点工作流的正确性,减轻应用开发负担。而XA模式下,就算将每个DB的隔离级别都单独设置为可串行化(Serializable),也不能保证跨DB的全局可串行性,事务并发执行仍可导致应用错误(详见论文图1或PPT中例子)。

我们针对不同数据库类别,在XA 
prepare时的额外执行检查/协调操作(绝大部分情况下,只增加一次数据库写)来保证全局可串行性,并在论文中严格证明了算法的正确性。我们的实现十分轻量级,含空行、注释在内约修改了600行,相对学术界先前的全局可串行性方案最高提高了11倍吞吐性能,和Seata的原本XA模式性能几乎一致。

Hello everyone, I am a database researcher from Shanghai Jiao Tong University. 
We recently published a paper at the top-tier database conference VLDB 2025 
([Paper](https://chuzhe.me/assets/pdf/2025%20-%20Sonata-%20Multi-Database%20Transactions%20Made%20Fast%20and%20Serializable.pdf),
 
[Slides](https://chuzhe.me/assets/pdf/2025%20-%20Sonata-%20Multi-Database%20Transactions%20Made%20Fast%20and%20Serializable%20(slides).pdf)),
 which efficiently guarantees global serializability for cross-database 
transactions. We have built and open-sourced a [prototype 
implementation](https://ipads.se.sjtu.edu.cn:1312/opensource/sonata) based on 
Seata's XA mode. If the community is interested in this feature, we would be 
delighted to see it integrated, and I am happy to provide any assistance I can!

Global serializability is the strongest isolation level for cross-database 
transactions, ensuring the correctness of cross-node workflows and reducing the 
burden on developers. However, under the XA mode, even setting each 
participating database to the Serializable isolation level cannot guarantee 
global serializability, and concurrency anomalies can still occur (for details, 
please refer to Figure 1 in our paper or the examples in the slides).

To guarantee global serializability, we perform additional check/coordination 
operations during the XA prepare phase, tailored for different types of 
databases (in most cases, this adds only a single database write), and we have 
formally proven the correctness of the algorithm in our paper. Our 
implementation is very lightweight, with only about 600 lines of code modified 
(including blank lines and comments). It achieves up to 11x higher throughput 
compared to previous academic solutions for global serializability, and its 
performance is nearly identical to Seata's original XA mode.

GitHub link: https://github.com/apache/incubator-seata/discussions/7657

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to