Summary

This chapter introduced you to comfortable frameworks that greatly simplify the writing of microservices: Rouille, Nickel, and Rocket.

The Rouille framework is built around the router! macro and helps you to declare all the paths and methods you need in a simple way. The routing declaration looks similar to how we did it with Hyper, but much, much simpler.

The Nickel framework is also pretty simple to use and is inspired by the Express framework of JavaScript.

The Rocket framework is pretty cool and helps you to write a handler in an intuitive, clear style, but it needs the nightly version of the compiler.

The Gotham framework is an asynchronous framework that's based on the tokio and hyper crates. It allows you to use all of the benefits of asynchronous applications: handling thousands of requests in parallel and utilizing all resources completely. We created an example that works with a database by sending queries to it using the asynchronous tokio-postgres crate.

But there are many more frameworks and we can't cover all of them. Most frameworks are synchronous and are simple to use. If you want to write an asynchronous microservice, I recommend you use, in most cases, the actix-web crate, which we will explore in the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.180.43