Friday 9 June 2017

Scan AWS DynamoDB records only when there is new information

I am struggling to work out something that seems like it would be so simple.

Here is some context: I have a web app, which has 6 graphs powered by D3 and this data is stored in one table in DynamoDB. I am using AWS and NodeJS with the awssdk.

I need to have the graphs updating in real-time when new information is added.

I currently have it set so that the scan function runs every 30 seconds for each graph, however, when I have multiple users it causes the db to be hit so many times that it maxes out the reads.

I want it so that when data in the database is updated, potentially the server will save that data to a document so that the users can poll that instead of the database itself and that doc will simply update when new info is added to the database.

Basically, any way to have it where dynamodb is only scanned when there is new information.

I was looking into using streams however I am completely lost on where to start and if that is the best approach to take.



via Sam Hunt

No comments:

Post a Comment