-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Distributed atomic counter support in JetStream KV #2656
Comments
The Slack thread describing the use case has been archived, but I hope that the use cases are still easy enough to imagine. I am currently doing this this by publishing +1s and -1s to a stream, then consuming that stream with another client that eventually puts the accumulated results into a kv store. It would be nice to skip that step. |
We continue to think through some of these patterns. For now, the client can read and update only if no updates got in between. If the update rate is high this might not be a good solution however. |
Is anyone still working/thinking about this? |
it's on the short term roadmap yes |
@ripienaar any chance this will be implemented in 2.11? |
I believe it's still the plan yes |
I have been checking for this in the 2.11 preview announcements but haven't seen it land yet. Could you let us know if this will be in 2.11 still? Thank you! |
Yes it will be. We are admittedly behind, but not for lack of effort and commitment, we just been helping out customers and partners. But it will be there. |
Any updates on this? Is this tight to a specific issue in the 2.11 milestone that we could track? |
No updates but still planned, just running a bit behind. |
Hello, Does anyone have found a workaround to wait this feature ? We can read the value then update with the incremented value, but I didn't find any transactional command that avoid missing an increment if 2 get values are done before any update (so only incremented by one instead of two). Thanks in advance, |
It will not be incremented by two because there is versioning |
@max13fr you can use |
Feature Request
Add Distributed Atomic Counter support to JetStream KV.
Use Case:
Slack thread
Proposed Change:
kv add
subcommand to specify whether the stream backing a bucket should be a file stream or a memory stream, e.g.:nats kv add my_bucket --replicas 1 --history 5 --STORAGE=FILE
nats kv add my_bucket --replicas 1 --history 5 --STORAGE=MEMORY
incrby x
, e.g.:nats kv INCRBY 20 my_bucket my_key_1
decrby x
, e.g.:nats kv DECRBY 10 my_bucket my_key_1
Who Benefits From The Change(s)?
Alternative Approaches
The text was updated successfully, but these errors were encountered: