Cloud-Native Applications in Java
上QQ阅读APP看书,第一时间看更新

Collapsing the microservices

An option for when there seems to be a coupling between composite and its constituent microservice collapsing the services, and run as a single component. For example, transferring funds can be implemented by an account service, with an additional method transferFunds accepting fromAcc, toAcc, and the fund amount. It can then issue the debit and credit method calls as part of a single transaction. However, this approach needs to be decided after due consideration. The drawbacks include coupling deploying of debit and credit services of the credit card and savings domain: