title: Redis sorted set with multiple score "columns"
body: <p>I have a need for a leaderboard where users are stored with a score AND a percentage of level completeness. I only need to be able to sort by score and get ranks by score.</p>
  
  <p>Using Redis' sorted sets a can easily store users' scores like so:</p>
  
  <pre><code>ZADD leaderboard:gamemode1 100 user1
  ZADD leaderboard:gamemode1 300 user2
  </code></pre>
  
  <p>however, I am struggelig to figure out, how to best store the percentage values belonging to the scores of <code>100</code> and <code>300</code>.</p>
  
  <p>Should I do something like this:</p>
  
  <pre><code>ZADD leaderboard:gamemode1 100 user1:29.45
  </code></pre>
  
  <p>where the <code>:29.45</code> is the percentage for user1's score of <code>100</code> in <code>gamemode1</code>? I think this will make it complicated to update user1's score for gamemode1 later.</p>
  
  <p>Or should I instead create a hashtable as a book-keeping mechanism, that stores all users' scores and percentages for all gamemodes?</p>
  
  <p>My concern about the hashtable approach is, that if I want to show a leaderboard of ~50 users with their score and percentage values, I will then have to query that hashtable 50 times to get the percentages, after pulling the top50 scores with <code>ZRANGE</code>. </p>
  
  <p>Does anyone have any input on how to construct this in a good way?</p>