Web-based Service in Rust
Rust Is the Foundation for Fast and Reliable Web Services
Rust is an excellent programming language developing web applications and web services. As a result, you can create services that are fast, reliable, and cost-effective. In fact, using Rust to write services can tremendously reduce your operating costs. However, the main challenge is knowing where to start. This workshop aims to guide you through the process of building web services using the ecosystem around the Tokio async runtime. You will learn how to make basic API calls, create advanced middleware layers to add functionality, and conduct tracing and testing. Join us for three afternoons to acquire all the necessary skills to produce your own Rust-based web apps.
This workshop is intended for developers who have some experience with Rust and want to learn more about its problem domain for web applications. It is not necessary to have written Rust in a production environment yet. If you are just starting out with Rust, we will provide you with preparatory material beforehand.
The workshop will be held over three afternoons, and each session will include practical examples. In addition, we will provide optional homework for you to work on.
We will send a detailed list of instructions for preparation, including the installation of compiler toolchains, editors, and recommended plugins. We also send out material to get you familiar with Rust basics if you haven't written any Rust before. Additionally, we will share a Github project with workshop materials. This information will be provided closer to the workshop date.
Workshop Overview - Part 1
Tokio, Hyper & Axum
We will begin by setting up a web server for our web application using the Axum framework, which is built on top of Tokio and Hyper. We will learn about the FromRequest and IntoResponse traits, Extractors, Routers, and how to connect JSON serialization and deserialization. If time permits, we will also create a web socket connection for our clients.
Workshop Overview - Part 2
Tower & Middlewares
We will expand our application by creating middleware layers that handle crucial aspects such as sessions, authentication, timeouts, and compression. We will not only apply built-in middlewares but also create our own by implementing Tower's Service trait and learning more about futures and async.
Workshop Overview - Part 3
Tracing, Logging & Testing
In the final part, we will examine how to gain insights into our application's behavior and perform performance and correctness tests. Ultimately, we will be able to publish our application on AWS, Shuttle, and other services.