A comparison of some web frameworks written in Rust.
There are several interesting frameworks to build web applications with Rust:
- actix-web (- / repository / api docs / user guide)
- gotham (homepage / repository / documentation / examples)
- iron (homepage / repository / documentation) - deprecated
- rocket (homepage / repository / documentation)
- nickel (homepage / repository / documentation)
- rustful ( - / repository / documentation)
- rustless (- / repository / - )
- conduit ( - / repository / - )
- rouille ( - / repository / documentation)
- pencil ( - / repository / documentation)
- sappers ( - / repository / - )
- boron ( - / repository / - )
- cargonaouts (homepage / repository / - )
- susanoo (- / repository / - )
- shio (- / repository / - )
- fanta (- / repository / - )
- Thruster (- / repository / - )
If you need a more low level control you can choose between these libraries:
- hyper (homepage / repository / documentation)
- tiny-http ( - / repository) / documentation)
- solicit ( - / repository / documentation)
- kinglet ( - / repository / - )
- hydrogen ( - / repository / documentation)
- civet ( - / repository / - )
- tk-http ( - / repository / - )
- h2 ( - / repository / - )
To build web clients with Rust, you can choose between these libraries:
- actix-web (- / repository / api docs)
- reqwest (- / repository / documentation)
- hyper (homepage / repository / documentation)
- ease (- / repository / documentation)
- jsonrpc (- / repository / documentation)
- websocket (homepage / repository / documentation)
- ws-rs (homepage / repository / documentation)
- tungstenite (- / repository / documentation)
- tk-http ( - / repository / - )
- actix-web ( - / repository / documentation)
- tera (- / repository / - )
- mustache (- / repository / documentation)
- liquid (- / repository / - )
- handlebars (- / repository / - )
- horrorshow (- / repository / documentation)
- maud (homepage / repository / documentation)
- askama (- / repository / - )
- stpl (- / repository / - )
- ructe (- / repository / documentation )
- Wicked Fast Web Servers in Rust
- Migrating to Actix Web from Rocket for Stability
- Creating a Rusty Rocket fuelled with Diesel
- Dose Response ported to WebAssembly!
- Rust and the case for WebAssembly in 2018
- wasm32-unknown-unknown landed & enabled
- How to Deploy a Rocket Application to Heroku
- Rust to WebAssembly, Made Easy
- Rust for the web
- Rocket on Fedora
- Announcing Gotham - A flexible web framework for stable Rust that does not sacrifice safety, security or speed.
- Announcing cargonauts - A Rust async web framework
- Writing a GitHub webhook with Rust! Part 1: Rocket
- Hello, Botket! (Rocket)
- Launching a URL Shortener in Rust using Rocket
- Rocket + sodiumoxide = ♥
- The Path to Rust on the Web
- Rendering Vector Map Tiles (Rust + asm.js demo)
- Compiling to the web with Rust and emscripten
- Basic 2FA in Rocket
- Building high performance REST APIs with Rust and Rocket
- Rocket Rocks! Using FromFormValue Traits to protect your website
- Building an Asynchronous Hyper Server
- JWT & Access Roles in Rocket
- Writing a basic JSON response web server in Rust using Iron
- Diesel Powered Rocket
- Using Stainless with Rocket
- Integration testing a service written in Rust and Iron
- Actually using Iron: A grumpy introduction to web development in Rust
- Using Rust for Webdev as a Hobby Programmer
- My adventures in Rust webdev
- Rust’s Iron Framework: First impressions
- Rust for Node.js developers
- A Rust-powered public web page in 5 minutes
- Rust and Rest
- Shipping forgettable microservices with Rust
- Writing a simple REST app in Rust
- Getting started with Rust
- Let's Build a Web Server in Rust
- Creating a basic webservice in Rust
- Iron on uWSGI
- Deploying a Rust App to Google App Engine
- async hyper
- Introducing Pencil: A Microframework Inspired By Flask For Rust
- Trying Rust for web services
- Are we web yet?
- Reimplementing ashurbanipal.web in Rust
- A web app with Nickel: From first line to Heroku deployment
- What features Iron does not have compared to a web server like nginx?
- Build an API in Rust with JWT Authentication using Nickel.rs
- Selective Middleware for Iron
- Rust for the Web - RESTful API in Rust, impressions
- Rust for Node developers
- exoskeleton - Iron
- Example webapp using React + Webpack - Iron
- rustwebapp - Iron and Postgres (r2d2)
- webrust - Iron and Postgres (r2d2)
- httptest - Iron
- nickel-todo-backend - Nickel and Postgres (r2d2)
- rust-playground - Iron
- rust-web-example - Iron + Diesel (r2d2) + Serde
- websocket chat - Actix: Browser Websocket + tcp chat
- diesel - Actix + Diesel
- json - Actix + serde_json or json_rust
- paste.rs - Rocket
- Portier - Iron and Redis
- yaus - Iron and SQLite
- racerd - Iron
- rust-passivetotal - Hyper
- mars - Hyper
- openfairdb - Rocket and Neo4j (r2d2)
- ruma - Iron and Posgres (diesel + r2d2)
- html2pdf - Iron
- stdweb - A standard library for the client-side Web
- webplatform - a library for use with emscripten to access the DOM.
- hellorust.com - a website with news, resources and demos
- rust-webapp-template - Template project for Rust web app using stdweb
- rust-todomvc - an example application build with webplatform
- wasm-experiments - experiments with
wasm32-unknown-unknown
- TechEmpower Web Framework Benchmarks
- benchmarks - Rust web frameworks benchmarks
- which_is_the_fastest - Measuring response times (routing times) for each framework (middleware). Each framework has to have two features; routing and parsing path parameters.
Name | iron | gotham | rocket | nickel | rustful | rustless | conduit | rouille | ease | jsonrpc | pencil | sappers | boron | susanoo | shio | actix-web | Thruster |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
License | MIT | MIT / Apache 2.0 | MIT / Apache 2.0 | MIT | MIT | MIT | MIT | Apache 2.0 | MIT | CC0-1.0 | BSD-3-Clause | MIT | MIT | MIT / Apache 2.0 | MIT / Apache 2.0 | MIT / Apache 2.0 | ? |
Github Stars | 4.4k | 0.7k | 2.7k | 1.9k | 0.8k | 0.3k | 0.1k | 0.1k | 0.1k | 0k | 0.8k | 0.4k | 0k | 0k | 0.1k | 0.3k | 0k |
Contributors | 67 | 19 | 28 | 49 | 11 | 11 | 5 | 4 | 2 | 2 | 4 | 1 | 2 | 1 | 3 | 7 | 4 |
Server | yes | yes | yes | yes | yes | yes | yes | yes | no | no | yes | yes | yes | yes | yes | yes | yes |
Client | no | no | no | no | no | no | no | no | yes | yes | no | no | no | no | no | yes | no |
Base framework | hyper | hyper | hyper | hyper | hyper | iron | civet | tiny-http | hyper | hyper | hyper | hyper | hyper | hyper | hyper | tokio | tokio |
HTTPS support | yes | yes | no | yes | ? | ? | ? | - | - | ? | ? | no | yes | ||||
HTTP/2 support | ? | no | ? | ? | ? | ? | ? | ? | ? | ? | ? | no | yes | ||||
Async | yes | no | yes | yes | yes | yes |
Name | civet | hyper | tiny-http | solicit | kinglet | hydrogen | tk-http | h2 |
---|---|---|---|---|---|---|---|---|
License | MIT | MIT | Apache 2.0 | MIT | MIT | MPL 2.0 | MIT / Apache 2.0 | MIT / Apache 2.0 |
Github Stars | 0k | 2.7k | 0.2k | 0.2k | 0.1k | 0.4k | 0.1k | 0.1k |
Contributors | 4 | 112 | 9 | 8 | 1 | 2 | 5 | 8 |
Server | yes | yes | yes | yes | yes | yes | yes | yes |
Client | no | yes | ? | yes | no | no | yes | yes |
HTTPS support | yes | yes | - | - | no | yes | no | |
HTTP/2 support | solicit | ? | yes | - | no | no | yes | |
Async | yes | yes | yes |
Name | iron | gotham | nickel | conduit | rouille | rustful | rustless | pencil | sappers | actix-web |
---|---|---|---|---|---|---|---|---|---|---|
Static File Serving | yes | no^ | yes | yes | n/a | ? | ? | yes | ? | yes |
Mounting | yes | yes | yes | ? | n/a | ? | ? | ? | ? | yes |
Logging | yes | yes | no | ? | n/a | ? | ? | yes | ? | yes |
JSON-Body-Parsing | yes | yes | yes | ? | n/a | ? | ? | ? | ? | yes |
Sessions | yes | yes | ? | ? | n/a | ? | ? | ? | ? | yes |
Cookies | yes | yes | ? | ? | n/a | ? | ? | ? | ? | yes |
PostgreSQL middleware | ? | no^ | yes | ? | n/a | ? | ? | ? | ? | yes |
SQLite middleware | ? | no^ | yes | ? | n/a | ? | ? | ? | ? | yes |
Redis middleware | ? | no^ | yes | ? | n/a | ? | ? | ? | ? | yes |
MySQL middleware | ? | no^ | yes | ? | n/a | ? | ? | ? | ? | yes |
(^ Planned in current roadmap)
Name | websocket | ws-rs | twist | tungstenite | tk-http | actix-web |
---|---|---|---|---|---|---|
License | MIT | MIT | MIT / Apache 2.0 | MIT / Apache 2.0 | MIT / Apache 2.0 | MIT / Apache 2.0 |
Github Stars | 0.4k | 0.5k | 0k | 0.1k | 0.1k | 0.3k |
Contributors | 31 | 25 | 2 | 8 | 5 | 7 |
Server | yes | yes | yes | yes | yes | yes |
Client | yes | yes | yes | yes | yes | yes |
Base framework | - / tokio | mio | tokio | - / tokio | tokio | tokio |
Async | no / yes | yes | yes | no / yes | yes | yes |
To compile or run the examples use Cargo. First clone this repo
git clone https://github.com/flosse/rust-web-framework-comparison
cd rust-web-framework-comparison/
and change to the desired frameworkd directory (e.g. cd iron/
) and type
cargo run --example hello_world
Then visit http://localhost:3000
to see the result.