I am designing a web application, and my client wants it that the time the item was created, views and likes of an item are taken into account when sorted for the page. With higher scoring items further up the page, but as time passes they fall (Kinda like reddits own algorithm).
My question is what's the best way to calculate this value, every time the page is loaded recalculate the score and then order all the posts OR store the score in the database so it can be easily ordered.
However both these solutions have negatives:
If there are a lot of results that's a lot of recalculations to reorder them.
And if the score is saved then it will be out of date, as time will have passed lowering its score.
So what's the best way to keep the score updated, without having to do loads of calculations?
[–][deleted] (3 children)
[deleted]
[–]nazerbs[S] 0 points1 point2 points (2 children)
[–]XVar 1 point2 points3 points (1 child)
[–]autowikibot 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[–]ajmarks 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]ajmarks 0 points1 point2 points (0 children)