title: What's the recommended index schema for dynamo for a typical crud application?
body: <p>I've been reading <a href="https://aws.amazon.com/blogs/database/choosing-the-right-dynamodb-partition-key/" rel="noreferrer">some DynamoDB index docs</a> and they've left me more confused than anything.  Let's clear the air with a concrete example.</p>
  
  <p>I have a simple calendar application, where I have an <code>events</code> table.  Here are the columns I have:</p>
  
  <pre><code>id: guid,
  name: string,
  startTimestamp: integer,
  calendarId: guid (foreign key in a traditional RDBMS model)
  ownerId: guid (foreign key in a traditional RDBMS model)
  </code></pre>
  
  <p>I'd like to perform queries such as:</p>
  
  <ul>
  <li>Get an event by ID</li>
  <li>Get all events where <code>calendarId = x</code> and <code>ownerId = y</code></li>
  <li>Get all events where <code>startTimestamp is between x and y</code> and <code>calendarId = z</code></li>
  </ul>
  
  <p>DynamoDB docs seem to heavily suggest avoiding using the event's ID as a partition/sort key here, so what's the recommended schema?</p>