Session ID: APP012
http://microsoft-
events.jp/mstechsummit/session/#APP012
https://www.oreilly.co.jp/
books/9784873117607/
http://ec.nikkeibp.co.jp/
item/books/P98840.html
Microsoft Tech Summit
Azure Compute
Container Service
VM Scale Sets
Virtual Machines
Batch
App Service
Service Fabric
Cloud Services
Azure Functions
Azure Compute の
インフラ (IaaS)
高速、アジャイル
デプロイの統一フォーマット
ビルド、リリース、実行
巨大なコミュニティ
Dev Test Prod
コンテナー = OS仮想化
Contain
er
Contain
er
Contain
er
従来型のVM = ハードウェア仮想化
VM VM VM
Windows Server コンテナー
最高の速度、密度
Container Container Container
Hyper-V コンテナー
分離とパフォーマンス
Container Container Container
クラウド
IaaS
Dev
オーケスト
レーション
デプロイの
パッケージ化
Linux
コンテナー
Windows Server
コンテナー
Hyper-V
コンテナー
アプリ
Azure Compute の
プラットフォーム (PaaS)
Prescriptive
Microservices
Event-based
Azure App Service
クラウド アプリの構築とスケーリング
Web Apps
Mobile Apps
Logic Apps
API Apps
Azure Functions
Azure や外部サービスのイベントによって
起動される
実行回数あたりの料金
C#、Node.js などのコード
オープン ソースのランタイムをどこでも
実行可能
サーバーレス プラットフォーム
App
Service
Azure
Functions
サーバー管理なし
サーバーへのパッチ適用なし
サーバー ベースのスケーリングなし
細粒度のトランザクション
Service Fabric
マネージド フレームワーク
Azure でのマイクロサービス
Microsoft Tech Summit
Pla
n
1 Monitor + Learn
Releas
e
Develop + Test2
Development Production
4
3
https://12factor.net/ja/
•
•
•
•
•
•
•
•
•
•
•
•
モノリスのアプローチ マイクロサービスのアプローチ
• マイクロサービス アプリは、
機能を小さいサービスに分割
• 各サービスを独立して
デプロイし、複数のサーバー/
VM/コンテナーにわたって
サービスのインスタンスを
作成することで、スケール アウト
• モノリス (モノリシック アプリ)
には、ドメイン固有の機能が
含まれている
• 通常、機能レイヤー (Web、
ビジネス、データ) で分割される
• アプリを複数のサーバー/VM/コンテナーに
配置することで、スケーリング
アプリ 1 アプリ 2アプリ 1
• 単一のモノリシック DB
• 特定のテクノロジの階層
モノリスにおける
状態 (ステート)
マイクロサービスに
おける状態 (ステート)
• 相互接続されたマイクロサービス
• 通常、状態の範囲は 1 つのマイクロサービス
• 多様なテクノロジ
stateless
services
stateless services
with
separate stores
stateful
services
stateless
presentation
services
Thumbnail
Service
Thumbnail
ServicePhoto Share
Service
Photo Share
Service
Photo Share
Service
Photo Share
Service
Thumbnail
Service
Photo Share Service
Thumbnail
SharedLib-v7
Photo Share
Service
SharedLib-v1
Photo Share
Service
node.js
Thumbnail
Service
.NET
Photo Share
Service
V1
Thumbnail
Service
V1
Thumbnail
Service
SharedLib-v7
Thumbnail
Service
V2
SharedLib-v1
https://azure.microsoft.com/ja-jp/solutions/microservice-applications/
Service Fabric Team Blog
https://blogs.msdn.microsoft.com/azureservicefabric/tag/case-study/
Azure 他のクラウドオンプレミス開発環境
Service Fabric for
Windows Server
(GA)
Service Fabric
for Linux
(プレビュー)
Azure 他のクラウドオンプレミス開発環境
Azure Consistent Private Cloud Azure Public Cloud
VMs and VM Scale Sets
VM Extensions
Mesosphere/Swarm
Marathon/Chronos/Swarm
クラスター管理
コンテナー/サービスの
スケジューリング
ZooKeeperFederation and Reliability:
• Failover manager
• Cluster manager
• Naming
• Image store service
• Leader Election
Hosting
• Container activation and Monitoring
Balancing and Scheduling
• Resource Balancing & Placement
Application Programming Models
• Stateful/Stateless services
• Reliable Actors
• Reliable Services
• Health Monitoring
Communication Subsystem
• Service/Service Communication
• Sessions/Streams
•Healthmanagementanddiagnostics
•Testabilityframework
データセンター (Azure、オンプレミス、AWSなど)
ロード
バラン
サー
サーバー/VM #1
Service Fabric
アプリのコード
サーバー/VM #2
Service Fabric
アプリのコード サーバー/VM #3
Service Fabric
アプリのコード
サーバー/VM #4
Service Fabric
アプリのコード
サーバー/VM #5
Service Fabric
アプリのコード
管理
ポート 19080
Web リクエスト
ポート 80/443
• 数千ノードをサポート
• 自己回復
• スケールアウト/イン
Azure Cloud Services
(Web/Workerロール)
Azure Service Fabric
(マイクロサービス)
• VM あたり 1 つのサービス
インスタンス
• デプロイ、更新が遅い
• スケーリングが遅い
• 開発環境向けのエミュレーター
• マシン/VM あたり多数の
マイクロサービス
• デプロイ、更新が早い
• スケーリングが早い
• 開発環境向け単一マシン クラスター
Cloud Services Deployment
Web Application
Web role Web role
Worker Application
Worker role Worker role Worker role Worker role Worker role
Storage queue
Service Bus
Azure cache
Redis
Azure load
balancer
Operational
Insights
Table Storage
Azure SQL
database
Blob Storage
Storage queue
Table Storage
Service Bus
Azure SQL
database
Azure cache
Redis
Azure load
balancer
Node
Service
Fabric cluster
Node
Stateless Worker
Service
Node
Node Node
Stateless Web
Service
Stateless Worker
Service
Stateless Worker
Service
Stateless Worker
Service
Stateless Web
Service
Stateless Worker
Service
Operational
Insights
Blob Storage
Queues Storage
ステートレス サービス パターン
Front End
(Stateless
Web)
Stateless
Middle-tier
Compute
Cache
Load Balancer
Stateful
Middle-tier
Compute
ステートフル サービス パターン
設計の簡素化、遅延の削減
Front End
(Stateless
Web)
Load Balancer
Cold Data Stores
For Exhaust
(Optional)
cspkg
OPS
Inner Dev
Loop
Mocks
VM 自体の管理は「現時点では」自分で行う必要あり
OS修正プログラムは自動適用の予定あり
Microsoft Tech Summit
Microsoft Tech Summit
<ServiceManifest Name="QueueService" Version="1.0">
<ServiceTypes>
<StatefulServiceType ServiceTypeName=“QueueServiceType”
HasPersistedState="true" />
</ServiceTypes>
<CodePackage Name="Code" Version="1.0">
<EntryPoint>
<ExeHost>
<Program>ServiceHost.exe</Program>
</ExeHost>
</EntryPoint>
</CodePackage>
<ConfigPackage Name="Config" Version="1.0" />
<DataPackage Name="Data" Version="1.0" />
</ServiceManifest>
Guest Executables
(ゲスト実行可能ファイル)
• 任意の EXE を持ち込む
• 任意の言語/プログラミン
グ モデル
• アプリとしてパッケージン
グ
• バージョニング/更新/正常
性監視などの機能を追加
• コンテナー
Reliable Services
(サービス)
• ステートレス/ステートフル
• 同時実行性
• Reliable Collection に
よる状態管理
• 完全なプラットフォーム統
合
Reliable Actors
(アクター)
• ステートレス/ステートフル
なアクター オブジェクト
• 簡素化されたプログラミン
グ モデル
• 単一スレッド モデル
• コンピューティングと状態
のスケール アウトに最適
• IoT / ゲームなどで利用
Platform の一部機能は使えない:
ステートフル
<ServiceManifest Name="Pkg-Svc.Website" Version="1.0.0" …>
<ServiceTypes>
<StatelessServiceType ServiceTypeName="Svc.WebsiteType" UseImplicitHost="true"/>
</ServiceTypes>
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>node.exe</Program>
<Arguments>Server.js</Arguments>
</ExeHost>
</EntryPoint>
</CodePackage>
</ServiceManifest>
<ContainerHost>
<ImageName>myNodeImage:latest</ImageNa
<Commands></Commands>
</ContainerHost>
アプリケーション
レプリケーション レプリケーション
アプリ 1
アプリ 2
Node 5Node 4Node 3 Node 6Node 2Node 1
P2
S
S
S
P4
S
P1
S
P3S
S
S
更新ドメイン (UD) ごとに
更新を実施
更新は、アプリ内で
変更されたサービス、
そのコード/構成に限定
Node
Node
NodeNode
Node
Node
Service
Package
B
Service
Package
A
Microsoft Tech Summit
Microsoft Tech Summit
Azure
サービス
スタンドアロン
クラスター
開発
クラスター
Windows GA GA GA
Linux プレビュー - プレビュー
Mac - - プレビュー
(Linux VM)
ステートレス
サービス
ステートフル
サービス
アクター
ゲスト
実行可能
ファイル
コンテナー
Windows
クラスター
.NET .NET .NET Windows
Windows
コンテナー
(今後)
Linux
クラスター
(プレビュー)
Java
.NET
(今後)
Java
.NET
Linux
Linux
コンテナー
Microsoft Tech Summit
[Microsoft Tech Summit] Linux/Java にも対応! Azure Service Fabric を使ったマイクロサービス開発
[Microsoft Tech Summit] Linux/Java にも対応! Azure Service Fabric を使ったマイクロサービス開発
[Microsoft Tech Summit] Linux/Java にも対応! Azure Service Fabric を使ったマイクロサービス開発

[Microsoft Tech Summit] Linux/Java にも対応! Azure Service Fabric を使ったマイクロサービス開発