News for hackers. Stuff that matters.
Re:600k concurrent websocket connections on AWS using Node.j... by anildigital on Friday October 11, 2019 @09:23AM (#21224069)
I don't get point of using Node.js when compared to something like Elixir. Elixir's Phoenix can handle more numbers of concurrent connections as well as provide reliability with better programming abstractions, distribution, pretty good language.
Re:600k concurrent websocket connections on AWS using Node.j... by athenot on Friday October 11, 2019 @09:47AM (#21224282)
There are a handful of languages that would be suitable for this. The "right one" to use depends on more than just the language features for that task:

- What third party libraries do you need to use? Some languages have very good support for some, and less for others.

- What are the internal integrations you need to support? Can they be over the network or are you calling into code in a particular language?

- What is the pool of skills available to you as a team? Do you go with a language that has a reputation of being really good for this task but of which the team knows very little (and therefore will have a learning curve working out the common pitfalls), or do you go with a better understood language which the team has already mastered, and stretch it to go beyond what mere mortals do with it? Note: there's no right answer here, both options have severe drawbacks.

- Related to the previous: what's your company's culture regarding technical diversity?

Re:600k concurrent websocket connections on AWS using Node.j... by anildigital on Friday October 11, 2019 @09:52AM (#21224341)
This is a very typical diplomatic answer to stick with old, known programming languages.
Re:600k concurrent websocket connections on AWS using Node.j... by arcturus17 on Friday October 11, 2019 @10:05AM (#21224468)
Maybe because a lot of the time it's good advice?
Re:600k concurrent websocket connections on AWS using Node.j... by SketchySeaBeast on Friday October 11, 2019 @11:10AM (#21225108)
Often case that isn't the wrong way to go. Newer doesn't mean better, and there's always trade-offs to consider. "It's newer" by itself really shouldn't be much of a consideration.
Re:600k concurrent websocket connections on AWS using Node.j... by nevertoolate on Friday October 11, 2019 @11:50AM (#21225517)
Erlang is older, more suitable, more stable and less well known. Nobody mentioned that it is better because newer.
Re:600k concurrent websocket connections on AWS using Node.j... by SketchySeaBeast on Friday October 11, 2019 @12:02PM (#21225629)
No, but the person I'm responding to is implying that using old, known languages is somehow a bad thing.
Re:600k concurrent websocket connections on AWS using Node.j... by verttii on Friday October 11, 2019 @11:52AM (#21225542)
But in this concrete case his point is valid, I'd likewise expect Erlang's BEAM to outperform node.js in concurrency any day of the week. Elixir being new is fairly irrelevant because it compiles down to the same erlang BYTE CODE. Erlang is 30 years old.
Re:600k concurrent websocket connections on AWS using Node.j... by Thaxll on Friday October 11, 2019 @09:40AM (#21224226)
This is actually not true, if you take a really optimzied C/C++ library for WS Nodejs will crush Elixir by a large margin. Elixir / Erlang is slow and consume a lot of memories compared to more native languages or C libraries.

Ex: https://github.com/uNetworking/uWebSockets

Re:600k concurrent websocket connections on AWS using Node.j... by PopeDotNinja on Friday October 11, 2019 @12:15PM (#21225765)
Isn't this like saying one can bolt a rocket onto a Ford to make it much faster than a Toyota? One can incorporate C/C++ into Elixir, too.
Re:600k concurrent websocket connections on AWS using Node.j... by codesushi42 on Friday October 11, 2019 @12:31PM (#21225913)
At that point, you may as well implement your own server in C++ using epoll.
Re:600k concurrent websocket connections on AWS using Node.j... by winrid on Saturday October 12, 2019 @09:29PM (#21237648)
Nah. Devs don't touch C++ code in this case.
Re:600k concurrent websocket connections on AWS using Node.j... by np_tedious on Friday October 11, 2019 @09:27AM (#21224112)
I don't understand people eating hot dogs. Hamburgers have...
Re:600k concurrent websocket connections on AWS using Node.j... by fokinsean on Friday October 11, 2019 @10:56AM (#21224981)
Guess you haven't heard what hot dogs are made from

/s

Re:600k concurrent websocket connections on AWS using Node.j... by GordonS on Friday October 11, 2019 @01:52PM (#21226713)
Hamburgers?
Re:600k concurrent websocket connections on AWS using Node.j... by monus21 on Friday October 11, 2019 @09:40AM (#21224220)
It's not about which is the best technology. The barrier to entry for Node.js is next to nothing and the size of the ecosystem is incomparable to Elixir. Which means tons of companies will go with Node and feed back to the ecosystem and so on...
Re:600k concurrent websocket connections on AWS using Node.j... by mtberatwork on Friday October 11, 2019 @12:59PM (#21226199)
If we are going on size of ecosystem/what companies are invested in/etc, then you may as well stick with Java and the JVM with something like Vert.x. No need for Node.
Re:600k concurrent websocket connections on AWS using Node.j... by PunchTornado on Friday October 11, 2019 @05:24PM (#21228612)
nodejs ecosystem is much larger than the java one. also the amount of money companies invested in node is at least on par with java. think only about google chrome.
Re:600k concurrent websocket connections on AWS using Node.j... by winrid on Saturday October 12, 2019 @11:12PM (#21238099)
There's no advantage to using Node in a lot of cases though. Maybe if you're creating a microservice to generate email html or something. Data/state management, stream/job processing? Java or Kotlin all the way.

I have written a lot of Node services. Spent six years doing it. Gimme Java plz.

Re:600k concurrent websocket connections on AWS using Node.j... by viraptor on Friday October 11, 2019 @05:33PM (#21228694)
> The barrier to entry for Node.js is next to nothing

Assuming existing experience with JS / npm / async style. If you don't have that, I'm not sure which would be harder to start with. Given a little bit of experience with each, I'd actually lean towards elixir being a simple choice. Then again it depends on whether you're cool with training new devs in case of lack of elixir people.

Re:600k concurrent websocket connections on AWS using Node.j... by runj__ on Friday October 11, 2019 @09:29AM (#21224126)
Because javascript is one of the most popular programming languages in the world and the pool of Elixir programmers is almost non-existent?
Re:600k concurrent websocket connections on AWS using Node.j... by anildigital on Friday October 11, 2019 @09:31AM (#21224142)
From this https://www.ycombinator.com/topcompanies/ Brex, Podium, PagerDuty use Elixir. They are in top YC companies, not a surprise.
Re:600k concurrent websocket connections on AWS using Node.j... by runj__ on Friday October 11, 2019 @09:34AM (#21224174)
Do you think they got big because they use it or do they use it because they're big?

Pre-optimization is the root of all evil, my dude.

Re:600k concurrent websocket connections on AWS using Node.j... by anildigital on Friday October 11, 2019 @09:37AM (#21224206)
@runj__ You should read this blog post by Brex founder. He really says how Elixir suited well to the problem they were trying to solve https://medium.com/brexeng/why-brex-chose-elixir-fe1a4f31319...
Re:600k concurrent websocket connections on AWS using Node.j... by conanbatt on Friday October 11, 2019 @10:01AM (#21224418)
In the end they picked it because they already knew it.
Re:600k concurrent websocket connections on AWS using Node.j... by tstrimple on Friday October 11, 2019 @01:51PM (#21226709)
That's still a really good reason to pick a technology right? Especially if speed to market is one of your goals.
Re:600k concurrent websocket connections on AWS using Node.j... by mateuszf on Friday October 11, 2019 @03:02PM (#21227358)
And that's the reason why most people chose Java(Script)
Re:600k concurrent websocket connections on AWS using Node.j... by ronsor on Friday October 11, 2019 @11:25AM (#21225268)
Discord used Elixir from the start
Re:600k concurrent websocket connections on AWS using Node.j... by IggleSniggle on Friday October 11, 2019 @09:33AM (#21224157)
Thanks for pointing those out. I would really like to switch to Elixir in my day job.
Re:600k concurrent websocket connections on AWS using Node.j... by cpursley on Friday October 11, 2019 @10:13AM (#21224539)
> pool of Elixir programmers is almost non-existent

Nonsense. There's more Elixir programmers (or at least those who want to program Elixir professionally) than there are Elixir jobs.

Re:600k concurrent websocket connections on AWS using Node.j... by fortydegrees on Friday October 11, 2019 @11:14AM (#21225157)
More Elixir programmers than Elixir jobs is not an incentive to learn and/or use a language.
Re:600k concurrent websocket connections on AWS using Node.j... by cpursley on Friday October 11, 2019 @01:06PM (#21226268)
No, but Elixir/Erlang OTP is worth learning in and of itself.
Re:600k concurrent websocket connections on AWS using Node.j... by ClumsyPilot on Friday October 11, 2019 @02:02PM (#21226820)
I mean, sure, but i already have a long list of that, probably longer than I can learn in a lifetime.

Things get prioritised when they help pay the bills

Re:600k concurrent websocket connections on AWS using Node.j... by IggleSniggle on Friday October 11, 2019 @09:32AM (#21224149)
I am totally with you on Elixir/ Phoenix. But using Node.js is about leveraging frontend devs to get productive on the backend fast. At least, I think that’s the idea. Maybe also leveraging Google’s dependence on V8 (and thus all the engineering love it gets), although I don’t think that’s really a great argument compared to the EVM.
Re:600k concurrent websocket connections on AWS using Node.j... by hombre_fatal on Friday October 11, 2019 @11:01AM (#21225029)
Well, Node.js is just good tech with a simple async-everything concurrency model.
Re:600k concurrent websocket connections on AWS using Node.j... by specialist on Friday October 11, 2019 @01:22PM (#21226446)
Ya. nodejs is "JavaScript bindings for libev".

Deno (also by Ryan Dahl) "TypeScript bindings for libev" may become a viable successor. https://deno.land/manual.html#introduction

Re:600k concurrent websocket connections on AWS using Node.j... by IggleSniggle on Friday October 11, 2019 @10:11PM (#21230140)
let’s hope so! Looks like a great project
Re:600k concurrent websocket connections on AWS using Node.j... by z3t4 on Friday October 11, 2019 @01:54PM (#21226743)
The difference in performance between any languages are very small, like only one order of magnitude, but it's usually possible to get two orders of magnitude better performance in any language by optimizing. Eg. If your manager wont allow you to cut the AWS bill 100x by doing some optimizations. He she/she will certainly not allow you to rewrite everything in another language in order to cut bills by 10x.
Re:600k concurrent websocket connections on AWS using Node.j... by tschellenbach on Friday October 11, 2019 @12:59PM (#21226197)
You could make the same argument comparing Elixir and Go, or Go and C++