Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamodb streams in python

Tags:

I would like to read data from a dynamodb stream in python and the alternatives that i have found so far are

  1. Use dynamodb stream low level library functions (as described here): This solution however seems almost impossible to maintain in a production environment, with the application having to maintain the status of shards, etc.

  2. Use KCL library designed for reading Kinesis streams: The python version of the library seems unable to read from a dynamodb stream.

What are the options to successfully process dynamodb streams in python? (links to possible examples would be super helpful)

PS: I have considered using lambda function to process the dynamodb but for this task, I would like to read the stream in an application as it has to interact with other components which cannot be done via a lamda function.

like image 807
Ashish Avatar asked Apr 27 '16 11:04

Ashish


People also ask

What is DynamoDB streams for?

DynamoDB Streams is a powerful service that you can combine with other AWS services to solve many similar issues. When you enable DynamoDB Streams, it captures a time-ordered sequence of item-level modifications in a DynamoDB table and durably stores the information for up to 24 hours.

Can DynamoDB streams trigger Lambda?

With DynamoDB Streams, you can trigger a Lambda function to perform additional work each time a DynamoDB table is updated. Lambda reads records from the stream and invokes your function synchronously with an event that contains stream records.

Is DynamoDB streams real time?

The events generated by DynamoDB Streams are near-real-time but not real-time.


1 Answers

I would still suggest to use lambda. The setup is very easy as well as very robust (it's easy to manage retries,batching, downtimes...)

Then from your lambda invocation you could easily send your data in a convenient way to your existing program (including, but not limited to: SNS, SQS, a custom server webhook, sending the data to a custom pub/sub service you own...etc)

like image 168
aherve Avatar answered Sep 19 '22 11:09

aherve