7

私は、1 秒あたり約 200 回の長時間にわたってデータを収集するソフトウェアをいくつか持っています。これには SQL データベースが使用されます。Azure を使用して、多くの古い "アーカイブ" データを移動しようとしています。

ソフトウェアはマルチテナント型のアーキテクチャを採用しているため、1 テナントにつき 1 つの Azure テーブルを使用する予定です。各テナントはおそらく 10 ~ 20 の異なるメトリックを監視しているため、メトリック ID (int) をパーティション キーとして使用する予定です。

各メトリクスは 1 分あたり (最大) 1 つの読み取りしかないため、RowKey として DateTime.Ticks.ToString("d19") を使用する予定です。

ただし、これがどのようにスケーリングされるかについては、少し理解していません。誰かがこれを解決できることを望んでいました:

パフォーマンスのために、Azure は私のテーブルを partitionkey で分割する予定です。この場合、メトリックごとに 1 つのパーティションが作成されます。

ただし、私の行キーは約 5 年間のデータを表す可能性があるため、約 250 万行と見積もっています。

Azure は、行キーに基づいて分割するのに十分賢いですか、それとも将来のボトルネックを設計していますか? 私は通常、時期尚早に最適化しないことを知っていますが、通常ほど賢明ではないように思われる Azure のようなものを使用します!

私が正しい方向に進んでいるかどうか、またはデータをさらに多くのテーブルに分割する必要があるかどうかを教えてくれる Azure の専門家を探しています。

4

1 に答える 1

19

Few comments:

Apart from storing the data, you may also want to look into how you would want to retrieve the data as that may change your design considerably. Some of the questions you might want to ask yourself:

  • When I retrieve the data, will I always be retrieving the data for a particular metric and for a date/time range?
  • Or I need to retrieve the data for all metrics for a particular date/time range? If this is the case then you're looking at full table scan. Obviously you could avoid this by doing multiple queries (one query / PartitionKey)
  • Do I need to see the most latest results first or I don't really care. If it's former, then your RowKey strategy should be something like (DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks).ToString("d19").

Also since PartitionKey is a string value, you may want to convert int value to a string value with some "0" prepadding so that all your ids appear in order otherwise you'll get 1, 10, 11, .., 19, 2, ...etc.

To the best of my knowledge, Windows Azure partitions the data based on PartitionKey only and not the RowKey. Within a Partition, RowKey serves as unique key. Windows Azure will try and keep data with the same PartitionKey in the same node but since each node is a physical device (and thus has size limitation), the data may flow to another node as well.

You may want to read this blog post from Windows Azure Storage Team: http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx.

UPDATE Based on your comments below and some information from above, let's try and do some math. This is based on the latest scalability targets published here: http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/04/windows-azure-s-flat-network-storage-and-2012-scalability-targets.aspx. The documentation states that:

Single Table Partition– a table partition are all of the entities in a table with the same partition key value, and usually tables have many partitions. The throughput target for a single table partition is:

  • Up to 2,000 entities per second
  • Note, this is for a single partition, and not a single table. Therefore, a table with good partitioning, can process up to the 20,000 entities/second, which is the overall account target described above.

Now you mentioned that you've 10 - 20 different metric points and for for each metric point you'll write a maximum of 1 record per minute that means you would be writing a maximum of 20 entities / minute / table which is well under the scalability target of 2000 entities / second.

Now the question remains of reading. Assuming a user would read a maximum of 24 hours worth of data (i.e. 24 * 60 = 1440 points) per partition. Now assuming that the user gets the data for all 20 metrics for 1 day, then each user (thus each table) will fetch a maximum 28,800 data points. The question that is left for you I guess is how many requests like this you can get per second to meet that threshold. If you could somehow extrapolate this information, I think you can reach some conclusion about the scalability of your architecture.

I would also recommend watching this video as well: http://channel9.msdn.com/Events/Build/2012/4-004.

Hope this helps.

于 2013-04-04T11:04:25.757 に答える