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

Investigate usage of the remote field for vault metadata optimisation #309

Closed
joshuakarp opened this issue Dec 21, 2021 · 2 comments · Fixed by #266
Closed

Investigate usage of the remote field for vault metadata optimisation #309

joshuakarp opened this issue Dec 21, 2021 · 2 comments · Fixed by #266
Assignees
Labels
development Standard development r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management

Comments

@joshuakarp
Copy link
Contributor

Specification

VaultInternal currently has a remote boolean that indicates whether the vault has been cloned from some other node (i.e. it has an initial remote vault that it has been cloned from). This is also currently an indicator of whether a vault is immutable: cloned vaults are immutable. Previously, this information was stored solely in the metadata database, so any attempted commit to the vault would need to perform a database read to ensure that the vault was mutable.

There was previously some discussion on expanding this remote boolean to store some additional vault metadata for other optimisation purposes. We should keep this in mind for potential expansions to VaultInternal.

Additional context

Tasks

  1. ...
  2. ...
  3. ...
@CMCDragonkai
Copy link
Member

Properties like this can be read from the DB once at the beginning and then cached as an in-memory property for the lifetime of the object.

This is mainly because this doesn't change. If it did change, managing cache coherency becomes a problem. So it's usually better to just leave it in the DB as an SoT and read from it each time when needed. For example see how we have to deal with node id changes.

However DB reads is not a significant cost here. First we make it work (correct), then we can make it fast(er).

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Jan 20, 2022

So I think majority (all?) of vault metadata should be kept in the DB for now and we can figure out how best to optimise later.

@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management
3 participants