Getting started
Nibble consists of three components:
​nibbledb - the database
​nibblegw - a gateway for scaling the database
​nibbleql - a REPL that provides an alternative to the Rest API for interacting with the database and gateway
All components run as Docker containers, therefore having this software installed is the only prerequisite for using the technology. Future work will make use of Kubernetes to help orchestrate the platform including how to restrict access to the database.
The tutorial will cover in more depth how to use Nibble but in its simplest form we can start a database as follows:
1
docker run -p 8000:8000 -it jptmoore/nibbledb
Copied!
we can POST and GET data from it using the Rest API as follows:
1
curl --request POST --data '[{"value": 1}, {"value": 2}, {"value": 3}]' http://localhost:8000/ts/foo
Copied!
In the above call we can see that we are posting some JSON values to a specific URL which has the format /ts/foo which means we are writing the values to a time series called foo.
1
curl http://localhost:8000/ts/foo/last/3
Copied!
The data returned from the above query looks like:
1
[
2
{
3
"timestamp": 1598973056750453,
4
"value": 3
5
},
6
{
7
"timestamp": 1598973056750444,
8
"value": 2
9
},
10
{
11
"timestamp": 1598973056750443,
12
"value": 1
13
}
14
]
Copied!
Note, that because we did not supply a timestamp with our values one was automatically generated to microsecond accuracy.
Last modified 1yr ago
Copy link