/PNA

homeworks of Practical Networked Applications in Rust

Primary LanguageRustMIT LicenseMIT

Homework projects of PNA

CircleCI Status

This repository contains my homework projects of Practical Networked Applications(PNA) in Rust which is a part of PingCAP Talent Plan. The structures and test cases are adapted from PNA.

Project 1:

PNA doc|tag

Task: Create an in-memory key/value store that passes simple tests and responds to command-line arguments.

Goals:

  • Install the Rust compiler and tools
  • Learn the project structure used throughout this course
  • Use cargo init / run / test / clippy / fmt
  • Learn how to find and import crates from [crates.io][crates.io]
  • Define an appropriate data type for a key-value store
  • Limit the size of key up to 256B, the size of Value up to 4KB

Project 2:

PNA doc|tag

Task: Create a persistent key/value store that can be accessed from the command line.

Goals:

  • Handle and report errors robustly
  • Use serde for serialization
  • Write data to disk as a log using standard file APIs
  • Read the state of the key/value store from disk
  • Map in-memory key-indexes to on-disk values
  • Periodically compact the log to remove stale data

Project 3:

PNA doc|tag

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

Goals:

  • Create a client-server application
  • Write a custom protocol with std networking APIs
  • Introduce logging to the server
  • Implement pluggable backends with traits
  • Benchmark the hand-written backend against sled

Project 4:

PNA doc|tag

Task: Create a multithreaded, persistent key/value store server and client with synchronous networking over a custom protocol.

Goals:

  • Write a simple thread pool
  • Use channels for cross-thread communication
  • Share data structures with locks
  • Perform read operations without locks
  • Benchmark single-threaded vs multithreaded