I am working on web application which includes visualization - pie, bar, grid etc.
Application includes
Two technologies nodejs
and golang
.
Nodejs is used for performing simple operations, routing, validation etc.
Golang is used for db connection, processing data, etc.
Client(angularjs) will communicate to nodejs
server.
Nodejs
will talk to golang
server using socket.io
to get processed data.
Nodejs
will respond to client after getting processed data from golang.
Here is my question
Is there any drawback of using socket.io in this case?
Any suggestion or idea will be grateful.
This is mostly an opinion-based question, but I could see some drawbacks.
Socket.io is a solution designed to unify communications between a browser and a server. It is useful to implement highly dynamic web sites, and hides the different underlying solutions/protocols which are more or less well supported by the browsers (websockets, long polling, etc ...).
It is not really designed to communicate between two servers, even if it can probably be used for this as well. Since you can develop the node.js and Go servers, just choose an adequate protocol for that. You do not have to wrap it into a layer such as socket.io.
Go supports socket.io through third-parties libraries such as: https://github.com/googollee/go-socket.io
It is an extra dependency you have to handle for your application.
If you have node and go apps on the same machine consider using unix sockets https://www.npmjs.com/package/socket-model here the npm package for that.