Open olanod opened 1 year ago
I have experimented with a few keyvalue stores (dynamodb, redis, azure cosmos db) and they all seem to accept key as string
s. Could you please list a few use cases where the keys are non-strings? I am happy to change the key type
I'd use it for embedded use cases for example, sometimes directly store the bytes or abstract it to use data structures that are encoded automatically to an efficient representation.
Another challenge with byte sequences is that it's not possible to transcode plain bytes to key-value stores which use different character encodings. It looks to me like string
is a better fit for the use cases and implementations that originally motivated wasi-keyvalue.
What about supporting both with keys being something like an enum?
With an enum, using wasi-keyvalue with a backend that needs strings would have to always fail when given bytes.
Could you say more about your use case? What kinds of embedded programs would use an external key-value store? What backends would you expect to be used to implement the interface?
There are many use-cases that would benefit from having a key-value store where keys are not strings but opaque bytes, would there be a particular reason why the type
key
needs to bestring
?