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

Solution

Communicate and persist the change in state of domain entities as a series of atomically produced immutable domain events to drive asynchronous inter-component communication and facilitate event processing logic. Strictly adhere to a policy that a command must perform one and only one atomic write operation against a single resource, either a stream or a cloud-native database, and then rely on the asynchronous mechanism of the resource to chain commands together. There are two compatible variations on this solution that are inevitably used together to form these chains: Event-First and Database-First.