title: Rating Algorithm
body: <p>I'm trying to develop a rating system for an application I'm working on. Basically app allows you to rate an <b>object</b> from 1 to 5(represented by stars). But I of course know that keeping a rating count and adding the rating the number itself is <b>not</b> feasible.</p>
  
  <p>So the first thing that came up in my mind was <b>dividing the received rating by the total ratings given.</b> Like if the object has received the rating 2 from a user and if the number of times that object has been rated is 100 maybe adding the 2/100. However I believe this method is not good enough since 1)A naive approach 2) In order for me to get the number of times that object has been rated I have to do a look up on db which might end up having time complexity O(n)</p>
  
  <p>So I was wondering what alternative and possibly <b>better</b> ways to approach this problem?</p>