简体   繁体   English

使用jdbcIO与Java驱动程序将数据流输出到neo4j

[英]dataflow output to neo4j using jdbcIO vs java driver

I'm currently working on a setup that uses Google Cloud Dataflow to transform data and save into a Neo4j Database hosted on a Compute Engine VM. 我目前正在使用Google Cloud Dataflow转换数据并将其保存到Compute Engine VM上托管的Neo4j数据库的安装程序中。 The current setup uses a JdbcIO to write to Neo4j by running a prepared statement, but it seems also possible to use a Neo4j driver directly in Java, which allows more flexibility on creating the query dynamically. 当前设置使用JdbcIO通过运行准备好的语句来写入Neo4j,但是似乎也可以直接在Java中使用Neo4j驱动程序,这为动态创建查询提供了更大的灵活性。

I wonder if anyone had compared the 2 approaches and notice any differences? 我想知道是否有人比较了这两种方法并注意到有区别吗? I would guess the Jdbc approach would be more efficient since it only need to run the prepared statement, but that is just my guess. 我想Jdbc方法会更有效,因为它只需要运行准备好的语句,但这只是我的猜测。

Update I'm going to post my findings as I experiment more with the two methods 更新我将在更多地尝试这两种方法的同时发布我的发现

One difference I found was that when using JdbcIO, I run into a deadlock when multiple transaction is trying to write to the same node at the same time. 我发现的一个区别是,当使用JdbcIO时,当多个事务试图同时写入同一节点时,我陷入了死锁。 However that issue did not occur when using Neo4j driver directly. 但是,直接使用Neo4j驱动程序时不会发生该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM