How would you implement the Hacker News Ranking Algorithm with Mongodb
I have implemented Hacker News Ranking Algorithm with SQL in the past, but am totally lost on how to do it with MongoDB. Any ideas?
preferably not using map reduce.
preferably not using map reduce.
9 comments
[ 6.2 ms ] story [ 35.1 ms ] threadOur score was calculated by something like this:
Gravity being how quickly a post would fall. Notice the t+2 ... it added 2 hours to all posts in order to eliminate things that were recently posted with like one vote sitting at the top.Then we'd just run this function through the whole database periodically (every 5 minutes or something).
The best would probably actively update on votes and do a catchall operation on ones that haven't been voted on or all on a certain periodic cycle.
Could you share your experience building trees for comments in your project Exipe?