A comparison of some web frameworks and libs written in Rust
Clone or download
Latest commit e34d934 Feb 3, 2019

README.md

Rust web framework comparison

A comparison of some web frameworks written in Rust.

Table of Contents

Server frameworks

There are several interesting frameworks to build web applications with Rust:

If you need a more low level control you can choose between these libraries:

Outdated server frameworks

Client frameworks

To build web clients with Rust, you can choose between these libraries:

Outdated client frameworks

Frontend frameworks (WASM)

Since WASM support is available in most browsers we can use Rust to build web applications :)

Supplemental libraries

Websocket

Templating

Comparison

High-Level Frameworks

Name iron gotham rocket nickel rouille ease jsonrpc actix-web Thruster
License MIT MIT / Apache 2.0 MIT / Apache 2.0 MIT Apache 2.0 MIT CC0-1.0 MIT / Apache 2.0 MIT
Github Stars 5.1k 1k 5.7k 2.2k 0.3k 0k 0k 2.8 0.2k
Contributors 84 25 114 53 22 6 7 78 7
Server yes yes yes yes yes no no yes yes
Client no no no no no yes yes yes no
Base framework hyper hyper hyper hyper tiny-http hyper hyper tokio tokio
HTTPS support yes yes no ? - - yes
HTTP/2 support ? no ? ? ? ? yes
Async yes no yes yes

Low-Level Frameworks

Name hyper tiny-http tk-http h2
License MIT Apache 2.0 MIT / Apache 2.0 MIT / Apache 2.0
Github Stars 4.1k 0.3k 0.1k 0.5k
Contributors 191 16 5 22
Server yes yes yes yes
Client yes ? yes yes
HTTPS support yes yes yes no
HTTP/2 support solicit ? no yes
Async yes yes yes

Frontend Frameworks

Name stdweb yew percy seed draco smithy squark ruukh willow
License Apache/MIT Apache/MIT Apache/MIT MIT Apache/MIT ? WTFPL MIT Apache/MIT
Github Stars 2.3k 6.5k 0.9k 0.2k 0.1k 0k 0.1k 0.1k 0.1k
Contributors 50 55 9 7 4 1 2 3 2
Stable Rust yes yes no yes yes no no no no
Base framework - stdweb wasm-bindgen wasm-bindgen wasm-bindgen wasm-bindgen wasm-bindgen wasm-bindgen wasm-bindgen
Virtual DOM ? yes yes yes yes ? yes yes ?

Middleware & Plugins

Name iron gotham nickel rouille actix-web
Static File Serving yes no^ yes n/a yes
Mounting yes yes yes n/a yes
Logging yes yes no n/a 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)

Websocket Libraries

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

Examples

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.

Resources

Blog posts

2018

Until 2017

Demos

Real-world web projects using Rust

JS & asm.js & WASM

Examples

Benchmark