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 query methods to Store trait #48

Merged
merged 15 commits into from
Aug 27, 2024
Merged

Add query methods to Store trait #48

merged 15 commits into from
Aug 27, 2024

Conversation

sgwilym
Copy link
Contributor

@sgwilym sgwilym commented Aug 22, 2024

Adds query trait methods as detailed in #21 (comment):

  • query
    • query entry by pair of path and subspace id
      • yields Entry, AuthorisationToken, available payload prefix (length)
      • option to filter out results with incomplete payloads
    • query entries by area (of interest)
      • all of the functionality of singleton queries, also
      • ordering results (arbitrary, PTS (optionally reversed), TSP (optionally reversed), SPT (optionally reversed)) (?)
    • subscriptions: all queries should also work as long-lived subscriptions
      • this includes subscription to payload prefix appending
      • this also includes notifications about overwriting and forgetting things
    • persistent subscriptions
      • all subscription notifications come with a u64 progress id, client code can stop consuming a subscription at any time and can later (even between program shutdown and restart) resume it at the same point by supplying its progress id
      • this is a best-effort service, the storage may reject a resumption because it is too outdated
        • a simplistic implementation can effectively opt out of providing persistent subscriptions by simply considering all ids as outdated
      • forgetting entries/payloads can cause progress ids to become outdated, unless the storage tracks the things it forgot
        • this is why all forget functionality comes with a flag whether it should be completely traceless or whether the storage is allowed to track the act of forgetting

To be merged into #21

@sgwilym sgwilym added the enhancement New feature or request label Aug 22, 2024
data-model/src/lengthy_entry.rs Show resolved Hide resolved
data-model/src/store.rs Outdated Show resolved Hide resolved
data-model/src/store.rs Outdated Show resolved Hide resolved
data-model/src/store.rs Outdated Show resolved Hide resolved
@sgwilym sgwilym mentioned this pull request Aug 26, 2024
@sgwilym sgwilym requested a review from AljoschaMeyer August 27, 2024 13:16
Co-authored-by: Aljoscha Meyer <AljoschaMeyer@users.noreply.github.com>
@AljoschaMeyer
Copy link
Contributor

Lgtm now

@sgwilym sgwilym merged commit ade83c7 into store Aug 27, 2024
@sgwilym sgwilym deleted the store-trait-query branch August 27, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants