Giter Site home page Giter Site logo

mini-redis-rust's Introduction

Mini Redis Client and Server

Introduction

This project is the learning journey into the Rust programming language, focusing on asynchronous programming and network programming. With the interest in understanding the internals of how high-performance networked applications work, I have built a mini Redis client and server based on the tokio mini-redis repository and this tokio tutorial. Through this project, leveraging the Tokio runtime, I've explored the complexities of network programming, and async programming paradigms that power modern IO-heavy applications.

Project Overview

The Mini Redis Client and Server project is an application designed to mimic the basic functionalities of Redis, a popular in-memory data store, using Rust and the Tokio framework for asynchronous IO operations. This implementation focuses on key features of Redis, such as set and get commands. The publisher-subscriber feature is in the works.

Architecture of the mini Redis application: Alt text

A closer look at the sharded database/ key-value store: Alt text

Features

  • Async/Await Syntax: Utilizes Rust's async/await syntax for non-blocking network IO operations.
  • Basic Redis Commands: Supports basic commands like SET and GET, allowing for simple key-value storage functionality.
  • Tokio Runtime: Built on top of Tokio, a powerful async runtime for Rust, enabling scalable network applications.

Getting Started

Prerequisites

Ensure you have Rust and Cargo installed on your machine. This project uses Rust v1.76.0.

Installation

  1. Clone the repository:
git clone https://github.com/kabilanmohanraj/mini-redis-rust.git
  1. Navigate into the project directory:
cd mini-redis-rust/mini-redis
  1. Build the project:
cargo build --release

Running the Server

Run the server using Cargo:

cargo run --bin server

Running the Client

In a separate terminal, use the client to connect to the server and execute commands:

cargo run --bin client-cli set mykey myvalue
cargo run --bin client-cli get mykey

To script a client (for custom post-processing) and execute commands, use this command

cargo run --bin client

Learning Outcomes

  • Rust Programming: Gained hands-on experience with Rust, focusing on its safety features and concurrency model.
  • Asynchronous Programming: Explored async programming principles and patterns, understanding how to write non-blocking code using async/await, handling I/O as resources.
  • Network Programming: Delved into the basics of network programming, learning about sockets, TCP/IP, and building networked services with Tokio.

Future Work

  • Command Expansion: Adding support for more Redis commands to enhance the functionality of the mini Redis server, starting with PUBLISH and SUBSCRIBE.
  • Load Balancer: Implementing a client-side load balancer to enable a pool of clients to interact with a pool of clerks.
  • Authentication and Security: Implementing basic security features, such as client authentication and encrypted communication.
  • Database Replication and Persistence: Implementing a Redis cluster deployment, supporting asynchronous data replication and tunable persistence options.
  • Performance Optimization: Investigating opportunities for performance improvements and optimizations in the client-server communication.

mini-redis-rust's People

Contributors

kabilanmohanraj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.