cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Concurrency

How to handle Data concurrency ?

4 REPLIES 4

Hi @deepakworld258566,
Please describe your problems and we try help you. Concurrency in Data is very large topic.

hi @maciej.krzywdaa,
The topic of my concern is that if we have 2 different write statements coming at same time on different core servers (For example - first statement wants to change age of Node A to 15 and second statement wants to change Age of Node A to 20). What will happen in this case?

As Neo4j is a ACID compliant database this is no different than any other ACID compliant database. For a write to occur a lock(s) need to first occur on the objects effected. One of the transactions will be run first, lock related nodes/relationships, perform said creates/updates , and then release said locks. The 2nd transaction will not occur until the locks have been released and the 2nd transaction can then acquire said locks.

Are you encountering an issue?

In a causal cluster, only 1 node in the cluster can be the leader with write capability, so there can never be a case where 2 core nodes are attempting to perform writes, instead both write queries will go to the leader, and at that point everything Dana said applies.