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

gefragt vor 5 Jahren912 Aufrufe
2 Antworten
0
Akzeptierte Antwort

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
beantwortet vor 5 Jahren
0

Thank you very much for your suggestions!

beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen