7 ms·
Is it the time to consider Actix (or any other rust web framework) for production? I'm planning for a rather ambitious project, but not sure if I should choose
by rizzaxc 5y ago
Is it the time to consider Actix (or any other rust web framework) for production?
I'm planning for a rather ambitious project, but not sure if I should choose rust (the new shiny thing) or stick to good ol Go (while I do have some issues with it)
- dralley 5y agoPlenty of companies (including Microsoft IIRC) are using Actix in production. At this point it's not that shiny and new. Actix is the most mature of the Rust web frameworks. Axum is new but very promising. Rocket is popular but development is stalled at the moment since the main developer has been going through some rough times.
- lambda_dn 5y agoEvidence that Microsoft use Actix? Im sure if they did you would have posted a link.
- nicoburns 5y agoRust is plenty ready for production. Choosing between Go and Rust for web backends is really choosing between a more complex language that allows you to have powerful abstractions and has a focus on correctness vs. A simpler language that is looser and prefers “verbose but simple” code.
- lambda_dn 5y agoGoogle and most other software kings chooses C++ for backend. If you think you know better than them feel free to use the hype lang of the day. Rust will be gone in a few years.
- nicoburns 5y agoI don't think that conflicts with my comment. Just because Rust is ready for production doesn't mean that C++ isn't also ready for production. For what it's worth, Google are increasingly choosing Rust for new projects. As are Microsoft, AWS and several other large software companies. Obviously it doesn't usually make sense to rewrite old projects that are already in C++.
- maxloh 5y agoWhich of them is the more complex one?
- Macha 5y agoFrom a language features perspective, Rust. Personally I find building up the rigor to do correct error handling in Go's approach or C libraries with seperate error functions is its own kind of complexity, however.
- JSGdev 5y agoMy company currently runs Actix-web in production and is happy. Good tooling, fast, low resource costs, well-supported.
- lambda_dn 5y ago
- lambda_dn 5y agoWe looked into Rust at our company (top 100) and it's clear it's not ready for production systems. It just puts developers into a huge tar pit fighting with the compiler for anything more than a simple hello world app. If it actually lived up to it's hype it would have been used to rewrite browsers, servers, OSes etc. But C/C++ are still the kings of system programming.
- ylk 5y agoOff the top of my head… Firecracker, the software AWS Lambda runs on, is written in Rust: https://github.com/firecracker-microvm/firecracker https://github.com/firecracker-microvm/firecracker Mozilla wrote Servo, a browser engine, in Rust. Part of it has been integrated into Firefox a while ago: > Mozilla incorporated the Servo CSS Style engine in release 57 of its Firefox Quantum browser. https://research.mozilla.org/servo-engines/ https://research.mozilla.org/servo-engines/ It’ll be used in Android: https://security.googleblog.com/2021/04/rust-in-android-platform.html?m=1 https://security.googleblog.com/2021/04/rust-in-android-plat... It’ll probably find it’s way into the Linux kernel: https://news.ycombinator.com/item?id=29485465 https://news.ycombinator.com/item?id=29485465
- lambda_dn 5y agoThe whole reason for Rust's existence was for Servo so using it as an example of its use is disingenuous at best. Ok one bit of AWS runs on Rust. C/C++ runs 99% of the the worlds software including OS's/browsers/GUI's/Compilers/Virtual machines/Games/Aircraft/Spacecraft etc etc etc. "It'll be" same was said of Java
- RussianCow 5y ago> The whole reason for Rust's existence was for Servo so using it as an example of its use is disingenuous at best. Mozilla wanted to push the boundaries of what's possible with a browser rendering engine and they felt like they couldn't do it safely with the existing languages, so they created their own. Doesn't that, alone, speak volumes for how useful Rust is? > C/C++ runs 99% of the the worlds software including OS's/browsers/GUI's/Compilers/Virtual machines/Games/Aircraft/Spacecraft etc etc etc. Now you're being disingenuous. Rust is still so young compared to those languages! Not to mention that the industries best served by Rust move glacially slowly compared to, say, the web. I bet we'll see significantly more adoption of Rust in 10-15 years.
- tele_ski 5y agoAnecdotal but my company is using it for a new project and we just hit production about a month ago. So far it's been great with 10+ million requests handled per day. Looking forward to upgrading to 4.0
- echelon 5y agoI made another post in this thread, but I'm using it very happily for a few microservices that power https://fakeyou.com https://fakeyou.com (one is the main web monolith, the other is a websocket to pubsub bridge for an upcoming feature). - I've found it extremely fast to work with and iterate. - I've been able to meld a lot of complex use cases to it. In-memory caches, worker thread pools, etc. - It works great with testing, CORS, MySQL, Redis, forms, json, uploads, S3 clients, etc. - Serde + the expressive type system is incredible (this is more about being able to use Rust, but Actix plays so well with it). I'm using sqlx for nearly typified SQL checked at compile time. If we get a jOOQ-like DSL, I'll be overjoyed.
- rizzaxc 5y agofor request schema, do you know how rust/ actix supports protobuf? I find protobuf great for rapid prototyping, and using monorepo for both frontend + backend makes it even better for api consistency. my search shows there are 2 major libraries but the de factor parsing library doesn't support it (Serde) also, I'm interested in how you structure your code. is everything a crate? or you work in a giant namespace with different structs (sorry if this doesn't make sense I don't know much rust)
- echelon 5y agoNo idea why you're downvoted/flagged, these are perfectly valid questions. > for request schema, do you know how rust/ actix supports protobuf? That's a great question! The serde annotations make it look like it should work. If not, there might be a plugin for it. Actix has a rather vibrant ecosystem of utility crates. I've used Prost for protos once before (it felt like the more mature option), and the build integration was seamless. I was frustrated with how the IDE handled it at the time (Clion+Rust), which is one of the reasons I'm not using protos in Rust today. The IDE couldn't work out the types and everything touching the syntax tree near protos was opaque to the IDE. It was over two years ago the last time I checked the status of protos in Rust, so there's a good chance the situation has improved. I didn't use Prost with Actix in particular, which is why I can't really provide insight there. It should be quick to set up a test. I'm using two monorepos: one for frontend (yarn/typescript/react for three websites) and one for backend (all Rust; two servers and seven jobs). If I'd lumped it all together, I would have investigated protos more seriously. I should probably investigate using them again in the near future. > also, I'm interested in how you structure your code. is everything a crate? I'm using Rust workspaces to organize the backend monorep. I have about ten binaries, and five library crates that are shared between the various binaries. I also have a few vendored packages that aren't available on crates.io (newrelic-telemetry-sdk, etc.) I was told Bazel does a good job with build caching, so I'll investigate using that soon so I'm not always rebuilding the world. > or you work in a giant namespace with different structs (sorry if this doesn't make sense I don't know much rust) With the way modules work, there's next to no need for that in Rust. It's one of the most hygienic import systems I've used. Overall, I'm extremely happy with the setup and it's been really productive for me.