The application must ensure that a new order will not exceed the customer’s credit limit. How to implement transactions that span services? Forces Since Orders and Customers are in different databases owned by different services the application cannot simply use a local ACID transaction. ![]() Implement each business transaction that spans multiple services as a saga.Ī saga is a sequence of local transactions.Įach local transaction updates the database and publishes a message or event to trigger the next local transaction in the saga. ![]() Choreography - each local transaction publishes domain events that trigger local transactions in other services.There are two ways of coordination sagas: If a local transaction fails because it violates a business rule then the saga executes a series of compensating transactions that undo the changes that were made by the preceding local transactions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |