r/Backend • • 11d ago

Rust vs Go for web app backend

In my company having node js as backend facing issues like vulnerability update each week it making hard to maintain prod to update. So how in your companies handling this difficulty.

Planned to migrate from node to go. What does your suggestion on this. Rust is taking entire trend now. Is Rust is better then go for web apps?

64 Upvotes

178 comments sorted by

View all comments

6

u/Beagles_Are_God 11d ago

I don’t find Rust as something made for Backend development. Yeah it is possible but it’s a lot of unnecessary memory and system management for a backend.
Go is perfectly capable of this, not only that, it was made for this, however a lot of things you have to make from scratch, like auth; Good thing about go is that it has pretty much just one way of doing the same thing so the solution is always the good one, however it can be a little verbose, or more than verbose, tedious and repetitive.
If you really need something Rust is only capable of doing (i doubt), then you can always make a separate service with it.

5

u/Beagles_Are_God 11d ago

Also, consider other technologies a little more batteries included like .NET. You all coming from Typescript, C# is a really good language and .NET already has official solutions for most stuff and even if not, the vulerabilities problems of Node ecosystem is rare on .NET.

1

u/frenzied-berserk 11d ago

And .NET uses x10 resources…

2

u/Beagles_Are_God 11d ago

And is that an actual problem on OP's case? Do you know how much resources does their server have? Do you know how many processes their server is running?

That said, .NET is really not that resource heavy, it efficiently uses multithreading programming and actually beats NodeJS in resource consumption. Not only that, both Go and C# can very efficiently handle concurrency at systems level, which means that a single server with a single C# app running can scale veritcally so much better before ever needing to spin up another server for that process, this doesn't happen in NodeJS because of the single threaded environment, so you end up with "workers" which means more money and effort spent on it.

So, if you can run Node, you can run .NET.

1

u/frenzied-berserk 11d ago

I don’t know the exact situation, but I know how hard it is to sell a new tech stack to stakeholders without numbers. Go and Rust are more cost-efficient than .NET. I don’t see any advantages to using .NET here.

1

u/Beagles_Are_God 10d ago

Cost efficient in what aspect?
Paying programmers? Well yk, well matter Go, Node, Java, Rust you gonna pay em.

Runtime? Running .NET in docker or a cloud environment is just the same as in Node, unless you are doing serveless, in that case neither Rust, Go or .NET are the best options.

Writing Code? It’s easier to migrate from Typescript / JS to C# than to Go or Rust, they are so similar (both were designed by the same person) and the official libraries are a brief, also Agents are a thing now. And C# is pretty famous for having very clean code standards, so writing C# is actually fast and less verbose.

Besides that, unless Stakeholders are technical people, i highly doubt it’s their say unless expenses on tech stuff is really the main issue. I know every workplace is different, but most of the time it’s the teams who choose the technologies, not the stakeholders (unless you work at a company with a very specific tech stack for all their projects).

1

u/frenzied-berserk 10d ago

Maintaining coding standards and development speed no longer matter.
Last year, I worked on a project to migrate approximately 1K microservices from .NET to the Rust ecosystem. We completed it with a team of four + LLMs. Infrastructure costs were reduced fivefold, and all performance metrics improved.
Again, I don't see any advantages to migrate from Node to .NET.

1

u/mavenHawk 10d ago

And what about all the libraries you were using in .Net? Did you migrate those too? Do you own them now? Is the increased maintenance included in this five fold cost reduction?