I am working on social platform with a distributed architecture. The platform should offer a chat module, but since the most efficient way to implement a chat is using websockets
. I am not sure what part of my architecture should have the websockets
server.
Basically, I want my system to have an api gateway component that will route all the requests to the appropriate microservice, I will implement this as a simple http
server. But when it comes to handling the chat messages, there has to be a websockets server somewhere in my architecture.
Is it a good design decision to have 2 servers in my api gateway: one http
server to handle regular http
requests and other websockets
server to handle chat specific actions (talking with a peer for example)?
Would it be a better design decision to completly decoulpe the websockets
server from the api gateway?