Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent overwriting events when persisting #64

Open
Fours opened this issue Aug 21, 2017 · 2 comments
Open

Prevent overwriting events when persisting #64

Fours opened this issue Aug 21, 2017 · 2 comments

Comments

@Fours
Copy link
Contributor

Fours commented Aug 21, 2017

Could use a condition expression to stop an overwrite and instead return a rejection: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html

This would be helpful in the exceptional scenario of two persistent actors running with the same persistence id, trying to save an event with the same seqNum - I would rather one fail to persist than overwrite an existing item.

Thoughts?

@mallize
Copy link

mallize commented Aug 21, 2017

Agreed. I would never want to overwrite an event. Should this end up with a call to onPersistFailure which would allow the developer to decide how to handle this?

@calvinlfer
Copy link
Contributor

+1
This would help detect split brain scenarios and prevent corruption of your data where you use Akka Cluster Sharding and the constraint of having only a single Persistent Actor with a given ID X within a cluster is violated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants