Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Rambolus1705yDid that way back with Socket.io. don't know if that is still the best way too go but I will be following this thread as I will have to do it again soon :)
-
v-vp34605ySocket.io is really popular and you get lot of help online with it. But in case of socketcluster and other libraries I found, I don't see much questions being answered on the internet.
Also socketcluster seems like it's not actively developed right now. Commits are not that frequent. The client libraries have not been updated in over two years. So I am not really sure if I should go for socketcluster because I don't want to run into some problem especially on the client side (like a security issue) and then bang my head over it and try to fix it myself. -
Rambolus1705yIf it's not actively maintained I wouldn't touch it with a ten feet pole if there was another way of doing it that is actually being maintained and there is an active community on it. It will save a lot of headaches
-
It'll work well but don't use promises or async/await.
Stick to old school callbacks instead as promises in JS and async/await are completely screwed up. -
I also would advocate for using socket.io
We use it at work and also in all of my own projects for its ease of use and also the wealth of information on it aka StackOverflow posts. -
v-vp34605yAfter doing some research on socket.io I have found out following things.
1. If u are writing an app that does not have to scale to huge number of users then socket.io is definitely very helpful as it reduces development time.
2. Socketi.io is bloated. It has abstractions over abstractions (which makes sense since it supports fallbacks and channel abstractions). So the performance is not really that great at high levels of concurrency. Source: https://itnext.io/efficient-pub-sub...
http://drewww.github.io/socket.io-b...
3. If you don't need long polling support then not using socket.io would be better as it will remove overheads associated with socket.io long polling.
4. The socket.io repo has 424 open issues but the commit frequency is very low.
5. Socket.io clients repos are essentially dead. So if you have any major issues with client libs then you are screwed. You cannot use websockets client libs as they wont support socket.io directly. -
v-vp34605yI feel websockets/ws library is the best option. Socket.io basically is an abstraction over ws module. The ws module will give more control and performance with a disadvantage that you will have to write logic for channels and other abstractions that you might need in your application.
Related Rants
Has anyone developed websocket server in Nodejs?
I am planning to use socketcluster. Has anyone had experience using it? Is it good or should I go for something else?
question
socketcluster
nodejs
realtime
websockets