go event sourcing example
Account service relies on event store directly. All data stores in memory.
- Open: open an account with init balance
- Transfer: transfer money from one account to another account
- Store: store money to the account
- Withdraw: withdraw money from the account
Everytime users get balance, they need to get all event list and do aggregation.
Transfer, store, and withdraw don't verify whether account exist.
Create a snapshot store to store aggregation result.
Create an entity store to store exist account.