https://github.com/iluwatar/java-design-patterns-web/issues/8 Update pattern categories and tags
This commit is contained in:
@ -3,10 +3,9 @@ layout: pattern
|
||||
title: Commander
|
||||
folder: commander
|
||||
permalink: /patterns/commander/
|
||||
categories: Other
|
||||
categories: Concurrency
|
||||
tags:
|
||||
- Java
|
||||
- Difficulty-Intermediate
|
||||
- Cloud distributed
|
||||
---
|
||||
|
||||
## Intent
|
||||
@ -24,4 +23,5 @@ Handling distributed transactions can be tricky, but if we choose to not handle
|
||||
We need a mechanism in place which can handle these kinds of situations. We have to direct the order to either one of the services (in this example, shipping) and then add the order into the database of the other service (in this example, payment), since two databses cannot be updated atomically. If currently unable to do it, there should be a queue where this request can be queued, and there has to be a mechanism which allows for a failure in the queueing as well. All this needs to be done by constant retries while ensuring idempotence (even if the request is made several times, the change should only be applied once) by a commander class, to reach a state of eventual consistency.
|
||||
|
||||
## Credits
|
||||
|
||||
* [https://www.grahamlea.com/2016/08/distributed-transactions-microservices-icebergs/]
|
||||
|
Reference in New Issue
Block a user