In the previous chapters, we built a web service and a web application using Rust. We’ve used the Actix Web framework to handle the network communications, mostly submitting HTTP requests to the Actix web server from a single browser window or a command-line terminal. But have you thought about what happens when tens or hundreds of users send requests concurrently to register tutors or courses? Or, more broadly, how modern web servers handle tens of thousands of concurrent requests? Read on to find out.
In this part of the book, we will put our EzyTutors web application aside for a while so we can focus on the fascinating aspects of Rust that allow us to implement efficient, state-of-the-art services. We will come back to EzyTutors at the end of the book, where you’ll see how to deploy it in an efficient and flexible way.
In this chapter, we will thus take a detour from our web application and look under the hood to understand what asynchronous Rust is, why we might need to use it, and how it works in practice. By the end of this chapter, you’ll have a better understanding of the magic that Actix (and other modern web frameworks) perform to handle heavy concurrent loads while delivering swift responses to user requests.