title: best design solution to migrate data from SQL Azure to Azure Table
body: <p>In our service, we are using SQL Azure as the main storage, and Azure table for the backup storage. Everyday about 30GB data is collected and stored to SQL Azure. Since the data is no longer valid from the next day, we want to migrate the data from SQL Azure to Azure table every night. </p>
  
  <p>The question is.. what would be the most efficient way to migrate data from Azure to Azure table?</p>
  
  <p>The naive idea i came up with is to leverage the producer/consumer concept by using IDataReader. That is, first get a data reader by executing "select * from TABLE" and put data into a queue. At the same time, a set of threads are working to grab data from the queue, and insert them into Azure Table. </p>
  
  <p>Of course, the main disadvantage of this approach (i think) is that we need to maintain the opened connection for a long time (might be several hours). </p>
  
  <p>Another approach is to first copy data from SQL Azure table to local storage on Windows Azure, and use the same producer/consumer concept. In this approach we can disconnect the connection as soon as the copy is done. </p>
  
  <p>At this point, i'm not sure which one is better, or even either of them is a good design to implement. Could you suggest any good design solution for this problem?</p>
  
  <p>Thanks!</p>