Simple TODO Service With Actix (Rust): Part 1
See the first video in a series about Actix (Rust).
Join the DZone community and get the full member experience.Join For Free
What Is Actix?
Actix is a powerful Actor system for the rust programming language. Actix web is a web framework built on top of Actix.
Actix aims to be:
- Type-Safe: Since everything has "types"
- Feature-rich: By providing a lot of features out of the box
- Extensible and blazingly fast
Just take a look at Tech Empower's benchmarks. Actix is taking the first 2 places, and there is a big gap with the next in the rank!
But Why Rust?
Rust is also blazingly fast and memory-efficient, without sacrificing safety. It can eliminate many classes of bugs at compile time and has great tooling!
From the documentation, "An application developed with Actix web will expose an HTTP server contained within a native executable. You can either put this behind another HTTP server like nginx or serve it up as-is. Even in the complete absence of another HTTP server Actix web is powerful enough to provide HTTP 1 and HTTP 2 support as well as SSL/TLS. This makes it useful for building small services ready for distribution."
You might also like: Automate Task Creation With the TODO Bot
The following video series aims to give other developers a feeling of how it is to develop in this platform coming from a different programming language, by creating a simple TODO service.
This is not a total beginner tutorial, you must already be familiar with at least one programming language.
I'm coming from Java, Scala, and C/C++, and I must say it, Rust is a huge improvement over C/C++ and it was easy to pick up, as advertised.
Full source code can be found: https://github.com/nemesiscodex/actix-todo
Part 1 Content:
- What is Actix and Rust?
- Installing Rust and creating a project
- Creating the first service with Actix
- Serializing data with Serde
In Part 2, we will separate the configuration from the code, set up a database connection, and create the models for the TODO service.
Opinions expressed by DZone contributors are their own.