Hey everyone, I am having trouble with the performance of a DynamoDB table that stores posts and replies.
For posts, the PK is USER#<user-id> and the SK is POST#<post-id>#TIMESTAMP.
For replies, the PK is POST#<post-id> and the SK is REPLY#<reply-id>. #TIMESTAMP.
When there are thousands of replies to a post, it takes a long time to look up the most recent ones. Pagination only helps a little.
I'm not sure if it's better to put replies in a separate table or use a GSI.
Could anyone share tips, patterns, or experiences on how to handle high-fanout workloads in DynamoDB in the best way?