I am currently looking for ways to build a service that can handle around 100k-200k active concurrent websocket connections on production. It's wild seeing this article here. Does anyone know of any alternative ways to do this? Most people seem to suggest using Elixir but I wonder if I can achieve the same using a more "conventional" language such as Java or Golang.This article covers Node.js for me, I guess.
lawik|3 years ago
I don't see why there would be anything stopping Go from being similarly capable as it also has a good reputation for concurrency and what I hear does preemptive scheduling.
Java can probably do anything except be fun and lightweight so assuming you want to figure out the hoops to jump through. I assume it could..
Elixir can do it with the ergonomics and expressiveness of Python/Ruby. If you enjoy that level of abstraction I recommend it.
a_c|3 years ago
szundi|3 years ago
Also versatile.
inglor|3 years ago
r1ch|3 years ago
prox|3 years ago
tmikaeld|3 years ago
https://github.com/centrifugal/centrifugo (Server/Admin)
https://github.com/centrifugal/centrifuge (Server core)
https://github.com/centrifugal/centrifuge-js (Library)
It's a complete solution, including server, admin panel and client library.
latch|3 years ago
As a generalization (again, really depends what you're going to be doing), I'd expect people to get a lot further with a Go or Java based implementations. Specifically, if those connections are interacting with each other in any meaningful way, I think shared data is still too useful to pass up.
I've written a websocket server implementation in Zig(1) and Elixir(2)
(1) https://github.com/karlseguin/websocket.zig (2) https://github.com/karlseguin/exws
newjersey|3 years ago
What does this mean? What are some scenarios where connections interact with each other? I work with dotnet. To me, every request is standalone and doesn’t need to know any other request exists. At the most, I can see doing some kind of caching where if someone does a GET /person/12345 and someone else does the same, I maybe able to do some caching. However, I don’t think this is what you meant by shared data.
Did you mean like if someone does a PUT /person/12345/email hikingfan@gmail.com instead of the next get request reaching to the database, you keep it in the application memory and just use it?
Or am I completely missing the point and you’re talking about near real-time stuff like calls and screen sharing?
winrid|3 years ago
pritambarhate|3 years ago
It was being done 7-8 years ago. If you search you should find a few articles on this.
winrid|3 years ago
bob1029|3 years ago
tester756|3 years ago
Anyway - there's a lot of "non-standard" stuff in ASP's code there.
opendomain|3 years ago
unknown|3 years ago
[deleted]
norman784|3 years ago
Also IMHO it's better to have a strong typed language behind your project, if it will be big, dynamic languages and big projects tend to be a nightmare for me.
okal|3 years ago
* As a build/compile-time concern, using Node doesn't preclude strong-typing, so maintainability is also not a strong argument against the runtime itself, given you can use e.g. TypeScript.
hknmtt|3 years ago
Check out https://github.com/panjf2000/gnet, it also has some links at the end.
Sosh101|3 years ago