Building a synchronous redis server

To make this example short and easy to follow, our Redis clone will implement a very small subset of the RESP protocol and will be able to process only SET and GET calls. We'll use the official redis-cli that comes with the official Redis package to make queries against our server. To use the redis-cli, we can install Redis on Ubuntu by running apt-get install redis-server.

Let's create a new project by running cargo new rudis_sync and adding the following dependencies in our Cargo.toml file:

rudis_sync/Cargo.toml[dependencies]lazy_static = "1.2.0"resp = { git = "https://github.com/creativcoder/resp" }

We have named our project rudis_sync. We depend on two crates:

  • lazy_static: We'll use this to store ...

Get The Complete Rust Programming Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.