#resp #protocols #implemented #in-memory #coding #research

bin+lib foobar_db

FoobarDB is an in-memory database implemented in Rust that supports the RESP protocol

1 unstable release

0.0.1 Nov 30, 2024

#24 in #resp

Download history 99/week @ 2024-11-25 25/week @ 2024-12-02 7/week @ 2024-12-09

131 downloads per month

MIT license

96KB
2K SLoC

███████╗ ██████╗  ██████╗ ██████╗  █████╗ ██████╗     ██████╗ ██████╗ 
██╔════╝██╔═══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗    ██╔══██╗██╔══██╗
█████╗  ██║   ██║██║   ██║██████╔╝███████║██████╔╝    ██║  ██║██████╔╝
██╔══╝  ██║   ██║██║   ██║██╔══██╗██╔══██║██╔══██╗    ██║  ██║██╔══██╗
██║     ╚██████╔╝╚██████╔╝██████╔╝██║  ██║██║  ██║    ██████╔╝██████╔╝
╚═╝      ╚═════╝  ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝    ╚═════╝ ╚═════╝ 

foobarDB

FoobarDB is an in-memory database implemented in Rust that supports the RESP V3 protocol. This project is for learning and research purposes. I aim to familiarize myself with Rust coding by implementing an in-memory database.

Features

  • Supports RESP protocol
  • Supports common Redis commands
  • High performance and low latency
  • Supports asynchronous operations

Prerequisites

  • Rust 1.82.0
  • Cargo package manager

Clone the repository

git clone https://github.com/yourusername/foobardb.git
cd foobardb

Build the project

cargo build --release

Usage

Start the server

cargo run --release --bin foobar_db

Client example

You can use any client that supports the RESP protocol to interact with FoobarDB. Here is a simple example using redis-cli to connect to FoobarDB:

redis-cli -h 127.0.0.1 -p 6379

In redis-cli, you can execute the following commands:

SET foo bar
GET foo
DEL foo

Contributing

We welcome contributions! Please follow these steps:

  1. Fork this repository
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

FoobarDB is licensed under the MIT License. For more information, please see the LICENSE file.

Authors

References

Dependencies

~11–21MB
~292K SLoC