I am modelling an archive which is part of an video demand system. Think of the archive like windows explorer where multiple users can create folders, upload videos, restructure folders etc. There are business rules (permissions) which determine if the user is allowed to do the task (i.e. rename folder, move folders, view folders etc).
I have modeled each folder as an aggregate root and moving one folder to another folder appears to affect two aggregate roots.
From what I understand is I should send an event to modify the other aggregate. However what concerns me is if the second folder has also been modified (say deleted or removed from the system) then I need to send a compensating command to undo the first aggregate change.
I would prefer some sort of transaction that deals with the move (change on both aggregates) together and if it fails then at least I do not need to undo the first part of the move or raise the first part of the event.
This leads me to, is CQRS right for the problem I am trying to solve? And if so could it be that my aggregates are wrong?