facebook / akd

An implementation of an auditable key directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If the user's value is identical to the most recent value, skip publishing that user's key value.

slawlor opened this issue · comments

In some cases, there may be a concurrency consideration gathering keys together to form a batch publish. This is especially true if some kind of queueing mechanism is necessary to gather a large batch of changes and periodically publish an epoch.

In this scenario, publication of an epoch may not be performant on a user-by-user key change basis as the cost of doing a tree-walk in the storage layer is non-trivial. In a batch scenario, we can do a breadth first search to gather all the nodes that we'll touch in an epoch publication, so it's far more performance at scale. However this gathering of batches may have some concurrency considerations where we may reprocess keys (in some odd failure scenarios).

Therefore as a minor protection against this scenario, we should add the ability to determine if the key value is the same as the most recent value, and skip publication in this scenario.

@afterdusk as a note, this will break the storage trait as the signature on the versions query now needs to return the highest version as WELL as the latest plaintext_val