Axum

Axum

Open Source

An ergonomic and modular web framework built with Tokio, Tower, and Hyper.

Backend Frameworks
Rust Frameworks

Scores

Popularity
1/5
Learning Curve
3/5
Flexibility
4/5
Performance
5/5
Portability
4/5

About

Axum is the web framework maintained by the Tokio team, making it the most tightly integrated option in the Rust async ecosystem. Built on Hyper (HTTP) and Tower (middleware), it inherits their performance characteristics while adding an ergonomic routing and handler layer.

The design philosophy is macro-free: routes are plain async functions, and request data (path parameters, JSON bodies, headers, cookies) is extracted via Rust's type system rather than procedural macros. This keeps compile times fast and makes handlers trivially unit-testable without spinning up a server.

Middleware is handled entirely through Tower's Service/Layer abstractions, which means any middleware written for Axum works equally well with Hyper and Tonic (gRPC) services — a major advantage for polyglot service meshes. tower-http ships a production-ready set of layers for CORS, tracing, compression, request IDs, timeouts, and auth.

Axum enforces #![forbid(unsafe_code)], meaning the framework itself contains no unsafe Rust. Combined with Rust's ownership model, this makes it extremely difficult to introduce memory safety issues in web layer code.

With ~25,500 GitHub stars and active development by the Tokio maintainers, Axum has become the de-facto standard for new Rust HTTP service development.

Key Features

  • Macro-free routing — route handlers are plain async functions, no annotations required
  • Type-safe request extractors for path params, JSON bodies, headers, cookies, and more
  • Full Tower/tower-http middleware compatibility — timeouts, tracing, CORS, compression out of the box
  • 100% safe Rust — forbids unsafe code in the framework itself
  • Minimal overhead on top of Hyper — performance comparable to raw async Rust
  • Shared middleware ecosystem with Hyper and Tonic (gRPC) services
  • Native async traits support — no `#[async_trait]` macro required as of 0.8
  • Simple, predictable error handling model without hidden panics

Pros

  • Officially maintained by the Tokio team — first-class integration with the dominant Rust async stack
  • Macro-free design makes compile times fast and handlers easy to unit-test
  • Tower middleware ecosystem is shared with the broader Rust ecosystem, avoiding framework lock-in
  • Gentler learning curve than Actix-web — fewer intimidating generics and clearer error messages
  • Type system enforces correctness at compile time, catching entire classes of bugs before runtime
  • 100% safe Rust enforced in the framework codebase

Cons

  • Pre-1.0 with breaking API changes between minor versions — migrations between 0.6, 0.7, and 0.8 required meaningful code changes
  • Minimal batteries included — no built-in ORM, templating, sessions, or auth; must assemble from crates
  • Tower's Service/Layer abstractions have a steep learning curve for writing custom middleware
  • Slightly lower raw throughput than Actix-web in synthetic benchmarks (~780K vs ~850K req/s)
  • Ecosystem is still maturing compared to frameworks in more established languages

Pricing

Open Source

Related Tools

Works well with (6)

Learning Resources

No resources yet — check back soon.

Tags

Open SourceSelf-hostableWeb

Details

License
MIT
Maintained
Yes
Primary language
Rust
Domain
Backend
GitHub stars
25.5k
Stars updated
2026-04-07