by DelaneyM · 4y ago · 0 comments
In particular I want to shout out for Axum (https://github.com/tokio-rs/axum), from the folks who brought us Tokio. I've been building with it for the past few weeks and have enjoyed every minute.
I started with Warp, but ended up struggling a bit with middleware. I tried Axum as a web framework wrapper for tower (https://crates.io/crates/tower), and never ended up bothering to reintegrate back into Warp.
[1]: https://github.com/integer32llc/rust-playground/pull/777
Having come from python (day job) I did hit a screeching halt when it came time to meaningfully interact with a database.
It is unfair to compare Rusts current offerings to something as mature as SQLAlchecmy but boy does it slow things down dev wise to be mapping my own types and queries using tokio-postgres.
I've looked at Diesel, sqlx and SeaORM but have not yet committed to learning one yet.
I've also used Warp for some small web server stuff in the past as well. It is an interesting approach but definitely a little different.
Similar to typescript, where years ago I thought “but I just want to write code!”, now I can’t imagine going back. At least not for meaningful projects where I need to care about consistency and stability for more than a few months/for something critical.
The initial slowdown affords you a lot in the longer term.
I’m somewhat wide-eyed at how much simpler and more readable query building is in Django. I have been spoiled.
SQLAlchemy is closer to SQL than I generally want to be for pedestrian web programming. It also lacks conveniences I’ve taken for granted writing Django backend.
Even for writing data migrations in scripting, having ORM queries be incredibly simple to read and modify is extremely valuable, it makes code reviews accessible to more people.
I’m not a rust developer, though I admire what it can do. That said, having looked at the starter queries on each, it would take a lot to make me contemplate use of any of the rust-based ORMs you’ve listed.
As a sibling comment points out, typing and async are valuable and Django has no typing and is still working on delivering async support in its ORM.
That said, for web products reducing time to flipping feature flags seems to be the main goal.
In that way Python / Django and I suppose even SQLAlchemy will probably retain users against Rust.