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

add KV transaction interfaces and new transaction wrapping key-value store #4

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

jessepeterson
Copy link
Member

Add Go interfaces for beginning, committing, and rolling back transactions on key-value stores.

The included KV stores (kvmap and kvdiskv) do not support transactions. So we also add a KV store wrapper that supports in-memory staged-write non-atomic transactions with this PR. This allows us to wrap any existing KV store that may not support transactions to add some support. Unfortunately as it layers over non-transaction stores we can't actually guarantee atomicity for multiple staged write operations (that is: a transaction may end-up only being partially committed). Even so this allows us to get some of the benefit of transactions (largely discard/roll back support) but more importantly to use the same interfaces for real transaction-supporting KV stores that can plug into the interfaces.

@jessepeterson jessepeterson merged commit b79e666 into micromdm:main Sep 10, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant