generated at
同じBounded Context内でのConsistency
同期的に保つか、非同期的に保つかは場合による
ただし、1つのtransactionで更新されるのは1つのAggregateにすべき
1つのtransactionで複数のAggregateを同時に更新すべきでない
そこで、今更新したい2つの間の操作を新しいAggregate(Entity)で表現できないか?を考える


例えば、2つのアカウントでお金を送金し合うものを考える際に
こういうAPIのやり取りをするのではなく、
aa
Strat transaction Add X amount to accountA Remove X amount from accountB Commit transaction
こういうEntityを新規に作る
hs
data MoneyTransfer = MoneyTransfer { Id: MoneyTransferId , ToAccount: AccountId , FromAccount: AccountId , Amount: Money }
こうすれば、1つのAggregateの中でのConsistencyの話として捉えられるので扱いは簡単になる




参考