Trending products based on view/likes/dislikes

redis, ruby, ruby-on-rails

Solution

This article gives a proper solution. http://sorentwo.com/2013/12/30/let-postgres-do-the-work.html

Problem

I have a list of products in which user can like and dislike the product. Like,dislike and number views count is stored in redis. Now, i want to fetch trending products based on view/likes and dislikes.Is there any gem or algorthim . Edit The data stored as `product: product_id: followers = [user.id]` i.e `product:4:followers = ["1", "3"]`

Original source