Oracle and Neo4J sync

(Ricardolgmonteiro) #1


I am newbie in Neo4J and I have a complex applications running in Oracle database. I need to send data from this application to Neo4J in real time. In fact this integration must be in both sides from Oracle to Neo4J and vice-versa. In Neo4J I will create many relationships and use AI routines to populate nodes and relationships. It will be more efficient using Neo4J. After that, I need to send data from Neo4J to Oracle. The first idea is create oracle triggers and it call procedures that creates node and relationships in Neo4J. This way could be interesting for me. Is that possible? Is there other way?

Thank you for any help

(Ryan Boyd) #2

Hi Ricardo,

Two-way sync tends to be a fairly difficult computer science problem. However, if you have very specific rules you may be able to accomplish it.

I agree with your idea re using triggers in Oracle to make the updates in Neo4j. You could have the trigger call a Java stored procedures in Oracle, and use the Neo4j Java Driver inside that stored procedure to make the appropriate updates in Neo4j.

Similarly, there are triggers in the APOC library for Neo4j that you can use to send SQL over a JDBC connection to an oracle DB.

(Ricardolgmonteiro) #3

Hi Ryan.

Thank you for your reply. I was thinking to write something like an executor of cypher commands using java. I call the java stored procedure using as parameter the create node or relationship. It should be a simple class in java that only connect to neo4j and execute the command. I don't know if this is the better way, but as I don't have enough knowledge of java, it makes easier for me :slight_smile: This is the way to write data into neo4j. To get data from neo4j, I though in another class the returns a result set also running a command (match).


(Michael Black) #4

How much control do you have over the application? If you're adopting a polyglot persistence strategy, hopefully you have full control. Because then you could program in the application to send the data to both data stores instead of building triggers and connections between the two databases. I'd also worry about delay in the application response waiting for transactions to commit or circular trigger scenarios. How asynchronous can your transactions be? Would an eventual consistency model be appropriate? You could use AWS SNS+SQS services to publish transactions and comminate between the databases to apply changes?