Eventual consistency handles operations that span services and therefore cannot use a single database transaction. Instead, the operation proceeds through a series of local transactions, with their effects converging over time rather than taking effect atomically. section 1.3.4 section 7.5.1
A local operation can execute within one transaction. A distributed operation crosses process and transaction boundaries, so its local transactions must be coordinated; asynchronous messaging is one way to do this. The application may also need explicit undo logic and concurrency handling rather than relying on the database to manage them. section 1.3.4 section 7.5.1
Figure 7.9 Distributed transactions are replaced with a sequence of local transactions coordinated by asynchronous messaging
The figure shows a distributed transaction replaced by local transactions coordinated through asynchronous messaging. section 7.5.1
Creating an order across services
A createOrder() operation that spans services cannot be implemented as one database transaction. It must instead use transactions within the participating services, with the added work of coordinating them and handling concurrency or undo when necessary. section 1.3.4
Use service boundaries deliberately. Keeping performance-critical operations within one service can avoid distributed-operation costs, although it may require larger services. Some operations will still span services, so account for network latency, runtime coupling, and the complexity of eventual consistency when evaluating the design. section 1.3.4 section 7.5.1









