Re:Event Sourcing Is Hard (2019)
by randolorian on Tuesday November 30, 2021 @07:39AM
(#29391480)
Seems like a fundamental misunderstanding to me. Commands get validated via your aggregate, not events. Events are not allowed to be rejected. Ever. Because they already happened.
[ Parent
| on HN ]
Re:Event Sourcing Is Hard (2019)
by EdwardDiego on Tuesday November 30, 2021 @07:46AM
(#29391525)
Thinking that event sourcing and CQRS are synonyms is a fundamental misunderstanding also.
Anyway, pedantry aside, my point remains thus - it's hard to prevent invalid state transitions being submitted to an event sourcing datastore, and when devs can submit events directly, then these invalid transitions will occur.
Re:Event Sourcing Is Hard (2019)
by randolorian on Tuesday November 30, 2021 @08:06AM
(#29391670)
> Thinking that event sourcing and CQRS are synonyms is a fundamental misunderstanding also.
Indeed. These are two separate patterns. They can have great synergy when used together but it's not a requirement.
> it's hard to prevent invalid state transitions being submitted to an event sourcing datastore
Apply DDD, use code review, and use stream level ACLs.