Dynamo DB Kinesis Steams Best Practice

0

Hi,

My customer currently has a large DynamoDB table with DynamoDB Streams enabled and two Lambda consumers of the Stream. They wish to be able to handle up to five additional consumers, but are aware of potential throttling if more than two consumers are reading from the same stream. They are considering using a Kinesis Data Steam for DynamoDB to fan-out the events to the additional consumers, they have raised the following questions:

  1. Is it good practice to add the Kinesis Data Steam for DynamoDB with the existing DynamoDB Stream and two Lambda consumers still in place, or should they look at removing the existing DynamoDB Stream and use the Kinesis Data Steam for DynamoDB for all consumers?
  2. Any pitfalls they should be aware of when using a Kinesis Data Steam for DynamoDB vs DynamoDB Streams? Ones I can thin of are:
  3. When using Kinesis Data Steam for DynamoDB records may appear in a different sequence than the actual modifications to the item, where in a DynamoDB Steam the records appear in a time-ordered sequence
  4. The number of Kinesis Data Steam Shards will need to be managed when using Kinesis Data Steam for DynamoDB where this is managed for you when using DynamoDB Streams.

Any guidance much appreciated.

Thanks

AWS
Pete_D
已提问 3 年前2054 查看次数
1 回答
2
已接受的回答

To help answer your questions:

  1. Its always better to create 1 stream from DDB, either DDB streams or a Kinesis. So if your customer is planning to use more than 2 consumers, I would suggest them to move to Kinesis streams and then have all their Lambda consume from Kinesis. You also get the advantage of data retention over DDB streams.
  2. Besides the ones that you have mentioned:
    • a. Stream records may appear more than once in the Kinesis data stream. You can use the timestamp attribute ApproximateCreationDateTime on each record to identify the actual order in which item modifications occurred, and to identify duplicate records in the stream.
    • b. Using Kinesis Data Streams for DynamoDB is subject to both Kinesis Data Streams pricing for the data stream and DynamoDB pricing for the source table. So beware of the additional costs involved of Kinesis plus DynamoDB charges for change data capture for Kinesis Data Streams. They have to also calculate the red. # of shards reqd based on their DDB table.
AWS
专家
Parnab
已回答 3 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则