Title says it all. I am just curious if someone of you have already did a project (not an example or an exercise) that involves backend development using frameworks like Warp, Actix or maybe Rocket in Rust programming language? Do you guys mind sharing your experience with it and what are your comments with the framework and the language itself? 🙃
Has anyone tried using Rust for Backend Development? |
|
May 7, 2024 11:54 AM
(This post was last modified: May 7, 2024 12:02 PM by MavenGradle.)
Yes, of course. I have some Rust backend projects in production today. Some heavy duty calculation stuff and honestly? It's been great! I mainly use Actix and Actix-web, because it's stable. At this point in time I cannot and will not utilize Axum for production simply because its still in development and open to big changes, which I try to save my clients from. The problem with Rocket is that a) Actix exists and is way more powerful than Rocket and b) Rocket is mostly maintained by a single developer in his spare time. Once again, very hard to convince clients to choose Rocket over Actix. I know the noobs like to recommend Axum because it's being developed by the same guys that are maintaining Tokio, but there are REAL reasons why you would use Actix over Axum even though they are both using Tokio. One of those reasons being stability and another being breaking changes. You should not use Axum for clients at this point in time unless they are fully aware of what you're doing and they're open and willing to rewrite big portions of their code, possibly 6 months from now or less. Using Axum for your own hobby projects is absolutely fine though.
But, in terms of why I would use Rust... We've noticed a reduced cost for our cloud deployment. In one case I was able to reduce memory usage from an old Java Spring application down from 250MB RAM usage to 10MB, and keep it stable, while being able to calculate more requests and handle them faster. At some points in the mornings it handles over 100.000 requests in less than an hour and still does not exceed 10MB of RAM usage. Couldn't be happier with it. ![]() (May 7, 2024 11:54 AM)MavenGradle Wrote: Yes, of course. I have some Rust backend projects in production today. Some heavy duty calculation stuff and honestly? It's been great! I mainly use Actix and Actix-web, because it's stable. At this point in time I cannot and will not utilize Axum for production simply because its still in development and open to big changes, which I try to save my clients from. We have the same opinion with both of those frameworks that you have mentioned (Actix and Actix Web). I primarily use it for cheap ass clients who want heavy duty applications running on machines (offline server or VPS) with minimal specifications. And also, I do not know why but whenever I dive into chat rooms or maybe other forums, they always say that Axum is much more stable than the two. But like you, I can see that it also lacks of many features and needs more room for improvement. Have you tried using docker containerization with it, then having them all pass through an nginx gateway? If you have an alternative for nginx, do you mind sharing? Please do not say Apache. Lol. 😆
May 7, 2024 12:09 PM
(This post was last modified: May 7, 2024 12:19 PM by MavenGradle.)
(May 7, 2024 11:58 AM)happygonutty Wrote: Have you tried using docker containerization with it, then having them all pass through an nginx gateway? If you have an alternative for nginx, do you mind sharing? Please do not say Apache. Lol. 😆 Yes! Setting up CI/CD for Rust projects is an absolute must. It makes your life easier, it makes the client's lives easier. Especially in this day and age where everything is a microservice and everything is generally speaking horizontally scalable. I agree, it's sad how we have the power of Rust but the limiting factor of nginx or Traefik.. but Actix web is still faster than any python framework or any Java framework on the market today, so really if nginx is your bottleneck, that means you're in the land of serious cashflow. In addition nginx is written in C++ and its mostly fine. You're probably not going to run into its limits and if you do, you will need to step into the land of hardware load balancers (or first something like Cloudflare load balancing - DNS based load balancing). It costs a pretty dime though, and chances are that you're not working for Netflix or Amazon and will rarely need to set up infrastructure like this. But now you know what to do if you ever did 😉. https://www.cloudflare.com/application-s...balancing/ (goes to say the kind where they don't put the prices online and you have to contact sales to find out how much you're gonna be paying - e.g. if you have to ask you cannot afford it) Another FYI is that nginx (plus) is fast enough to be a load balancer itself and I'm generally speaking talking outside the scope of DDoS attacks and how to deal with those because that is an entirely different beast to tackle with many different solutions. ![]() (May 7, 2024 12:09 PM)MavenGradle Wrote: Yes! Setting up CI/CD for Rust projects is an absolute must. It makes your life easier, it makes the client's lives easier. Especially in this day and age where everything is a microservice and everything is generally speaking horizontally scalable. I agree, it's sad how we have the power of Rust but the limiting factor of nginx or Traefik.. but Actix web is still faster than any python framework or any Java framework on the market today, so really if nginx is your bottleneck, that means you're in the land of serious cashflow. In addition nginx is written in C++ and its mostly fine. You're probably not going to run into its limits and if you do, you will need to step into the land of hardware load balancers (or first something like Cloudflare load balancing - DNS based load balancing). It costs a pretty dime though, and chances are that you're not working for Netflix or Amazon and will rarely need to set up infrastructure like this. But now you know what to do if you ever did 😉. Indeed especially if you work with a team or maybe the customer's team. Yes most systems nowadays are composed of microservices, most monolithic systems are either obsolete or just used in schools just to make a one hell of a system. Actually most schools are already teaching microservices and web services. Yes, I vouch Actix web for being the fastest framework but you know for simple developers who aren't that hardcore, kinda hard for them. In addition to that, you are right, the only problems you would encounter is hardware and load balancers. Less worries with technical problems but more worries with the pay-as-you-go kind of approach. Hahahaha. 😆
May 8, 2024 09:33 AM
(This post was last modified: May 8, 2024 09:33 AM by MavenGradle.)
(May 8, 2024 06:31 AM)COCKBOT Wrote: Yes. I wrote a game matchmaking service using Rust/Axum. Why in the world would you switch from Rust to Go? Again, if it's because you used a pre-release version of a product (AXUM)... It's your own damn fault for choosing a framework that doesn't even have a v1.0 release. ![]() (May 8, 2024 09:33 AM)MavenGradle Wrote: Why in the world would you switch from Rust to Go? Again, if it's because you used a pre-release version of a product (AXUM)... It's your own damn fault for choosing a framework that doesn't even have a v1.0 release. I think Go has it's own merits enough to warrant the switch back from Rust to Go, as a fan of both languages and running a start-up with code running on customer infrastructure. We have plenty of both and I don't think I would want to replace our Go code with Rust code. (May 8, 2024 09:33 AM)MavenGradle Wrote: Why in the world would you switch from Rust to Go? Again, if it's because you used a pre-release version of a product (AXUM)... It's your own damn fault for choosing a framework that doesn't even have a v1.0 release. Because it's the better tool for the job. Time to develop is extremely important and the tradeoff in performance is incredibly negligible in my use-case. Extremely large platforms (Instagram) use things like Django which is built with Python and perform perfectly fine, even with having to deal with the GIL. Rust just... isn't worth the time spent for most projects.
Private MMORPG bot developer.
May 8, 2024 09:52 AM
(This post was last modified: May 8, 2024 09:57 AM by MavenGradle.)
(May 8, 2024 09:44 AM)Dirty Wrote: I think Go has it's own merits enough to warrant the switch back from Rust to Go, as a fan of both languages and running a start-up with code running on customer infrastructure. We have plenty of both and I don't think I would want to replace our Go code with Rust code. Why? And also would you do the opposite; replace your Rust code with Go? If so, why? I'd like to know the reasons. if it's because of a lack of Rust developers or financial reasons, please point them out for the sake of curiosity. (May 8, 2024 09:44 AM)COCKBOT Wrote: Because it's the better tool for the job. Says... You? You're using a pre-release framework in Rust, and you're complaining about the development time which is entirely dependent on the programmer. This is a personal and highly subjective reason, not a technical one. Someone else might be more efficient writing Rust versus Go. Rust might not be worth it to you but then again some companies are using Rust to save on cloud infrastructure costs, which can easily run up to 100k a year for even a simple startup company. If Rust can decrease that cost to 40k, that's a lot of money saved. Yes, this has happened and will continue to happen. When you're claiming something is the better tool for the job, I'm here to point out to you and everyone who reads such statements as true, that this is extremely subjective given the circumstances, personal feelings, efficacy etc. Same goes for frameworks like Spring, React, Next, Node, etc and languages like Java, C#, JavaScript, Python etc.. ![]()
May 8, 2024 10:00 AM
(This post was last modified: May 8, 2024 10:45 AM by COCKBOT.)
(May 8, 2024 09:52 AM)MavenGradle Wrote: Why? And also would you do the opposite; replace your Rust code with Go? If so, why? I'd like to know the reasons. if it's because of a lack of Rust developers or financial reasons, please point them out for the sake of curiosity. Yes, says me. It's my opinion. "Development time is entirely dependent on the programmer" Rust, on average, takes much longer to ship than any of its contemporary counterparts.
Private MMORPG bot developer.
May 8, 2024 11:00 AM
(This post was last modified: May 8, 2024 11:08 AM by MavenGradle.)
(May 8, 2024 10:00 AM)COCKBOT Wrote: Rust, on average, takes much longer to ship than any of its contemporary counterparts. What are you basing this on? Do you have a source or links for studies for this statement to back this up? Specifically the average part? Rust and ASM are comparable, but it takes me less time to write something in Rust than it does in ASM. Perhaps your next thought of train is that Rust is more verbose than other languages, but this statement fails to take into account that verbosity of a language does not equal longer development times or offer a causality between verbosity and development time. Again, Rust could be considered less verbose than ASM. Verbosity is not necessarily bad and it is not necessarily the cause of longer development times when comparing programming languages. ![]() (May 8, 2024 11:00 AM)MavenGradle Wrote: What are you basing this on? Do you have a source or links for studies for this statement to back this up? Rust and ASM are comparable, but it takes me less time to write something in Rust than it does in ASM. Facts. It's a language that inherently asks more of you than any other. I understand the reasons behind why it does this, and I at times even appreciate it. But it doesn't change the fact that in many projects, you simply don't need the speed. I referenced Instagram's success with a notoriously slow framework built atop a notoriously slow language in an earlier post. The fact of the matter is, users care more about features than they care about endpoint load times. Other languages are simply better fit for rapid development than Rust. It is not what Rust was built to do, and as such, it loses out in this regard.
Private MMORPG bot developer.
May 8, 2024 11:12 AM
(This post was last modified: May 8, 2024 11:19 AM by MavenGradle.)
(May 8, 2024 11:08 AM)COCKBOT Wrote: Other languages are simply better fit for rapid development than Rust. It is not what Rust was built to do, and as such, it loses out in this regard. (May 8, 2024 11:08 AM)COCKBOT Wrote: The fact of the matter is, users care more about features than they care about endpoint load times. I feel like you're not grasping what I'm saying when you make statements like this. This is subjective and not factual at all. It depends on many factors including the developer, the hardware on which something is being compiled, the Operating System, the developers experience, the developers tools like a Copilot or AI derivative, just to name yet another couple of examples as to why this is just.. not true. In terms of what users want. That too depends on the users and the project that you're working on.. You cannot generalize what users want when you're not even giving a domain or use-case for these statements. Don't you think the users of Photoshop web care about the speed of the web-version of the Photoshop tool? Wouldn't that be exactly why Adobe created parts of the Photoshop application using Rust and WASM (and yes, there is a web version of Photoshop that you run in the browser)? I've given counter examples to your statements time and time again but I can't keep beating the same horse over and over again. ![]() (May 8, 2024 11:12 AM)MavenGradle Wrote: I feel like you're not grasping what I'm saying when you make statements like this. This is subjective and not factual at all. It depends on many factors including the developer, the hardware on which something is being compiled, the Operating System, the developers experience, the developers tools like a Copilot or AI derivative, just to name yet another couple of examples as to why this is just.. not true. You can generalize what users want. If you couldn't, focus groups wouldn't exist.
Private MMORPG bot developer.
|
|
|



![[Image: vp6iypF.gif]](https://i.imgur.com/vp6iypF.gif)
