Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Interface-datastore compliance #40

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vaultec81
Copy link
Contributor

@vaultec81 vaultec81 commented Mar 21, 2020

What this PR adds

  • Query() method as diagrammed in interface-datastore
  • Batch() method as diagrammed in interface-datastore
  • Has() method as diagrammed in interface-datastore
  • Backwards compatible support for interface-datastore Key Object. (Open to additional discussion).

What this PR does not add

  • Async compliance
  • Method naming compliance (ex del)

Reasoning

Adding the query method is absolutely necessary for applications developers wanting to query key-values with or without a particular prefix. There is currently no API in kvstore that does anything similar. Discovering keys or routinely processing the entire store is not possible with the current API. However, there is an in memory index that can be queried no different than a normal javascript object. This works! But there is no guarantee that the same logic can be provided with different indexes down the road. Using a disk backed index cannot provide the same level of access for example.

I believe adding batch method is necessary for future changes. For example supporting modifying multiple key-value records inside a single oplog entry. Currently batch method commits modifications in multiple oplog entries, this is left open to future implementation modifications supporting multi key-value modification inside a single oplog entry.

By having a solid, well established common interface providing the same API level functionality regardless of implementation, I believe is key to long term utilization

I am open to further discussion on implementation, or alternative approaches.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant