This is a textbook preaggregation. Write your votes into an append-only table and use Dynamo streams (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html) to update pre-aggregated stats in a different table. Make sure you track timestamp and pk of the last processed event in case the process needs to be restarted.