2 releases

0.0.1-alpha1 Jan 8, 2025
0.0.0 Jan 8, 2025

#1198 in Database interfaces

Download history 2/week @ 2024-10-09 3/week @ 2024-10-16 2/week @ 2024-10-30 1/week @ 2024-11-06 239/week @ 2025-01-08

239 downloads per month

Apache-2.0

9KB
149 lines

Crystal - A Simple Key-Value Store

Crystal is a simple, persistent key-value store implemented in Rust with a REPL interface.

Features

  • Persistent key-value storage
  • Simple CRUD operations
  • REPL interface for interactive use
  • Binary serialization using bincode
  • Command history persistence

Installation

  1. Ensure you have Rust installed (https://www.rust-lang.org/)
  2. Clone this repository
  3. Build the project:
    cargo build --release
    

Usage

Start the REPL:

cargo run --features repl

Example Session

crystal> set name Alice
crystal> get name
Alice
crystal> rm name
crystal> get name
Key not found
crystal> exit

Commands

  • set [key] [value] - Store a key-value pair
  • get [key] - Retrieve a value by key
  • rm [key] - Remove a key-value pair
  • exit - Exit the REPL

Data Storage

Data is stored in binary format in the ./data directory. Command history is stored in history.txt.

License

Apache 2.0 - See LICENSE for details.

Dependencies

~0.6–2MB
~40K SLoC