-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add HA and read & write expectations from event stores #5
Conversation
Update expectations from event stores to require support for high availability scenarios, and at minimum require quorum writes, and causally consistent monotonic reads.
- support for high-availability scenarios | ||
- support for at least write quorums and causally consistent, monotonic reads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those must have or really , really nice to have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on perspective tbh. In production environment, such a setup can provide availability which is more that just nice to have; I am not aware of any server product that runs on a single instance of a database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm trying to say with the above is that this is a must-have guarantee from a database for a lot of services needing to store information. At the same time, it's not needed at all (it's not even a nice to have) for other (rarer ime) scenarios.
I'm happy to move that to bonuses if you prefer.
And I'm not sure what you mean by |
Let's assume event A happened and event A causes event B, and then event B causes event C. Then in a HA scenario:
In fact, thinking more about this, monotonic reads and causal consistency are a requirement (not just a nice to have) even outside the HA scenario. It's just very easy to guarantee, assuming that writes are written to disk before returning (so if it restarts monotonic reads will be guaranteed) However, write quorums only applies in the HA scenario of course (it doesn't apply if you have just one server) |
Thanks for the explanation,
|
Monotonic reads doesn't necessarily refer to events, but changes. I just gave the above as an example. The "essence" of monotonic reads is basically always seeing changes going forward in time, and you should never go into a global state which was previous compared to earlier reads. Let's see another example. Assume that two actions happened:
Monotonic reads would guarantee that in the absence of other changes, if a query read $40, and then a subsequent read would never get $10 because a node didn't get updated yet. This extends even to streams. Let's assume a stream
Then whatever event store instance we query the stream, a similar guarantee as the above example should be met. We should never get both events on a first query, with a second query returning just one event. Again, this is assuming an absence of changes. The above guarantee is important even in single-instance servers. If writes are not hard (don't get flushed to disk before an event append request returns), then a restart of the server at the right time (for example) could result to a loss of the event so subsequent requests wouldn't see the next event. Most often though this guarantee is important to server clusters where it applies to the runnign system. |
Update expectations from event stores to require support for high availability scenarios, and at minimum require quorum writes, and causally consistent monotonic reads.