I have a Spring Boot server that collects 2 gRPC microservices - one of them works with the DynamoDB and another CockrachDB database. I need to make sure the commit works fine in both of the DB's and if not need to roll back from both of them.
The issue is if this is successful in the first DB and has an exception into the 2nd, it may not be possible normally to rollback from the 1st DB.
How can I achieve so the commit is either successful or failed in both of the DB's together?
CodePudding user response:
For distributed transaction management frameworks or architectures, you can refer to these links:
- https://seata.io/en-us/
- https://microservices.io/patterns/data/saga.html
- https://medium.com/@dongfuye/the-seven-most-classic-solutions-for-distributed-transaction-management-3f915f331e15
- https://dba.stackexchange.com/questions/18435/cap-theorem-vs-base-nosql#:~:text=1 Answer&text=CAP is Consistency, Availability, and,throws consistency out the window.
Hope these links can help.