title: Hash or Sorted set in redis?
body: <p>I have an use case in my website wherein i am required to store user specific day to day statistics in the form like</p>
  
  <pre><code>user:1 {field1: value, field2: value, field3: value}
  </code></pre>
  
  <p>The above representation goes for n users
  Currently I have implemented it using sorted sets with fields representing value of the sorted set and value representing score. I am also setting a per day expiry on these keys.</p>
  
  <p>Considering the overhead of individual key creation and expiry when number of users turn out to be large, i am thinking of an alternate representation like below using hashes considering its advantages like the following</p>
  
  <pre><code>Map of field1 &lt;user_id, value&gt; 
  Map of field2 &lt;user_id, value&gt;
  Map of field3 &lt;user_id, value&gt;
  Also a map for expiry &lt;user_id, last_updated_time&gt;
  </code></pre>
  
  <p>I am confused whether to persist with the existing implementation or implement the use-case with hashes. Can someone please help?</p>