title: What is the recommended way to delete a large number of items from DynamoDB?
body: <p>I'm writing a simple logging service in DynamoDB.</p>
  
  <p>I have a logs table that is keyed by a user_id hash and a timestamp (Unix epoch int) range.</p>
  
  <p>When a user of the service terminates their account, I need to delete all items in the table, regardless of the range value.</p>
  
  <p>What is the recommended way of doing this sort of operation (Keeping in mind there could be millions of items to delete)?</p>
  
  <p>My options, as far as I can see are:</p>
  
  <p>A: Perform a Scan operation, calling delete on each returned item, until no items are left</p>
  
  <p>B: Perform a BatchGet operation, again calling delete on each item until none are left</p>
  
  <p>Both of these look terrible to me as they will take a long time.</p>
  
  <p>What I ideally want to do is call LogTable.DeleteItem(user_id) - Without supplying the range, and have it delete everything for me.</p>