Websocket broadcasting messages issue

0

Our team have implemented websockets using serverless (lambda) architecture, which works great until scalability comes into picture. Is our understanding correct that currently is there is no way to broadcast messages to all websocket connected clients.

We have to manually store connection Ids, and every time we want to broadcast to all connected clients we need to retrieve all of those first, and then post a message to every single connection ID. If we are talking about broadcasting to more than 1000+ users with multiple websocket connections, surely latency will become an issue. Is there any alternative solution to this problem?

Edited by: KrishnaMK on Jul 23, 2019 1:06 PM

demandé il y a 5 ans912 vues
2 réponses
0
Réponse acceptée

There are 2 parts:

  1. Retrieve all connection Ids from where they are stored
  2. Post a message to every single connection id

#1 is totally up to you. Use in-memory cache or other solution which can reduce the latency.

For #2, at this time, your best shot would be using HTTP/2 multiplexing to send requests in parallel.

AWS
répondu il y a 5 ans
0

Thank you very much for your suggestions!

répondu il y a 5 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions