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

2回答
0
承認された回答

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
回答済み 5年前
0

Thank you very much for your suggestions!

回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン