Git Product home page Git Product logo

synchronous-client-server-kvstore's Introduction

synchronous-client-server-kvstore

A single-threaded, persistent key/value store server and client with synchronous networking over a custom protocol.

Status

  • log crate & slog crate
  • kvs-client: lib + main : The kvs-client binary accepts the same command line arguments as in previous projects.
  • kvs-server: 重写参数解析器 : kvs-server has its own set of command line arguments to handle, as described previously in the spec.
    • kvsEngine tarit
  • protocol: pending design - 命令传输
    • part 3 Client-server networking
    • part 4 Implement command across the network
  • 日志打印
  • 可扩展存储引擎 KvsEngine, SledKvsEngine
  • benchmark 性能测试

kvs lib

https://github.com/pingcap/talent-plan/blob/master/courses/rust/projects/project-3/README.md#user-content-project-setup

  • KvsClient - implements the functionality required for kvs-client to speak to kvs-server
  • KvsServer - implements the functionality to serve responses to kvs-client from kvs-server
  • KvsEngine trait - defines the storage interface called by KvsServer
  • KvStore - implements by hand the `KvsEngine trait
  • SledKvsEngine - implements KvsEngine for the sled storage engine.

trait KvsEngine requeired methods

pub trait KvsEngine {
  KvsEngine::set(&mut self, key: String, value: String) -> Result<()>;
  KvsEngine::get(&mut self, key: String) -> Result<Option<String>>;
  KvsEngine::remove(&mut self, key: String) -> Result<()>;
}

synchronous-client-server-kvstore's People

Contributors

ariellink avatar

Stargazers

 avatar

Watchers

 avatar

synchronous-client-server-kvstore's Issues

Adding multithreading to `KvServer`

spawn all the work inside the loop into NaiveThreadPool. The database query and the response are both handled on a different thread than the TCP listener. This offloads most of the hard work to other threads, allowing the recieving thread to process more requests. It should increase throughput, at least on multi-core machines.

Implement ThreadPools

-NaiveThreadPool: this implementation is not going to reuse threads between jobs.
-SharedQueueThreadPool: Instead of creating a new thread for every multithreaded job to be performed, a thread pool maintains a "pool" of threads, and reuses those threads instead of creating a new one. If a thread in your pool panics, the thread dies and spawn another, panic will be catched and keep the existing thread running.
-RayonThreadPool: another threadpool implementation built by [rayon::ThreadPool]

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.