title: How do I design a primary key for time-series data in DynamoDB?
body: <p>I have a data model that consists of 8 entity types and I need to design a DynamoDB NoSQL model around some access patterns. The access patterns are not entity specific so I am in the process of translating them, but most of the access patterns rely on getting items by a date range. From previous related questions, people usually assume that getting the item by both an itemID (Partition Key) and date range (Sort Key) is the norm, but in my case, I need to get all entities by a date range.</p>
  <p>This would mean the partition key is the entity type and the sort key is the date range. Am I correct with this statement?</p>
  <p>Given the large size of the data (&gt;100GB), I am not sure if this is true.</p>
  <h2>Update: List of access patterns and data example</h2>
  <p>The access patterns so far look like this:</p>
  <pre><code>Get all transactions during a given date range
  Get all transactions during a given date range for a given locationId
  Get all transactions during a given date range for a given departmentId
  Get all transactions during a given date range for a given categoryId
  Get all transactions during a given date range for a given productId
  Get all transactions during a given date range for a given transactionItemId
  Get all transactions during a given date range for a given supplierId
  Get all product on transactions during a given date range
  </code></pre>
  <p>And a transaction entity has the following attributes (I have only included a snippet but there are 52 attributes altogether):</p>
  <pre><code>identifier  
  confirmationNumber **(contains date information)**
  priceCurrency   
  discount    
  discountInvoiced    
  price   
  shippingAmount  
  subtotal    
  subtotalInclTax 
  .
  .
  .
  </code></pre>