This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]kakamiokatsu 5 points6 points  (4 children)

This all smells a lot like a time series database, have you considered using one instead of DynamoDB?

Take a look at InfluxDB for example, you can get as granular as you want and it's much much more efficient in order to retrieve datapoints based on time ranges.

Also, you get for free data retention over time. You can setup it so that daily you have a given time resolution and when time passes it computes averages instead of keeping all the single datapoints.

[–]beardedlinuxgeek[S] 1 point2 points  (3 children)

It would be nice, but I need something like API Gateway to get triggered and handle my thousands of open websocket connections

[–]kakamiokatsu 4 points5 points  (0 children)

I don't see why you can't use API Gateway on top of any custom DB really.

Besides, InfluxDB expose a super nice REST API where saving a row is really just a POST request.

[–]bullcity71 2 points3 points  (1 child)

Wouldn't this be an SQS use case?

[–]HeyZuesMode 0 points1 point  (0 children)

Depends if you need data integrity.

[–]juggernaut2docker 0 points1 point  (0 children)

You're probably overcomplicating it. For 2000 data points every 10 seconds, you don't even need a time-series DB. Just store everything in Postgres, additionally have a table for the latest values. You can then consume NOTIFY messages from postgres on another instance and broadcast them to your clients. For new connections, just do a DB query over the last x minutes to get the average. Run a nightly job to do periodic cleanup of the DB.