title: Distinct Counters in Cassandra
body: <p>To get some distribution of a measure , we use counters in Cassandra i.e., similar to group by in mysql. But if I want unique distribution of a measure - how do I do that ?</p>
  
  <p>Say I need daily distribution of users visiting a webpage - counters are very handy. Key will be day and value will be a counter. But for same webpage - If I need I need unique users distribution, how can I achieve using Cassandra?</p>
  
  <p>I can implement it in various ways - Read before write, Offline processing etc.
  I have also heard of bitmaps/hyper log log counters etc. Whats the easiest and simple solution that I can use in/on Cassandra to get unique daily distribution of users. I have volumes of couple of millions of events per day.</p>
  
  <p>Example:</p>
  
  <p>Say on 25/08/2013 - this is my webpage hits - user1, user2, user1, user3 </p>
  
  <p>On 26/08/2013 - user1, user2</p>
  
  <p>On 27/08/2013 - user2, user3, user4</p>
  
  <p>On 28/08/2013 - user1, user2, user1, user3</p>
  
  <p>My output should be </p>
  
  <blockquote>
    <p>25/08/2013 - 3 Unique users</p>
    
    <p>26/08/2013 - 2 unique users</p>
    
    <p>27/08/2013 - 3 unique users</p>
    
    <p>28/08/2013 - 3 unique users</p>
  </blockquote>
  
  <p>i.e., days vs unique users count.</p>
  
  <p>Thanks </p>