ndragazis / tinykv

Simple key value store based on Seastar
Apache License 2.0
0 stars 0 forks source link

[api] Design the REST API #2

Open ndragazis opened 1 week ago

ndragazis commented 1 week ago

Copying API requirements from #1:

Other kv stores to consult:

ndragazis commented 1 week ago

Etcd REST API

Etcd is a key-value store that used to have a REST API in v2. Let's explore its API. doc: https://etcd.io/docs/v2.3/api/


Insert / update of a single key/value pair:

Query of a single key, returning its value:

Delete a single key (and its associated value):

List all keys under a directory:

ndragazis commented 7 hours ago

If we pass keys as path-based parameters like etcd, we need to consider URL size limitations.

Browsers typically support URLs with up to 2048 characters. Also URLs support only ASCII characters, so if keys have a UTF-8 encoding, they have to be URL-encoded, which would consume more bytes.

All things considered, we are probably safe with a 255-byte limit on the keys.