Im trying to build my own social network / forum application, where people can add and like each others posts. Im using DynamoDB as my database with a single table. For the post liking functionality Im using a Lambda Function in combination with DynamoDB-Streams which aggregates the like attribute.
Currently Im working on a ranking mechanism for these user posts. With that I want to make sure my users can list the interesting posts in a forum in that point of time.
For that purpose, I read how reddit handles its ranking algorithm on this page.
I also read this question on Stackoverflow which is near to my, without a good answer imo.
My question is, how one would solve this problem with the help of the AWS ecosystem (Maybe even with DynamoDB and Lambda Functions alone ?)
EDIT:
My database schema looks something like this:
Partitionkey Sortkey likes ...
---------- -------- ------
forum#soccer 01.08.19 13:15
forum#baseball 22.08.19 20:11
post#soccer#Do you think FC Barcelona wins? 05.08.19 10:20 203
post#soccer#Which club is your favorite ? 05.08.19 10:20 2
like#Which club is your favorite ? John Wick
like#Which club is your favorite ? Walter White
...
With each insert of an item which starts with like# a lambdafunction is getting triggered and updates the post entry on column likes.
My aim is to query the trendiest posts of the current time. This should be possible with the available information like the creation time and like count of the post. Currently my query is just returing the newest posts