Crates.io | furdb |
lib.rs | furdb |
version | 0.1.2-alpha |
source | src |
created_at | 2022-09-04 04:34:31.275532 |
updated_at | 2024-04-13 00:12:04.914215 |
description | A minimal Database Management System that prioritizes storage space usage and fast lookup/query times. |
homepage | |
repository | https://github.com/madhavan-raja/furdb |
max_upload_size | |
id | 658128 |
size | 160,078 |
A minimal Database Management System that prioritizes storage space usage and fast lookup/query times. FurDB lets you specify the specific number of bits occupied by your data.
10011100 01010000
┌─┐┌───────┐┌───┐
^ ^ ^
d1 d2 d3
FurDB can be directly installed using cargo
.
cargo install furdb
You can clone this repository, build and run the program.
git clone https://github.com/madhavan-raja/furdb.git
cd ./furdb
cargo build --release
You can pull an image and run it in a container.
docker run --name furdb -d madhavanraja/furdb:latest
You can clone this repository, build and run the container using compose
.
git clone https://github.com/madhavan-raja/furdb.git
cd ./furdb
docker-compose up --build
You can use the image as a service in a compose
in another application.
version: "3"
services:
furdb:
image: madhavanraja/furdb:latest
environment:
WORKDIR: /furdb
PORT: 5678
restart: on-failure
The server can be accessed at http://furdb:{PORT}
.
If the executable is present in your PATH
, you can directly run the server.
furdb --workdir "/furdb" serve --port 5678
You can run the help
command to see all the available options.
furdb help
FurDB Server provides REST API endpoints for creating, reading, and deleting databases, tables, and entries.
Gets server information.
Endpoint
GET
/
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": {
"message": "Server is running",
"config": {
"workdir": "/furdb"
}
}
}
Create a database with ID my_database
.
Endpoint
POST
/my_database
Response
{
"result": "success",
"statusCode": 201,
"status": "Created",
"response": {
"databaseId": "my_database"
}
}
Get info of database with ID my_database
.
Endpoint
GET
/my_database
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": {
"databaseId": "my_database",
"databaseTables": []
}
}
Delete database with ID my_database
.
Endpoint
DELETE
/my_database
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": null
}
Creates a table with ID my_table
in the database with ID my_database
.
Endpoint
POST
/my_database/my_table
Request
{
"tableColumns": [
{
"size": 5
},
{
"size": 3
}
]
}
Response
{
"result": "success",
"statusCode": 201,
"status": "Created",
"response": {
"databaseId": "my_database",
"tableId": "my_table",
"tableColumns": [
{
"size": 5
},
{
"size": 3
}
]
}
}
Get info of table with ID my_table
in the database with ID my_database
.
Endpoint
GET
/my_database/my_table
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": {
"databaseId": "my_database",
"tableId": "my_table",
"tableColumns": [
{
"size": 5
},
{
"size": 3
}
]
}
}
Delete table with ID my_table
in the database with ID my_database
.
Endpoint
DELETE
/my_database/my_table
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": null
}
Insert entries into table with ID my_table
in the database with ID my_database
.
Endpoint
POST
/my_database_/my_table/data
Request
{
"data": [
[21, 0],
[17, 1],
[23, 2],
[9, 0],
[31, 1],
[0, 2]
]
}
Response
{
"result": "success",
"statusCode": 201,
"status": "Created",
"response": null
}
Get entries from table with ID my_table
in the database with ID my_database
.
Endpoint
GET
/my_database_/my_table/data
Request
{
"entries": "all"
}
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": {
"resultCount": 6,
"results": [
{
"index": 0,
"data": [21, 0]
},
{
"index": 1,
"data": [17, 1]
},
{
"index": 2,
"data": [23, 2]
},
{
"index": 3,
"data": [9, 0]
},
{
"index": 4,
"data": [31, 1]
},
{
"index": 5,
"data": [0, 2]
}
]
}
}
Request
{
"entries": {
"indices": [1, 3]
}
}
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": {
"resultCount": 2,
"results": [
{
"index": 1,
"data": [17, 1]
},
{
"index": 3,
"data": [9, 0]
}
]
}
}
Request
{
"entries": {
"value": {
"columnIndex": 0,
"value": 23
}
}
}
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": {
"resultCount": 1,
"results": [
{
"index": 2,
"data": [23, 2]
}
]
}
}
Delete entries from table with ID my_table
in the database with ID my_database
.
Endpoint
DELETE
/:database_id/:table_id/data
Request
{
"entries": "all"
}
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": null
}
Request
{
"entries": {
"indices": [1]
}
}
Response
{
"result": "success",
"statusCode": 200,
"status": "OK",
"response": null
}