title: Deleting hundreds of entities from Azure Table Storage
body: <p>My coworker and I are currenty implementing a undo/redo feature for products. We're using the command pattern and saving every command (e.g. create component 'myFancyComponent') as a <code>TableStorageEntry</code> in the table 'ProductHistory'. <code>PartitionKey</code> in this table is the unique product name, <code>RowKey</code> is a unique identifier. </p>
  
  <p>Problem is if a product gets deleted, it should also delete the whole history in the table storage. Using batch delete could get quite complicated, because there are several limitations:  max. 100 entities  or max. 4 MB (whatever is the lesser). Are there any best practices for this problem? Or is the only solution to query all entries and checking the size of the entries and than batch delete the right amount of entries?</p>
  
  <p>I also found this similiar <a href="https://stackoverflow.com/questions/7393651/can-i-delete-an-entire-partition-in-windows-azure-table-storage">question</a> and considered to create a table for EACH product. It seems that there are some advantages of this approach:</p>
  
  <ul>
  <li>Selecting should be faster, because only one table will be queried</li>
  <li>Deleting is easy, just have to drop the whole table</li>
  </ul>
  
  <p>Only disadvantage I found (in the 'WINDOWS AZURE TABLE' - white paper):</p>
  
  <ul>
  <li>Note that, when a table is deleted, the same table name cannot be recreated for at least 30 seconds, while the table is being garbage collected.</li>
  </ul>
  
  <p>Are there any other (performance) issues, if I create several hundreds tables? </p>