Yes! And it’s freaking fast!
Can I replace my Rails/Django/Flask already?
Rust has mature and production ready frameworks in Actix Web and
Rocket, and newer ones like Warp
and Tide. These provide everything you’d expect from a web framework, from routing
and middleware, to templating, and JSON/form handling. There are crates for everything, and more! For databases, there’s:
- Diesel, a full-fledged ORM.
- sqlx, the async sql toolkit.
- As well as native drivers for MongoDB, SQlite, Postgres, and MySQL.
There are many integrations to third-party services
, such as:
And of course, there is plenty of support for basic web needs, like logging
While development might not be as smooth as something like Rails or Django, the Rust web development ecosystem and
community is engaged and very helpful. A lot of work has been put into the web in the past few years, and we’re getting
Rust can even run on the browser, by compiling to WebAssembly
. This means that you can take advantage of the amazing Rust ecosystem on the browser! Rust and
some awesome Rust and WebAssembly projects out there. For example, Yew and Seed let you create
front-end web apps with Rust in a way that feels almost like React.js.
For more information about Rust and WebAssembly, check out the Rust and WebAssembly Book.
After you’ve set up your Rust and worked yourself through “The Book”,
you might want to check any of these resources:
- Building web apps with Rust using the
Rust Live Coding – Web App From Scratch
- Actix-Web Auth
- Practical Rust Web Development
- Build an API in
Rust with JWT Authentication
- Rocket Quickstart
There are also some real world examples that can be looked at for reference:
- Plume, a Federated blogging app (Rocket)
- Yew realworld app (WebAssembly)
- Seed realworld app (WebAssembly)
- Lemmy, a federated alternative to Reddit (actix-web)
- Rust + Rocket RealWorld example
If you find yourself stuck and looking for help, you can check out the official Rust forum, the rust tag on stackoverflow, or the Rust Discord server where you are welcome to post your questions and
will find excellent help.
Learn more about the state of web development in Rust by topic:
- Async I/O
- Binary protocols
- Compression Libs
- En- & Decoding
- Web Frameworks
- HTTP Clients
- Lower Web-Stack
- External Services
- Web Utils
- WebAssembly Runtimes
- External Web APIs
: everything is awesome™: stable, tested and mature
: stuff’s pretty great
: getting there, stable but still maturing
: not yet stable, but progressing
: unstable/incomplete, needs work
: barely there, needs serious work
: basically nonexistent