3

Hope all are fine, I have some confusion regarding Socket.IO and Nats.IO currently i have a mobile application which is using Socket.Io to broadcast crypto price data every 500 milliseconds to each active client. Currently application have 25k active user's and 400-500 clients connected to socket every time continuously now i have heard of micro-services and the first one come to my mind is Nats.Io. Now i'm confused between this two which protocol is right for my resources regarding of CPU, RAM etc. Please suggest do i need to move my production to Nats.Io for better performance and low the consumption of resources.

user12575366
  • 303
  • 1
  • 2
  • 8
  • Do you actually have performance issues when using socket.io? If not then there's no problem using it in production. If yes, then you should consider scaling your app. I can't comment on nats.io, but it seems that you are confusing it with microservice architecture, which is a completely different thing. – madmax Jun 20 '22 at 15:16
  • Socket.IO clearly mentions that its not for background service applications on mobile devices - it keeps an open connection to the server, will drain the battery much faster. Have you tested your mobile app for the same? Firebase Cloud Messaging is one option Socket.IO documentation mentions about - I do not know much about it so wont comment on it. NATS is for communication between microservices - your server side application, it is not meant for communication between server and mobile device nodes, you will incur much more operational and maintenance complexity. – Amogh Sarpotdar Jun 25 '22 at 15:00
  • Please take a look at [NATS vs Socket.IO](https://stackshare.io/stackups/nats-vs-socket-io) you can find other options too. – Eskandar Abedini Jun 26 '22 at 14:12

1 Answers1

0

I think you should connect with Socket.io right now. Because Socket.io have a good community to connect with any issues.

Alok Dubey
  • 54
  • 8