![]() A choreography-based saga can publish events using Aggregates and Domain Events.The following patterns are ways to atomically update state and publish messages/events:.The Database per Service pattern creates the need for this pattern.websocket, web hook, etc) to the client once the saga completes. containing the orderID) after initiating the saga, and then sends an event (e.g. The service sends back a response (e.g.containing the orderID) after initiating the saga and the client periodically polls (e.g. once it receives an OrderApproved or OrderRejected event. The service sends back a response once the saga completes, e.g.There are several options, each with different trade-offs: HTTP POST /orders) needs to be able to determine its outcome. Instead, it must use one of the patterns listed below.Ī client that initiates the saga, which an asynchronous flow, using a synchronous request (e.g. It cannot use the traditional mechanism of a distributed transaction that spans the database and the message broker. In order to be reliable, a service must atomically update its database and publish a message/event. There are also the following issues to address: This solution has the following drawbacks:įor example, a developer must design compensating transactions that explicitly undo changes made earlier in a saga. ![]() It enables an application to maintain data consistency across multiple services without using distributed transactions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |