Do I make a web socket server?

I decided to split my node js app into several microservices(chat, etc.) to Each micro service is required to create events web socket. I made a separate socket-server and there is stored the state of all sockets. A socket server using redis communicates with the microservices on the mechanism of pub/sub.

If I made the right? I am embarrassed to have to write much more code.
July 8th 19 at 12:15
1 answer
July 8th 19 at 12:17
I am embarrassed to have to write much more code.


and there zeromq pub/sub

And so you have created a single point of failure, or a god object if you want. You should organize communication between services and not a single bus system.
it is necessary to keep the web socket connection to each process? it somehow is not beautiful seems to me, and the code on the client could complicate. About a common data bus I understand you. is that bad? - mustafa_Wiega commented on July 8th 19 at 12:20
: common data bus is like a god object. It either needs to be distributed and stateless (rabbitmq, kafka), or just different.

As to the complexity of the client's code - again. zeromq and all is well. - Allene_Crona78 commented on July 8th 19 at 12:23
you can any literature to recommend on the correct architecture of the project? - mustafa_Wiega commented on July 8th 19 at 12:26
: refer to the concept of coupling (coupling), cohesion (coupling, coupling) do not single point of failure and all will be well. You have now just the same single point of failure if the socket server is down - you have no micro service can't work. Well, again, if you ever decide that part of the microservices have to communicate via http for example for the sake of ease of development. - Allene_Crona78 commented on July 8th 19 at 12:29

Find more questions by tags Node.jsJavaScript