Open ndragazis opened 1 week ago
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:
v2/keys/<key>
Query of a single key, returning its value:
v2/keys/<key>
{
"action": "get",
"node": {
"createdIndex": 2,
"key": "/message",
"modifiedIndex": 2,
"value": "Hello world"
}
}
Delete a single key (and its associated value):
v2/keys/<key>
List all keys under a directory:
v2/keys/
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.
Copying API requirements from #1:
Other kv stores to consult: