amazon-dynamodbamazon-dynamodb-streams

Separate table for time series and stats in a single table design on DynamoDB?


It seems contra-intuitive, but in most of the examples of single table designs I have seen they use a separate table for time series data and summary stats.

Why would we do this when we already have that single table?

In the examples I have seen there is a DynamoDB stream on the main table which updates or adds data to the stats table. Why not just have it push data back to the main table?

Are there any performance considerations?

I know that the same DynamoDB stream would trigger again when the new data gets pushed back, but with the recently released filters for streams, we could tell it to only trigger if the Type is not of "stats" or something along those lines.


Solution

  • Potential reasons to keep them separate, off the top of my head:

    Reasons to keep them together: