1

The AWS Docs show that DynamoDB streams can be consumed in 2 ways:

  1. DynamoDB Streams Kinesis adapter
  2. Lambda triggers

The docs say that "the Amazon Kinesis Adapter is the recommended way to consume streams from Amazon DynamoDB", so in what scenarios would I want to use lambda triggers instead?

For example, I have heard the example use case of updating a leaderboard for a multiplayer game. In this case, the stream could be consumed by lambdas which update the leaderboard in a different database. Is Lambda the preferred tool in this scenario?

Leeroy Hannigan
  • 11,409
  • 3
  • 14
  • 31
rusheb
  • 1,004
  • 9
  • 15

1 Answers1

1

Yes Lambda is by far the best approach to consume a stream from this type of use-case. When you consume a stream using a Lambda trigger, you do not have to pay for the stream GetRecords calls.

If you use KCA then you have to manage a DynamoDB table used for leases and you also have to manage configurations and pay for GetRecords.

This post will provide a good overview:

In dynamodb, what is the difference between using dynamo streams + lambda trigger versus kinesis streams + lambda trigger?

Leeroy Hannigan
  • 11,409
  • 3
  • 14
  • 31
  • Hi Lee, I believe the post which you linked is comparing _DynamoDB streams_ with _Kinesis Data Streams_. I think _Kinesis Data Streams_ is different to the _DynamoDB Streams Kinesis Adapter_. Am I mistaken? Also, I'm not sure what you meant by "KCA". Did you mean "KCL"? – rusheb Nov 30 '22 at 19:09
  • Kinesis Data Streams is typically consumed with the kinesis client adapter. But even with DynamoDB streams you have the overhead managing leases, a lease table and also paying for the reads from the stream. Lambda is by far the winner here. – Leeroy Hannigan Nov 30 '22 at 19:43