WebAssembly / wasi-keyvalue

32 stars 11 forks source link

Portability of `list-keys` #47

Open lann opened 1 week ago

lann commented 1 week ago

I think we should consider moving list-keys into another/a new interface. Its doc comment already lists a number of caveats which reflect the underlying issue that this feature just isn't very portable.

/// MAY show an out-of-date list of keys if there are concurrent writes to the store.

I think this comment even undersells the problem somewhat; some KV stores (memcached, at least) can't even guarantee that you will see a key that wasn't updated during iteration.

Mossaka commented 15 hours ago

Thanks for raising this issue! I do want to revisit the list-keys API design, and as far as I know there isn't really a host implementation that uses the cursor field.

I know that list-keys is a common API for keyvalue stores and particularly useful for debugging purposes and for small datasets. Moving it to another interface sounds like a good idea to me.

wanna hear your thoughts on this @thomastaylor312