can you use dynamodb streams to have realtime triggers like firebase?

后端 未结 2 1574
-上瘾入骨i
-上瘾入骨i 2021-02-20 04:35

Looking through the new dynamodb streams feature, can you use it to do real-time push scenarios like a chat room? Or can you only poll the streams api to get periodic updates?<

2条回答
  •  清歌不尽
    2021-02-20 05:03

    Now that AWS IoT is available, you could do DynamoDB Streams > Lambda > AWS IoT > Browser over MQTT or Websockets. This works both ways - with the return path being simpler as AWS IoT can post to Dynamodb directly.

    Lambda receives a list of records from Dynamodb Streams and you can loop over the list and publish data to appropriate clients using MQTT topics structured per chat or user (/chat/{uuid} or /chat/joe).

提交回复
热议问题