KvStore API
API Reference
All Alphaus clients have free access to the free-tier version of our KvStore, a highly-available, distributed key/value store that is easily accessible using curl
, or bluectl
, or using any of the gRPC-supported programming languages. All data are encrypted in transit and at rest so you can use this as a general purpose key/value database even in your production workloads.
The free version is limited to a regional store closest to you where data is replicated across three zones. If you want to have access to an unlimited, enterprise-grade version, either regional, multi-region, or even a globally-distributed version (data is replicated across multiple regions across multiple continents), please contact our Sales/Support team.
Limits
- Total data size (free tier) - around ~100MB
- Maximum key size - 7KB
- Maximum value size - 10MB
Examples
Let's use bluectl
to demonstrate how to use KvStore. To write a single key/value:
# key=hello, value=world
$ bluectl kv write hello world
# If value has spaces, enclose with double-quotes (") or single-quotes (')
$ bluectl kv write space "this value has spaces"
To read the key/value:
# Read key=hello, '--bare' for clean output
$ bluectl kv read hello --bare
world
You can also write file contents as value:
# Here's a sample file with JSON contents
$ cat /tmp/test.json
{
"title":"JP text",
"message":"日本"
}
# Write the key/value from file, key=json
$ bluectl kv write json --from-file=/tmp/test.json
# Let's try reading the "message" section using jq
$ bluectl kv read json --bare | jq -r .message
日本
You can also scan multiple keys:
# Read all keys
$ bluectl kv scan --outfmt=json
{"key":"hello","value":"world"}
{"key":"json","value":"{\n \"title\":\"JP text\",\n \"message\":\"日本\"\n}"}
{"key":"space","value":"this value has spaces"}
# Or just some keys using SQL's LIKE operator
$ bluectl kv scan '%ell%'
KEY VALUE
hello world