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

Better explain what we mean by 'changes' in durable state queries #613

Open
octonato opened this issue Nov 8, 2021 · 0 comments
Open

Better explain what we mean by 'changes' in durable state queries #613

octonato opened this issue Nov 8, 2021 · 0 comments

Comments

@octonato
Copy link
Member

octonato commented Nov 8, 2021

As suggested by @pawelkaczor in
f3942ec#r59589841

To shortly describe that we mean by 'changes':

Durable state replaces the previous state each time and it's not cumulative as in append-only event journal.

When querying for the changes, the user gets all states that have been updated after a given offset.

If in time 1 we have:

id offset state
123 1 abc
456 2 def

If we request the changes starting from offset 1, we will get (123, 1, "abc") and (456, 2, "def")

If we update 123, to 'aabbcc', we will have:

id offset state
456 2 def
123 3 aabbcc

Update it once again to 'abcabc' and we will have:

id offset state
456 2 def
123 4 abcabc

If we run the same query (assuming that we pass offset 1 as param. ), we will have: (456, 2, "def") and (123, 4, "abcabc").

Note that offset 1 and 3 are gone as well as its state. In the case of offset 3, its state is never delivered since no intermediate query was issued.

So basically the query returns the latest known state for each record with an offset equal or greater than the offset param.

@octonato octonato changed the title Better explain we mean by 'changes' in durable state Better explain what we mean by 'changes' in durable state Nov 8, 2021
@octonato octonato changed the title Better explain what we mean by 'changes' in durable state Better explain what we mean by 'changes' in durable state queries Nov 8, 2021
octonato referenced this issue Nov 8, 2021
* Initial version of durable state plugin docs

* Changed Optional#isEmpty since it's not there in JDK 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant