forked from mikegore1000/SimpleEventStore
-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
When writing streams, we currently do no checks to determine if an event already exists in a stream. This means the application logic has to implement this functionality which generally ends up as lots of boilerplate code.
The way we can improve this is to allow writes to have an idempotent check to determine if the write has already occurred and ignore it if it has. The current thinking for how to do this is
- For writes with a single event, query the stream for an event with matching id and ignore it
- For writes with multiple events, query the stream based only on the 1st event. The benefits of doing it this way are that it'll reduce RU consumption, plus if the write is truly idempotent all the other events should be the same.
- Make the option configurable so people can opt-in/out to the check. Current thinking is the feature should be off by default as it'll increase RU consumption.
Clients would have to use deterministic GUIDs when appending events to the stream, otherwise the check would never work.