简体   繁体   中英

Streams with initial state

I would like to expose something like a subscription or a "sticky query": the goal is to query DynamoDB and return the results via the WebSockets API in API Gateway. Well, whenever DynamoDB changes in a way the query would be affected (I guess I could use Streams for that) I would like to notify the client(s). How can I make sure the client gets the initial list and all updates? I would like to make sure the client doesn't miss any updates right after the subscription is created and before the initial list of results is returned to it...

To inform your clients about changes in your DynamoDB, DynamoDB Streams could be used. However, the information is only available for 24 hours. Even if you write your updates to a Kinesis Stream , your information will be available for a maximum of 7 days (according to the FAQ )

I suggest splitting your use-case in two:

  • Create a service where you return the initial state of your "sticky query"
  • Create a stream which will notify your clients about updates to the "sticky query"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM