问题描述
我的项目使用 spring boot 和 neo4j.SDN(spring data neo4j)作为数据访问层.最近遇到一个需要跨存储持久化的问题,需要同时更新neo4j和oracle数据库中的数据.因此,这样做的标准方法是 XA 分布式事务.我在将 neo4j 与 JTA 集成时查找的任何资源都是旧的,最近我在 SDN 参考页面上发现了这一点:Neo4j 正在放弃 XA 支持,因此 SDN 不提供任何跨存储持久性功能"
I use spring boot and neo4j for my project. SDN(spring data neo4j) as a data access layer. Recently I faced a problem where I need cross-store persistence, I need to update data in both neo4j and oracle database. So standard way to do that is XA distributed transactions. Any resources I looked up on integrating neo4j with JTA are old, and recently I found out this on SDN reference page:"Neo4j is dropping XA support and therefore SDN does not provide any capability for cross-store persistence"
链接:https://docs.spring.io/spring-data/neo4j/docs/5.1.10.RELEASE/reference/html/
我的问题是,任何人都可以提供有关 neo4j 支持 XA 事务的状态的信息,或者是否有人尝试在全局分布式事务中将 neo4j 与 JTA 事务管理器一起使用?
My question is, can anyone provide information about the state of XA transaction support by neo4j, or has anyone tried to use neo4j with JTA transaction manager in a global distributed transaction?
推荐答案
在大多数情况下,人们现在在应用程序架构方面使用联邦,例如使用流解决方案并且不要依赖 XA,因为大多数 NOSQL 数据库也不支持它们.所有其他 spring 数据项目也不支持它,大多数推荐带有消息代理的发件箱模式.
In most cases folks now use federation on the application architecture side, e.g. with streaming solutions and don't rely on XA as such as most NOSQL databases don't support them either. All the other spring data projects don't support it either, most recommend an outbox pattern with a message broker.
因此,今天的一种常见模式是使用变更数据捕获 (CDC) 来触发依赖数据库中的后续更改.
So a common pattern today is to use Change Data Capture (CDC) to trigger follow up changes in a dependent database.
XA 的下降是因为我们的客户都没有使用它,而且它需要维护一大块代码库.我们还放弃了事务性 lucene 集成,这是我们添加它的最初原因之一.
The drop of XA was because none of our customers used it and it was a huge chunk of codebase to be maintained. We also dropped transactional lucene integration which was one of the original reasons we added it.
这篇关于Neo4j 是否仍然支持 XA 事务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!