event-sourcing2
2017-03-03 12:07:27 0 举报
Event sourcing 2是一种基于事件驱动的应用程序设计模式,它的核心思想是将应用程序的状态表示为一系列不可变的事件。这些事件按照时间顺序存储在数据库中,并通过处理这些事件来构建应用程序的当前状态。与传统的数据库模型不同,事件源模型不需要固定的表结构,而是允许开发人员根据需要添加或删除属性。此外,由于事件是原子性的,因此可以轻松地实现事务管理和一致性保证。Event sourcing 2已经被广泛应用于分布式系统、微服务架构和实时应用程序等领域,因为它能够提供高度可扩展性、可靠性和灵活性。
作者其他创作
大纲/内容
~
5
User interface
Reserve 2 seats
2
...
1. The user interface issues a command to reserve two seats2. The SeatAvailability aggregate is populated by querying for reservation and cancellation events3. The command handler invokes a method in the domain model to reserve the seats.4. The SeatAvailability aggregate records an event stating the number of seats that were reserved.5. The system appends the event to the event store
Cancel 1 seat
Reserve 1 seat
4
1
Commandhandler
?
3
SetAvailabilityaggregate
Domain model
0 条评论
下一页