When I built SARAIKI STAR, my TikTok-style short-video app, the feed could not just be "newest first". With 140+ videos from a handful of creators, a naive feed repeats the same creator endlessly and buries new uploads. Here is the ranking I shipped.
The scoring formula
Every video gets a score in a Postgres function:
score = (likes*3 + comments*5 + shares*4 + saves*2 + views*0.05 + 15) / (age_hours + 2)^1.3
Comments weigh more than likes (they cost the viewer more effort), shares weigh almost as much, and the +15 constant gives brand-new videos a fair chance against old hits.…