Regardless of which programming language is used, there will always be a spectrum of Web frameworks ranging from small and elegant to comprehensive and all-inclusive. Traditional programming languages tend to favor comprehensive frameworks, such as Java’s Spring Boot, PHP’s Laravel, Python’s and Ruby’s Ruby on Rails.
In contrast, emerging languages lean more towards small and elegant designs. For example, popular choices in Go include Gin and Echo, while in Rust, Axum and Actix are favored.
Strictly speaking, tools like Gin, Echo, Axum, or Actix are closer to “libraries” rather than full-fledged “frameworks”.
Which Is Better?
In the domestic development environment, there is a clear preference for comprehensive frameworks. This inclination may stem from the high emphasis on agile development and rapid delivery. Comprehensive frameworks mean out-of-the-box functionality, making it feasible to develop a system within a week. Additionally, these frameworks typically provide what developers call “best engineering practices,” allowing users to focus less on architectural issues.
However, this convenience comes at a cost—these frameworks often limit user freedom and make deep customization difficult.
On the other hand, small and elegant frameworks offer greater flexibility, allowing users to freely adjust architecture and module choices. Dislike a particular ORM? You can easily switch to another! Want to decide your own code organization? Absolutely possible! This is why foreign developers generally prefer such frameworks.
Comprehensive Frameworks in Rust
In the Rust ecosystem, Axum, Actix, Rocket, and Warp are examples of small and elegant libraries. They are more like building blocks that require developers to construct their ideal systems manually.
Loco stands out as one of the few comprehensive frameworks in Rust, similar to Ruby’s Ruby on Rails. It provides complete scaffolding functions, offering out-of-the-box support for databases, task scheduling, caching, authentication, and more. Choosing Loco is almost equivalent to gaining better best practices, smoother development experiences, integrated testing support, and faster application building capabilities.
Notably, there is also the newly emerged Cot, a framework styled similarly to Python’s Django, built on Axum and using SeaQuery as its ORM. However, it is still in a very early stage. If you want to try a mature comprehensive framework, Loco might be a better choice.
My Choice
Personally, I prefer simpler frameworks. Because I enjoy trying new things, I hope the framework is not too intrusive. For instance, years ago in a personal Go project, I easily switched the framework from Gin to Echo, then to Chi, with almost no side effects.
However, in team collaborations, comprehensive frameworks are usually the better choice. They effectively constrain code quality and reduce chaos caused by individual style differences. This may also explain why Spring Boot is so popular domestically.
Overall, whether it’s small and elegant or comprehensive, choosing a framework that fits the current needs and team background is most important.
Project Links:
- Loco: https://github.com/loco-rs/loco
- Cot : https://cot.rs/
- Axum: https://github.com/tokio-rs/axum
- Spring Boot: https://docs.spring.io/spring-boot/index.html
- Gin: https://gin-gonic.com/
- Echo: https://echo.labstack.com/
- Chi : https://github.com/go-chi/chi
- Laravel: https://github.com/laravel/laravel
- Django: https://github.com/django/django
- Actix: https://github.com/actix/actix-web