title: Is this an appropriate use-case for Amazon DynamoDB / NoSQL?
body: <p>I'm working on a web application that uses a bunch of Amazon Web Services. I'd like to use DynamoDB for a particular part of the application but I'm not sure if it's an appropriate use-case.</p>
  
  <p>When a registered user on the site performs a "job", an entry is recorded and stored for that job. The job has a bunch of details associated with it, but the most relevant thing is that each job has a unique identifier and an associated username. Usernames are unique too, but there can of course be multiple job entries for the same user, each with different job identifiers.</p>
  
  <p>The <em>only</em> query that I need to perform on this data is: <em>give me all the job entries (and their associated details) for username <strong>X</em></strong>.</p>
  
  <p>I started to create a DynamoDB table but I'm not sure if it's right. My understanding is that the chosen hash key should be the key that's used for querying/indexing into the table, but it should be unique per item/row. Username is what I want to query by, but username will not be unique per item/row.</p>
  
  <p>If I make the job identifier the primary hash key and the username a secondary index, will that work? Can I have duplicate values for a secondary index? But that means I will never use the primary hash key for querying/indexing into the table, which is the whole point of it, isn't it?</p>
  
  <p>Is there something I'm missing, or is this just not a good fit for NoSQL.</p>
  
  <p><strong>Edit:</strong><br>
  The accepted answer helped me find out what I was looking for as well as <a href="https://stackoverflow.com/questions/12484635/query-dynamodb-with-non-hash-key-field-with-boto-python">this question</a>.</p>