i would like to convert an app i have created into a proper microservice, following all the usual practices.
However i am unable to understand how to achieve statelessness and horizontal scaling. This specific app does the following in short.
User A starts a sharing room and connects to a websocket
User B joins the sharing room and connects to a websocket
When a third service streams some binary data via tcp to this service, both users get the data via websockets
Think of it as video streaming to a group of people
I am trying to understand how i would manage enforcing the users to connect to the same instance, where the sharing room exists in memory, and how this could possibly become stateless.
One of my issues is that when User B makes the request to join this room, how will I know which instance holds this in memory?
Thank you