Do most work sync? #7115
Unanswered
nathan-jkn
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Folks, we’re starting a new enterprise software platform (like Salesforce, SAP, Workday) and chose Rust. The well-maintained HTTP servers I was able to find (Axum, Actix, etc.) are async, so it seems async is the way to go.
However, the async ecosystem still feels young and there are sharp edges. In my experience, these platforms rarely exceed 1024 threads of concurrent traffic and are often bound by database performance rather than app server limits. In the Java ones I have written before, thread count on Tomcat has never been the bottleneck—GC or CPU-intensive code has been.
I’m considering having the service that the Axum router executes call spawn_blocking early, then serving the rest of the request with sync code, using sync crates like postgres and moka. Later, as the async ecosystem matures, I’d revisit async. I'd plan to use libraries offering both sync and async versions to avoid full rewrites.
Still, I’m torn. The web community leans heavily toward async, but taking on issues like async deadlocks and cancellation safety without a compelling need worries me.
Does anyone else rely on spawn_blocking for most of their logic? Any pitfalls I’m overlooking? Am I just overthinking this?
Beta Was this translation helpful? Give feedback.
All reactions