title: Redis page counter
body: <p>I am writing a flask app that will count page views from multiple websites. I've decided to use Redis and Redispy but I am having a hard time deciding how to structure. Originally I tried to have a something like this </p>
  
  <pre><code>redis.set("date:YYYYMMDD:site:sitename", 1)
  </code></pre>
  
  <p>I want to be able to query by date, or by site name and display the count value. I tried to use .keys to query by date or by site name but the REDIS docs say to avoid using keys.<br>
  So then I thought maybe I can use redis hashes:</p>
  
  <pre><code>redis.hset("date:YYYYMMDD", "site", "sitename")
  redis.hset("counter", 1)
  </code></pre>
  
  <p>Ultimately I want to be able run reports on site counters by site name, by date, or display all values from all dates.  I can't seem to find the right structure to allow me get what I want.</p>
  
  <p>Any suggestions would be greatly appreciated! I have not used REDIS before.</p>