Reputation: 180
We have following requirement:
Basically, we want to have transactions over multiple NoSQL databases. Is there a way to do it in Java (Spring)?
Upvotes: 1
Views: 312
Reputation: 775
There is no standard way of doing transaction across multiple NoSQL databases nor its supported by Spring.
Two approaches comes to my mind:
You should be using only one database to achieve it. for example in your case, You can use Cassandra to do transaction at Node, Data Center or all Data Center level. and send data to Elastic Search asynchronously after Cassandra transaction succeeds
But if you must do it, I would recommend using Redis for acquiring global distributed transaction lock. Note that this is very expensive operation and you need to take care failure and rollback by yourself.
Upvotes: 2