Sign inSign up

fomalhaut88/lbasedb

By fomalhaut88

Updated 6 months ago

Image
0

575

fomalhaut88/lbasedb repository overview

lbasedb-api

REST API interface for Lbasedb DBMS.

Source code: https://github.com/fomalhaut88/lbasedb-api

About Lbasedb

lbasedb is a powerful low level DBMS that is focused on dataset structure. The algorithms are optimized for the compact data storage and for high performance on get and append operations. Particularly, due to this, deleting or indexing are not supported. The allowed data types are also limited (integers, floats and bytes) for making easy integration with C-like or similar common interfaces (like Python, CUDA, JSON and so on). The database has asynchronous access to the entities powered by tokio. It is supposed to be used for the data that have billions and more records and thousands columns of simple data types that must be appended without extra overhead.

Reference: http://crates.io/crates/lbasedb

Source code: https://github.com/fomalhaut88/lbasedb

Run in Docker

  1. Pull the docker image:
docker pull fomalhaut88/lbasedb
  1. Run the container:
docker run \
    -p 8080:8080 \
    --restart=always \
    --ulimit nofile=1024:1024 \
    --volume /var/lib/lbasedb:/app/db \
    --name lbasedb-app \
    --env WORKERS=16 \
    -d fomalhaut88/lbasedb

Notice, since Lbasedb keeps an open file for each column, you may need to
increase the maximum number of open files allowed (see ulimit for details), that is usually 1024 by default. In the example above, the limit is set to 1024 as default but it can be greater.

API description

PathMethodDescriptionParamsInput body exampleOutput body example
/versionGETVersion of API.0.1.7
/dataGETGet JSON dataset.feed: str - name of the feed
ix: int - start index
size: int - number of rows
col: [str] - names of columns
{"x": [2, 3]}
/dataPOSTPush JSON dataset into the end.feed: str - name of the feed{"x": [2, 3]}
/dataPUTUpdate JSON dataset from the index. Columns not listed will be zeroed.feed: str - name of the feed
ix: int - start index
{"x": [2, 3]}
/dataPATCHUpdate JSON dataset from the index. Columns not listed will stay the same.feed: str - name of the feed
ix: int - start index
{"x": [2, 3]}
/sizeGETGet size of the feed.feed: str - name of the feed{"size": 2}
/sizePUTResize the feed with all its columns. Last records will be removed or zero records appeared in the end.feed: str - name of the feed{"size": 2}
/rawGETGet raw bytes in the column.feed: str - name of the feed
ix: int - start index
size: int - number of units
col: str - name of columns
binary
/rawPOSTUpdate raw bytes in the column. It does not push new bytes, so for insertion do resize before.feed: str - name of the feed
ix: int - start index
col: str - name of columns
binary
/bytesGETGet bytes dataset.feed: str - name of the feed
ix: int - start index
size: int - number of rows
col: [str] - names of columns
binary
/bytesPOSTPush bytes dataset into the end.feed: str - name of the feed
col: [str] - names of columns
binary
/bytesPUTUpdate bytes dataset from the index. Columns not listed will be zeroed.feed: str - name of the feed
ix: int - start index
col: [str] - names of columns
binary
/bytesPATCHUpdate bytes dataset from the index. Columns not listed will stay the same.feed: str - name of the feed
ix: int - start index
col: [str] - names of columns
binary
/bytesDELETESet bytes to zero. Columns not listed will stay the same.feed: str - name of the feed
ix: int - start index
size: int - number of rows
col: [str] - names of columns
/feedGETList available feeds.[{"name": "xyz"}]
/feedPOSTAdd a new feed.{"name": "xyz"}
/feedPATCHRename the feed.name: str - name of the feed{"name": "xyz2"}
/feedDELETEDelete the feed.name: str - name of the feed
/colGETList available columns in the feed.feed: str - name of the feed[{"name": "y", "datatype": "Int64"}]
/colPOSTAdd a new column.feed: str - name of the feed{"name": "x", "datatype": "Int64"}
/colPATCHRename the column.feed: str - name of the feed
name: str - name of the column
{"name": "y"}
/colDELETEDelete the column.feed: str - name of the feed
name: str - name of the column

Bytes dataset is a concatenated arrays represented as bytes of each column listed in the request (in /bytes). The order of the columns is kept.

Environment variables

VariableDescriptionDefault
DATA_PATHPath to the directory for the data../tmp/db
WORKERSNumber of workers to process.1
HOSTHost to deploy.localhost
PORTPort to deploy.8080
PAYLOAD_LIMITMaximum payload size to request in bytes.1073741824 (or 1 GB)

Tag summary

Content type

Image

Digest

sha256:2ae624038

Size

472.8 MB

Last updated

6 months ago

docker pull fomalhaut88/lbasedb