rest – What is the correct architecture for communication between an HTTP server and a WS server on the same machine running in separate processes?

I have a Node.js HTTP REST API server and a Node.js WS server. I separated them into 2 entrypoints so that they can be more easily debugged and run separated from each other, but now I need the REST API to produce results inside the WS server, to send specific data to WS clients that are connected, depending on which of them are connected. I want to send data from REST server to the WS server so that there is no polling or inefficient DB queries. A vague idea formed in my mind: IPC. Is this the best way to do it? I never did it before. I deploy both server programs on a Linux server computer and I wish to be able to do debugging as easy as until this point in time.

Read more here: Source link