Skip to content

KV Secondary Indexes can reference Primary Keys #139

Open
@mgenereu

Description

@mgenereu

The current documentation recommends double storing the value of a KvEntry on the creation of a secondary index. Double storing values requires significant storage and significant effort from the developer to ensure synchronization of all values on all updates. While researching other Deno Deploy documentation, I came across this Denoland blog entry by @lambtron and it makes a completely different recommendation of storing the primary key as the value instead of the actual value. While there's still some onius on the developer to maintain the integrity of the secondary index and using the secondary index is a double lookup, there's no longer multiple copies of the data being stored or multiple transactions when the secondary index is unchanged. I would like to recommend the current documentation be updated to use primary keys for secondary indices or at least make the suggestion as an exercise for the reader to research. Please let me know how I can help if either suggestion is determined to have value.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions