Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pumpum7/rust-database
A simple database system with client-server architecture in rust
https://github.com/pumpum7/rust-database
database rust
Last synced: about 1 month ago
JSON representation
A simple database system with client-server architecture in rust
- Host: GitHub
- URL: https://github.com/pumpum7/rust-database
- Owner: PumPum7
- Created: 2024-10-25T14:07:22.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-27T10:16:45.000Z (3 months ago)
- Last Synced: 2024-10-28T02:51:48.150Z (3 months ago)
- Topics: database, rust
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Database Project
This project implements a simple database system with a client-server architecture.
## Features
- TCP-based client-server communication
- Interactive command-line interface for the client
- Basic key-value store operations (GET, SET, UPDATE, DEL)
- B-tree index for efficient data storage and retrieval## Project Structure
- `backend/`: Contains the database server implementation
- `database-client/`: Contains the client implementation## Getting Started
1. Clone the repository
2. Run `cargo build` to compile the project
3. Start the server with `cargo run`
4. Run the client with `cargo run --bin client`## Usage
Once connected to the database, you can use the following commands:
- `GET `: Retrieve the value associated with the given key
- `SET `: Set a key-value pair (also supports operations like +, -, ...)
- `UPDATE `: Update an existing key-value pair
- `DEL `: Delete a key-value pair
- `STRLEN `: Get the length of the value associated with the given key
- `STRCAT `: Concatenate the values of two keys and store the result in a third key
- `SUBSTR `: Get a substring of the value associated with the given key
- `exit`: Quit the client
- `help`: Display available commands### Expression Examples:
- `EXPR(GET 1 + GET 2)`: Retrieve the value associated with key 1 and key 2, then add them together.
- `EXPR(GET 1 * 2)`: Retrieve the value associated with key 1 and multiply it by 2.Use TAB for command completion in the client interface.
## Future Improvements
- Improve error handling and logging
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.