Live data from Hacker News

Getting Started with Axum – Rust's Most Popular Web Framework

shuttle.rs

1–10 of 26 posts

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#2
> Deployment with Rust backend programs in general can be less than ideal due to having to use Dockerfiles,

Actually, in my experience, Rust is one of the best languages for ease of deployment (for much the same reason as Go). Rust/Cargo produces self-contained statically linked binaries. Rust/Cargo also has a real nice cross-compiling story. Often my deployment will be to build the binary and then basically scp the binary and supporting files (such as html/config) to the target. You don't really need Docker.

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#4

> Deployment with Rust backend programs in general can be less than ideal due to having to use Dockerfiles, Actually, in my experience, Rust is one of the best languages for ease of deployment (for much the same reason as Go). Rust/Cargo produces self-contained statically linked binaries. Rust/Cargo also has a real nice cross-compiling story. Often my deployment will be to build the binary and then basically scp the…

Similarly for our Go binaries, I build them as full static binaries outside of Docker then just COPY them in. Works pretty seamlessly.

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#5

> Deployment with Rust backend programs in general can be less than ideal due to having to use Dockerfiles, Actually, in my experience, Rust is one of the best languages for ease of deployment (for much the same reason as Go). Rust/Cargo produces self-contained statically linked binaries. Rust/Cargo also has a real nice cross-compiling story. Often my deployment will be to build the binary and then basically scp the…

Agreed, Rust is super easy for deployment.

I wrote a quick blog post in the past describing what the parent comment is talking about.

https://logankeenan.com/posts/deploy-your-rust-project-to-an...

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#6
Is it safe to expose to the internet[0]? I’m still looking for a Rust web framework that supports eg timeouts for idle connections so that it doesn’t crash and burn when it runs out of sockets after a few hours of serving production traffic (let alone being able to survive an intentional slowloris attack) :(

[0] I’m ideally hoping for a framework which ticks the same boxes that Go’s `net/http` was ticking in 2016: https://blog.cloudflare.com/exposing-go-on-the-internet/

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#7
post #3

This isn't trolling, it's my genuine ignorance- I thought Actix was the goto web framework for Rust? I don't do a whole lot of Rust and when I do it isn't http router type work so I'm out of the loop here.

Looking at stats on crates.io for a few frameworks

- axum: 100k installs/day

- warp: 25k installs/day

- actix: 15k installs/day

- rocket: 7k installs/day

- tide: 1k installs/day

(For comparison, hyper - the HTTP library that most web frameworks use under the hood - is at 200k/day, many of which are using it for client rather than server functions. So unless there is another not-hyper-based framework out there, then I’d be moderately confident guessing that axum has >50% of the server market)

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#8
post #3

This isn't trolling, it's my genuine ignorance- I thought Actix was the goto web framework for Rust? I don't do a whole lot of Rust and when I do it isn't http router type work so I'm out of the loop here.

Actix used to be the fastest (maybe still is? all the frameworks are so fast it doesn't even matter that much anymore) and most popular framework. Then a bit of drama happened about the hard life of maintaining an OSS project with users criticising you (the usual).

Rocket seemed to gain popularity for a bit but then there was some drama with the maintainer disappearing / not releasing 0.5 for a long time.

Meanwhile, quietly, the guys who did tokio (the most popular async runtime) released axum, which is compatible with tower middlewares. So they had tons of features pretty early.

I switched from actix to axum around 0.4 and updates have been very sensible and kept improving the DX.

Nowadays Axum is at the top for downloads number: https://www.arewewebyet.org/topics/frameworks/

Re: Getting Started with Axum – Rust's Most Popular Web Framework

#9
post #3

This isn't trolling, it's my genuine ignorance- I thought Actix was the goto web framework for Rust? I don't do a whole lot of Rust and when I do it isn't http router type work so I'm out of the loop here.

When I looked into it while starting a new project about a year ago, Axum seemed like the framework with the most inertia. I think there was some concern a year or two back about whether Actix would continue to be maintained, but it looks healthy now.

They're probably both fine choices, I chose Axum because the middleware architecture was easier to grok and at the time I felt that staying under the tokio umbrella would be safer long term.

Post reply on HN