I’m trying to get used to hexagonal architecture and understand how to implement practical problems. I’m having difficulty understanding the level of responsibility extracted to adapters and ports.
As an example, I’m looking into storage and transaction pairs. How should transactions be implemented in hexagonal architecture? Assume we have a simple CRUD service interface inside the domain level:
StorageRepoInterface
save(...)
update(...)
delete(...)
get(...)
We want to guarantee transactions when using these methods, e.g. delete+save in one transaction. How should this be designed and implemented according to hexagonal architecture?
Should a TransactionalOperation interface be implemented with external coordination? If so, does this interface need to know how to implement transactions with all implementations of StorageRepoInterface?
Alternatively, should explicit transaction guarantees be provided from StorageRepoInterface inside the domain level?
Where can I find more information on how to approach this problem correctly?