Skip to content

sahariardev/Stashy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stashy

Stashy is a simple, persistent key-value store server built with Rust. It's designed to be a lightweight and easy-to-use database for your projects.


Features

  • Simple Command Interface

Interact with the server using straightforward GET, SET, and DELETE commands.

  • Data Persistence

Data is saved to a data.json file to ensure nothing is lost when the server shuts down.

  • Asynchronous I/O

Built with tokio for efficient, non-blocking network communication.


Getting Started

Prerequisites

  • Rust programming language and Cargo package manager

Install Rust

Building and Running

# Clone the repository
git  clone  https://github.com/sahariardev/stashy.git 

# Navigate to the project directory
cd  stashy

# Build and run the server
cargo  run

The server will start and listen on 127.0.0.1:6379


Usage

You can interact with the server using a TCP client like netcat or telnet.

Commands

SET

  • SET <key> <value>: Stores a value for a given key.

  • Example: SET name Stashy

  • Returns: OK

GET

  • GET <key>: Retrieves the value for a given key.

  • Example: GET name

  • Returns: The value if the key exists, otherwise "Error Key not found".

DELETE

  • DELETE <key>: Deletes a key-value pair.

  • Example: DELETE name

  • Returns: Ok if the key was deleted, "Key not found" if the key didn't exist.

Dependencies

  • tokio: An asynchronous runtime for the Rust programming language.

  • serde: A framework for serializing and deserializing Rust data structures efficiently and generically.

  • serde_json: A JSON serialization library for Serde.

  • anyhow: A library for flexible error handling.

License

This project is not licensed. Consider adding a LICENSE file to let others know how they can use your code. The MIT License is a popular choice for open-source projects.

About

A Simple Key Value Storage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages