-
-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hi,
First, thanks for creating SierraDB. It’s a very promising project and I’m looking forward to working with it.
I have a feature request: an option to require strict optimistic concurrency for EAPPEND. This means disallowing EXPECTED_VERSION ANY, disallowing EXPECTED_VERSION exists and rejecting appends that omit EXPECTED_VERSION entirely.
Reason
In systems that rely on strict event-sourcing semantics, every append should use an explicit expected version tied to the decision the writer made. Allowing ANY or exists makes it possible for developers or services to bypass concurrency checks, which can lead to subtle issues in multi-writer scenarios (commands being applied based on stale state without any error).
It would be very helpful if the server could enforce this rule rather than relying only on client-side discipline.
Desired behavior
When this option is enabled:
-
EAPPEND ... EXPECTED_VERSION ANYis rejected. -
EAPPEND ... EXPECTED_VERSION existsis rejected. -
EAPPENDwithout anEXPECTED_VERSIONis rejected. -
Only the following are accepted:
EXPECTED_VERSION empty(for creating a new stream).EXPECTED_VERSION <integer>(for appending to an existing stream).
This would make concurrency guarantees explicit and enforceable at the server level.
Thanks again for the project.