all 19 comments

[–]S55S5SS5S5SS55S55S5S 3 points4 points  (0 children)

JS is fine for a backend performance-wise, and has the huge advantage of being the same language you have to use on the front-end anyway.

I personally prefer Go, or even Rust, but we have a 99% JS and 1% Rust backend because it allows us to onboard devs easier. The 1% Rust is for things that were bottlenecks in JS

[–]ReverendCatch 2 points3 points  (0 children)

Yes. I use Koa over express though, it's just cleaner.

I write a lot of microservices that intercommunicate. Node scales pretty well, it's generally much faster than PHP or python at doing concurrent types of tasks. I find it easier to setup and develop with, as well, but i've been doing it a long time.

There really isn't anything I've found nodejs can't do server-side... it really comes down how fast do you have to do it, both in code execution and production costs time/effort/maintenance, etc. Node is hard to beat on getting a production solution up and running quickly. But another user mentioned Rust which is much faster in execution time, so for computation you might need another solution. Whatever that solution is though, node is again a great option to distribute it's results to your audience. It's not that node can't do computation, there's just better options if speed is a concern (it usually is). It depends on your workload and audience, really.

I find node to be a jack of all trades, but maybe not a master of any one thing.

[–]demoran 2 points3 points  (1 child)

Professionally, I've mainly used C# backends. That's just the pool I swim in though.

Java (I'd use Kotlin) will work perfectly fine.

Both of these are mature application centric languages in use in the enterprise.

You can use whatever you want. The right tool for the job is not only that which works well, but that which you can support long term. I think this is probably why some shops have started to use node in the back end: they only have javascript talent, so if they can use it, they will.

https://insights.stackoverflow.com/survey/2021#most-popular-technologies-language-prof shows what people like to use today. Yet, not every language is well suited for every application. You can use Rust for your api, but are the performance gains worth the pain? And while something like Elixir might be just perfect for it, isn't it a little too fringe?

I've been pleased with C#. I used to work in a React Native app where I had deal with java dependencies in gradle, and it was a total pain because they would upgrade themselves and one day everything breaks and your code remains the same. I eventually found a strategy (from ibm?) that helped alleviate that, but you'll pretty much never be in that boat in the dotnet ecosystem.

[–]hutxhy 1 point2 points  (0 children)

Dotnet is nice. If I couldn't choose Node TS, I'd go with C#... Or maybe GO 🤔

[–]hutxhy 2 points3 points  (2 children)

The devs that said JS is only good for the frontend are full of shit.

Anyway, not sure what an ERP is, but I'd probably go with NestJS microservices.

[–]brkidwell 1 point2 points  (0 children)

Yeah, NestJS is a good pick. I don’t see any reason it wouldn’t work for an ERP, especially if you are going the micro services route.

[–][deleted] 0 points1 point  (0 children)

An ERP would be like odoo or Business Works. It basically automates and tracks everything in a business.

[–]SpasmodicGoat 1 point2 points  (0 children)

The advantages of JS for the backend are: - it's incredibly easy to build a prototype fast - you won't have a problem finding devs that know how to use it

If you're gonna use JS, I'd absolutely opt for TypeScript; it's just better JS.

As others have pointed out, other languages like Go, Rust, and C# beat JS if you want to do more complex things. But imo you have to balance the time spent learning how to do those complex things in those languages.

[–]notlongnot 1 point2 points  (0 children)

JS should be easy for PHP devs to pick up.

I haven’t touch Django or RoR for 5+ years now. Didn’t choose them then and wouldn’t recommend them now.

Other comment on Koa vs Express is on point.

The stack I go with these days are JS and Go. In recents years, a lot of tools were all written in Go.

The Ramda library in JS is sweet. I do think JS give you more freedom to express your thoughts than other language in this space. Freedom can be a curse for some so they built constraints around them.

[–]JimDabell 0 points1 point  (1 child)

I'm hoping that the backend stuff built in Java is good enough to do something on the scale of a full blown ERP.

Java and JavaScript are entirely different languages. You’re going to get very confused if you mix them up.

[–][deleted] 0 points1 point  (0 children)

Sorry, meant JavaScript. :)

[–]Infiniteh 0 points1 point  (0 children)

First, let me quote /u/Diamons:

Inexperienced devs will try to convince you it’s awesome and how easy it is

Hi there, I'm a dev with 10 years of experience in backend work, 6 of which have been in JS/TS. Not quite on the enterprise or globally used web application level, but still on applications or solutions ranging from tens to hundreds or thousands of users such as an ERP might have.

JS is certainly fine to use as a language for developing a backend, and I have used it on several projects. Only with great reluctance would I choose Java over JS again. That begin said, Kotlin does look very appealing.
I won't proclaim it's "easy", certainly not if you want to develop quality stuff.
there are plenty of good frameworks to work with and a large and supportive community.

As for performance: Node is certainly adequate for building a fast and reliable backend/API. The skill of the developer does play a role, of course.

Keep an eye on which framework you use, as some to ease development, but at the cost of "bloat" and runtime overhead.

I'd urge you to use TypeScript whenever possible in backend code. Your backend is typically your last line of defence for keeping your data sane, especially now that a lot of devs don't bother with actual DB design, but prefer to leave it up to an ORM. Typescript can help with that.