-
Notifications
You must be signed in to change notification settings - Fork 8
NATS Store Wrapper #12
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Daan Gerits <[email protected]>
Signed-off-by: Daan Gerits <[email protected]>
Signed-off-by: Daan Gerits <[email protected]>
Signed-off-by: Daan Gerits <[email protected]>
Signed-off-by: Daan Gerits <[email protected]>
We should not be exposing non KV operations
The abstractions are there for a reason, doing this is inherently incompatible with a lot of what KV is. Soon with TTL+Purge there will be a safe way to clear out keys for good. |
Signed-off-by: Daan Gerits <[email protected]>
I am also reluctant to ship - by us - a competing codec implementation |
makes sense. Will remove the purge option. |
I couldn't find any reference to the current codec implementation, but happy to replace what is in here with what the standard should be. |
Cc @Jarema about codecs. I have some reservations about the general approach for us - saying a simplification is needed for our KV (already a simplification) is maybe not the message we want to send. We should have a chat about a more KV like way to achieve what this achieves |
Abstract
Wouldn't it be great if it was easier to use a KV in our applications? To be able to apply changes without having to deal with retrying logic when concurrent changes happen? To have entries securely read and written from the KV bucket? Well, that's what this PR is all about.
I found myself reimplementing this in a lot of projects and think it might be a valuable addition to Orbit. It wraps a KV bucket and the corresponding Stream in a
Store
and allows straightforward operations on it. Changes to the store are done through anApply()
function which takes aModifier
. This modifier can be executed multiple times if a record is updated between reading the entry and writing the updated data.The
Purge()
function is an addition to the store to perform a deep-remove of a key from the underlying stream.