-
Notifications
You must be signed in to change notification settings - Fork 34
Domain Diagrams
Welcome to the official wiki documentation for the Axon Trader reference example. Axon Trader is an end-to-end reference architecture maintained in partnership with AxonIQ and Pivotal Software, and is intended to be a practical example that demonstrates the best practices for implementing cloud-native event-driven architectures using Spring Boot, Spring Cloud, and Axon.
The comprehensive example contained inside this repository includes everything you'll need in a cloud-native production environment that utilizes Cloud Foundry. This reference example is built to demonstrate the very best capabilities of Pivotal Cloud Foundry's Application Service. While this reference application can be deployed to any distribution of Cloud Foundry, there are certain backing services that are only available via Pivotal's distribution, such as Spring Cloud Services.
The goals of this overview page:
- Teach you the Axon Trader domain
- Visualize and diagram the CQRS workflows
- Diagram and explain the architecture and trade offs
The domain of the Axon Trader application is realistically complex, as demonstrated in the graph diagram below.
Transaction
is an aggregate that maintains the state of an Order
. Using a Transaction
, the systems knows whether an Order
is accepted, cancelled, executed or partially executed. The Transaction
has a reference to the OrderBook
aggregate that the Buy or Sell Transaction
was created for. The Transaction
also has a reference to the Portfolio
that started the Transaction
.
Portfolio
is an aggregate that contains money and stock Items
. Using a Portfolio
, a User
can start a Buy Transaction
or a Sell Transaction
. The Portfolio
also has the responsibility to reserve money for buy Orders
and reserve stock Items
for sell Orders
. The Portfolio
has a reference to the User
.
OrderBook
is an aggregate that controls the matchmaking between Buy and Sell orders. An OrderBook
entity tracks the list of buy orders and sell orders executed as Transactions by a User. When new orders arrive, the OrderBook
stores them and checks if there is a match between the new order and one or multiple other orders. An OrderBook
is related to a Company
and represents one type of stock item.