How to handle Data concurrency ?

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

1 Like

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?

1 Like

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.

1 Like