I would like to know how to handle the situations of error during event handler (which manage read side).
For example, the case where you check the uniqueness of user name. We suppose that there was no check on client side before saving aggregate. After aggregate commited, an event handler write to
the read-side in a mongodb collection (for example) the object, but an unique index exists on this collection, so mongodb throws an error. When error is thrown, we must launch a compensating command in order to cancel the previous command,
what are the best practices for this situation ?
Note : we suppose that environnement does not support transaction : Event Sourcing Aggregate and read side collections are both stored with MongoDB.