https://github.com/fillipehmeireles/ghost-db
Rust in-memory simple database
https://github.com/fillipehmeireles/ghost-db
database in-memory-database rust
Last synced: about 2 months ago
JSON representation
Rust in-memory simple database
- Host: GitHub
- URL: https://github.com/fillipehmeireles/ghost-db
- Owner: fillipehmeireles
- Created: 2022-06-17T12:53:23.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T23:42:11.000Z (almost 3 years ago)
- Last Synced: 2025-02-09T11:11:25.714Z (4 months ago)
- Topics: database, in-memory-database, rust
- Language: Rust
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GhostDB 👻
A simple in-memory key value database built with Rust :crab:
## Demo
[GhostDB Shell Demo](https://www.youtube.com/watch?v=gMNYyTpPHUc)
## Documentation
This project is a workspace built by two systems and a library.
The library is Ghost DB itself, responsible for managing data on disk. Both systems are responsible for using the library;
the Shell system is a CLI that provides an interface to connect and manipulate the database. On the other hand,
HTTP Server is an simple API to make possible an integration.## Installation
Installing GhostDB
```bash
cd ghost-db
mkdir .appData
cp .env.example .env
make workspace-build
```
## Roadmap- GhostDB Library
- CLI
- API
## Tech Stack
**Library:** Rust - Darkbird
**HTTP Server:** Rust Rocket
**Shell:** Rust
## Lessons Learned
- Improving Rust skills
- Persistent data storage comprehension
- Improving data structures comprehension
- Improving Rust Rocket comprehension## HTTP API Reference
#### Get all keys
```http
GET /get-all
```#### Get key
```http
GET /get-one/${key}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `key` | `string` | **Required**. Key of item to fetch |#### Create data
```http
POST /insert/
```| Body | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `key` | `string` | **Required**. Data key |
| `value` | `string` | **Required**. Data value |#### Update data
```http
PUT /update/${key}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `key` | `string` | **Required**. Key of item to update |#### Update data
```http
DELETE /delete/${key}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `key` | `string` | **Required**. Key of item to delete |## Environment Variables
To run this project, you will need to add the following environment variable to your .env file
`STORAGE_NAME`