windows azure アプリケーション設計を賢く行うための基本知識
TRANSCRIPT
Windows Azure アプリケーション設計を賢く行うための基本知識
日本マイクロソフト株式会社デベロッパー&プラットフォーム統括本部エバンジェリスト野村 一行
アジェンダ
• Windows Azure SDK から見るこれまでの歩み
• 現在の Windows Azure の基本性能
• これからの Windows Azure の方向性
これまでの歩み
マイクロソフト データセンターの進化
Portal Era Online App Era Web Services Era
Microsoft.com
First ISO 27001 cert
Microsoft 1st Data Center
1994-95 1997 2002 2004 2006 2008
Security Development Lifecycle
First SAS-70 cert
Trustworthy Computing Directive
Cloud Computing Era
2011+
PC Era
1980s
FISMA Cert
1989
Gen 1Gen 2
Gen 3Gen 4
Windows Azure のホスト場所
北米地域 ヨーロッパ地域
アジア太平洋地域
3 大陸に 6 つのデータ センター
アプリケーション展開時、任意のデータ センターを選択
南部拠点 - 米国
ヨーロッパ西部
北部拠点 - 米国
ヨーロッパ北部
東南アジア
アジア東部
Compute Storage
CachingCDN Service Bus
Database
VMs ReportingAccess Control
Windows Azure SDK リリース
2010 20112009 2012
1.0 1.1 1.2 1.3 1.4 1.5 1.6
Windows Azure SDK 1.02009/11• Visual Studio 2010 Beta 2 と VWD Express 2010 Beta 2 サ
ポート• Service Model UI• Service Hosting Runtime API• Windows Azure Diagnostics• Storage Client Library• 認証管理• Variable-size VM• Worker Role の外部エンドポイント• Local Resource Storage の永続化• Development Storage• 追加ロールテンプレート - ASP.NET MVC 2 (2010 only) 、 F#
worker roles (2010 only) 、 WCF Service Application web roles• Inter-role communication
Windows Azure SDK 1.12010/2• Windows Azure Drive• OS バージョンのサポート• バグのフィックス
Windows Azure SDK 1.22010/6• Visual Studio 2010 RTM サポート• .NET 4 サポート• Cloud storage explorer• 統合されたデプロイ• サービス モニタリング• IntelliTrace サポート
Windows Azure SDK 1.32010/11• Elevated Privilege と Full IIS• リモートデスクトップ• Windows Server 2008 R2 ロール• 複数のサービス管理者• Silverlight ベースの Windows Azure ポータルの新しいデザイン• 新しい diagnostic 情報• 新しいサインアップ プロセス• Windows Azure Virtual Machine ロール• Extra Small インスタンス• Windows Azure Marketplace• Windows Azure Connect
Windows Azure SDK 1.42011/3• Windows Azure Connect 更新• Azure Content Delivery Network• Windows Azure AppFabric 管理ポータルの Silverlight 対応
Windows Azure SDK 1.52011/9• エミュレーターの拡張• SDK ツールの拡張( csupload 、 csencrypt )• ASP.NET MVC3 Web ロール• Windows Azure Service Management API の追加と更新• ロール インスタンスの状態取得の追加• Azure AppFabric Service Bus 拡張• SQL Azure 管理ポータル更新
Windows Azure SDK 1.62011/11• SDK のリネーム( Windows Azure SDK for .NET )• Azure AppFabric ブランドを Windows Azure へ統合、 Service
Bus と Caching の拡張• HPC との統合、 Azure HPC Scheduler SDK の提供• Storage Client のマネージ API の更新• Windows Azure Storage エミュレーターの更新
Windows Azure の基本性能
クラウドへのサービス配置:高度 10,000 フィートから• パッケージをポータルへアップ
ロード• System Center Concero で IT Pro
がアップロード• Windows Azure ポータルで開発者
がアップロード• サービスパッケージは RDFE へ渡さ
れる• RDFE は対象リージョンやアフィ
ニティグループに基づき、サービスをファブリックコントローラ( FC )に送る
• FC はイメージをリポジトリにストアし、サービスを配置する
RDFEサービス
データセンター
ファブリックコントローラ
Windows Azure ポータルSystem Center AppManager
サービス
パッケージングと展開
Windows Azureへアップロード
Microsoft Visual Studio
Web Role
Worker Role
ノードのプロビジョニング
• ノードの電源オン• メンテナンス OS が
PXE ブート• エージェントがディスク
をフォーマットし、 Windows 配置サービス( WDS )経由でホスト OS をダウンロード
• ホスト OS がブート、Sysprep /specialize を実行し、リブート
• FC が “ホストエージェント” と接続
ファブリックコントローラ
RoleImagesRole
ImagesRole
Imagesロール
イメージ
イメージリポジトリ
Maintenance OS
Parent OS
Node
PXEサーバー
メンテナンス OS
Windows Azure
OS
Windows Azure
OS
FCホスト
エージェント
Windows Azure ハイパーバイサー
Windows 展開
サービス
Windows Azure のサイズ別仕様
インスタンス CPU(GHz)
メモリ ストレージ バンド幅
XS 1 (共有)
768 MB
20 GB 5 Mbps
S 1.6 1.7 GB 225 GB 100 Mbps
M 2 x 1.6 3.5 GB 490 GB 200 Mbps
L 4 x 1.6 7 GB 1000 GB 400 Mbps
XL 8 x 1.6 14 GB 2040 GB 800 Mbps
ロール インスタンスの VHD
Role Virtual Machine
C:\Resource Disk
D:\Windows
Differencing Disk
E:\ or F:\Role Image
Differencing Disk
Windows VHD Role VHD例:<LocalResources> <LocalStorage name=“myLocalDisk" sizeInMB="10“ cleanOnRoleRecycle="false" /></LocalResources>
フォールト ドメイン
99.95% アップタイムの保証各ロールで 2 つ以上のインスタンス化が必要
フォールト ドメインによってロール インスタンスが分離フォールト ドメインは VM を分離フォールト ドメインは冗長化を提供少なくともロールごとに 2 つのフォールト ドメインを設定
フォールト & アップグレード ドメインフォールト ドメイン共に障害を起こすことが予想されるリソースのグループすなわち、同じラック、同じサーバーファブリックコントローラーはフォールトドメインをまたがりインスタンスを分散させる既定は 2 つ
アップグレード ドメイン同時にアップグレードするリソースのグループServiceDefinition 内の upgradeDomainCount で指定既定は 5 つ
ファブリックコントローラーは、フォールト ドメインとロールにまたがりアップグレード ドメインを分割
フォールト & アップグレード ドメイン
Fault DomainRack
VM
VM
VM
VM
Fault DomainRack
VM
VM
VM
VM
U/G Domain #1
U/G Domain #2
U/G Domain #1
U/G Domain #2
ロールのライフサイクル
OnStart
Methods
Fabric C
alls
Run
OnStop
Events
Busy
Status
StatusCheck
Stopping
Ready
Busy
StatusCheck
StatusCheckRole
Lifetim
e
Requests R
oute
d
終了処理など(例:データの外部への永続化)は 30 秒
以内で!
Busy に設定することで、ロード バランサーから一時
的に離脱可能
15 秒ごとに FC がチェック
2 回応答しないと転送を停止
VM ロールの利用シナリオ
• アプリケーションのインストールが長時間( 5 分以上)かかる場合• アプリケーションのインストールを間違いやすい場合• アプリケーションのインストールに人間とのインタラクションがあ
る場合
& 追加ソフトウェア& Windows Azure Integration Components& 一般化(推奨)
Base.VHD
オンプレミス クラウド
プレビュー
Windows Azure Storage の内部
Storage Stamp
LB
StorageLocation Service
Blob ストレージへのアクセス : http://<account>.blob.core.windows.net/
データアクセス
Inter-stamp (Geo) replication
Partition Layer
Front-Ends
DFS Layer
Intra-stamp replication
Storage Stamp
LB
Partition Layer
Front-Ends
DFS Layer
Intra-stamp replication
データ抽象のスケーラビリティ
ストレージへアクセスするための名前空間http://<accountName>.<type>.core.windows.net/partitionName
ストレージをスケールアウトさせるための手法2つのレベルのスケーラビリティ :
1. ストレージアカウントを対象としたスケーラビリティ
2. ストレージアカウント内のBlob 、テーブルエンティティ、キューを対象としたスケーラビリティ
データ抽象のスケーラビリティ
ストレージへアクセスするための名前空間http://<accountName>.<type>.core.windows.net/partitionName
ストレージをスケールアウトさせるための手法2つのレベルのスケーラビリティ :
ストレージアカウントを対象としたスケーラビリティアカウントのスケーラビリティ目標値キャパシティ – 100 TB までトランザクション – 5000 エンティティ / 秒までバンド幅 – 3 Gbps まで
アカウントをまたがってデータを分割すれば上記の目標値を上回ることが可能
アカウント内のオブジェクトのスケーラビリティ
ストレージへアクセスするための名前空間http://<accountName>.<type>.core.windows.net/partitionName
ストレージをスケールアウトさせるための手法2つのレベルのスケーラビリティ :
ストレージアカウント内の Blob 、テーブルエンティティ、キューを対象としたスケーラビリティ単一の Blob – 60M バイト / 秒までテーブル内の単一の PartitionKey – 500 エンティティ / 秒まで単一のキュー - 500 メッセージ / 秒まで
SQL Azure アーキテクチャ
SQL Azure セッション接続管理
• ロックの消費 – 100万以上のロックをかけた場合• ログのサイズ – 単一のトランザクションで 1GB 以上になった場合• 未コミットのトランザクション – ログ位置の最初から最後までが
20% 以上離れた場合• TempDB のサイズと使用量 – セッションが 5GB 以上を使った場
合• 過度のメモリ消費 - 16MB 以上を 20 秒以上利用しているセッショ
ンから古い順に• 最大 DB サイズ – 契約しているサブスクリプションの最大値に達
した場合• アイドル接続 – オープンしてから 30 分以上アイドル状態である場
合• 長時間に渡るトランザクション – 24 時間が経過した場合• DoS 攻撃 – 特定の IP アドレスからの膨大な数のログインが失敗
した場合
接続が切断される主な条件
運用のための設計
• 接続が成功しても、アクセス時にもそのまま保持されているとは限らない
• 信頼できる接続を行うためにリトライ ロジックを入れるべき
• 接続制限をかからないよう配慮する• 参考となるリトライ パターン -
Best Practices for Handling Transient Conditions in SQL Azure Client Applications • http://windowsazurecat.com/2010/10/best-practices-for-
handling-transient-conditions-in-sql-azure-client-applications/
SQL Azure – 接続リトライ ロジック
これからの方向性
What’s New in Windows Azure
多様な言語
プレビュー
What’s New in Windows Azure
getting to node you
プレビュー
What’s New inWindows Azure Openness
MongoDBSolr / LuceneMemcached
プレビュー
SQL Azure Q4 2011
150 GBFederation
SQL Azure クエリ性能データ
これからの方向性
2010 2011 2012 20132009
Easy
• アカウント管理 : サインアップ、トライアル / オファー、 課金情報
• モニタリング : アプリケーション ヘルス、通知
• 開発 & デプロイ : ツール、 API 、サービス、 SDK
Open & Flexible
• VM ロール、 Azure Connect
• 開発言語の拡大 : .NET, Node.js, Java, PHP
• OS サポートの拡大 : Windows, Mac & Linux ( Git 、 REST API 、など)
Enterprise Ready
• SQL Azure: パフォーマンス、スケーラビリティ、サイズ、トラブルシューティング、ハイブリッドシナリオ
• ビッグデータ : Hadoop 、Complex Event Processing 、データ分析、他
• マイクロソフト製品との統合 : Office 365, Active Directory & System Center
参考資料:Windows Azure Compute• Windows Azure のサイズ別仕様
• 7 Things to Know About Windows Azure Capacity• http://technet.microsoft.com/en-us/cloud/Gg663909
• Windows Azure Training Kit - December 2011 Update• http://www.microsoft.com/download/en/
details.aspx?displaylang=en&id=8396 「 Presentations」より、• WindowsAzureCompute.pptx
• Introduction to Windows Azure: the cloud operating system• http://channel9.msdn.com/Events/BUILD/
BUILD2011/SAC-852F
参考資料:Windows Azure Storage• Inside Windows Azure storage: what's new and
under the hood deep dive• http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-
961T• Windows Azure Training Kit - December 2011
Update• http://www.microsoft.com/download/en/details.aspx?
displaylang=en&id=8396 「 Presentations」より、• InsideWindowsAzureStorage.pptx
• Windows Azure Storage: A Highly Available Cloud Storage Service with Strong Consistency• http://sigops.org/sosp/sosp11/current/2011-Cascais/
printable/11-calder.pdf
参考資料:SQL Azure• SQL Azure Connection Management
• http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-connection-management.aspx
• Inside SQL Azure• http://social.technet.microsoft.com/wiki/contents/articles/inside-
sql-azure.aspx• Best Practices for Handling Transient Conditions in SQL Azure
Client Applications• http://windowsazurecat.com/2010/10/best-practices-for-handling-
transient-conditions-in-sql-azure-client-applications/• Now Available: SQL Azure Q4 2011 Service Release
• http://blogs.msdn.com/b/windowsazure/archive/2011/12/12/now-available-sql-azure-q4-2011-service-release.aspx
• How to get to SQL Azure Query Performance Data• http://blogs.msdn.com/b/benko/archive/2011/12/15/how-to-get-
to-sql-azure-query-performance-data.aspx
参考資料:Windows Azure Services• Windows Azure Queues and Windows Azure
Service Bus Queues - Compared and Contrasted• http://msdn.microsoft.com/en-us/library/hh767287(VS.103).aspx
• Best Practices for Performance Improvements Using Service Bus Brokered Messaging• http://msdn.microsoft.com/en-us/library/hh528527.aspx
参考資料:Windows Azure SDK• Windows Azure SDK 1.3 以降の What’s new :
• http://msdn.microsoft.com/en-us/library/windowsazure/gg441573.aspx• MSDN ブログより:
• Windows Azure SDK 1.0• http://blogs.msdn.com/b/jnak/archive/2009/11/13/november-2009-release-of-the-windows-
azure-tools-and-sdk.aspx• Windows Azure SDK 1.1
• http://blogs.msdn.com/b/jnak/archive/2010/02/01/february-2010-release-of-the-windows-azure-tools-for-microsoft-visual-studio-v1-1.aspx
• Windows Azure SDK 1.2• http://blogs.msdn.com/b/jnak/archive/2010/06/07/june-2010-release-of-the-windows-azure-
tools-sdk.aspx• Windows Azure SDK 1.3
• http://blogs.msdn.com/b/windowsazure/archive/2010/11/29/just-released-windows-azure-sdk-1-3-and-the-new-windows-azure-management-portal.aspx
• Windows Azure SDK 1.4• http://blogs.msdn.com/b/windowsazure/archive/2011/03/09/now-available-updated-windows-
azure-sdk-and-windows-azure-management-portal.aspx• Windows Azure SDK 1.5
• http://blogs.msdn.com/b/windowsazure/archive/2011/09/15/announcing-windows-azure-sdk-1-5-windows-azure-tools-for-microsoft-visual-studio-2010-and-new-service-management-features.aspx
• Windows Azure SDK 1.6• http://blogs.msdn.com/b/windowsazure/archive/2011/11/14/updated-windows-azure-sdk-
amp-windows-azure-hpc-scheduler-sdk.aspx
.NET 開発者のための Azure 情報ページ
マイクロソフトのチームブログ
• Windows Azure ブログ• http://blogs.msdn.com/b/windowsazure/
日本における Azure カウンシル活動
Windows Azure 開発者向けホワイトペーパーhttp://msdn.microsoft.com/ja-jp/windowsazure/cc994380
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.