Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Azure Serverless 2019 Summer edition
Search
miyake
July 30, 2019
Technology
2
410
Azure Serverless 2019 Summer edition
Serverless Meetup Tokyo #13 で発表させていただいたスライドです。
miyake
July 30, 2019
Tweet
Share
More Decks by miyake
See All by miyake
Cosmos DB で持続可能な RAG を実現しよう!~ AOAI Dev Day ふりかえりを添えて / Sustainable RAG with Cosmos DB with recap AOAI Dev Day
miyake
0
240
Mirroring Azure Cosmos DB in Microsoft Fabric
miyake
2
140
LLM 時代におさえておきたい Azure Serverless ファミリーまとめ / serverlessdaystokyo2023-llm-aoai
miyake
9
2.6k
Nuxt Studio を使ってみた / nuxt-studio-intro
miyake
1
710
Microsoft Build 2023 で発表された Cosmos DB の注目アップデート / Microsoft Build 2023 Cosmos DB update
miyake
1
800
祝 🎉 両方とも正式リリース! GitHub Codespaces と Nuxt3 で次世代開発体験 / codespaces-nuxt3
miyake
0
1.4k
Static Site Generator でサイト構築 / building sites with static site generator
miyake
1
310
Design and implementation of Cosmos DB Change Feed-centric architecture
miyake
0
920
Well-Architected Framework を活用した Azure 設計パターン / azure-well-architected-framework
miyake
2
1.4k
Other Decks in Technology
See All in Technology
Docker Desktop で Docker を始めよう
zembutsu
PRO
1
210
今年一年で頑張ること / What I will do my best this year
pauli
1
240
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
300
LLM活用の現在とこれから:LayerXにおける事例とともに 2025/1 ver. / layerx-llm-202501
yuya4
3
200
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
320
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
210
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
150
トラブルシュートを楽しもう (wakamonog meeting 15)
recuraki
3
860
SREKaigi.pdf
_awache
1
140
財務データを題材に、 ETLとは何であるかを考える
shoe116
3
1.6k
CDKのコードレビューを楽にするパッケージcdk-mentorを作ってみた/cdk-mentor
tomoki10
0
210
comilioとCloudflare、そして未来へと向けて
oliver_diary
6
480
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Typedesign – Prime Four
hannesfritz
40
2.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Embracing the Ebb and Flow
colly
84
4.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
The Pragmatic Product Professional
lauravandoore
32
6.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Code Reviewing Like a Champion
maltzj
521
39k
YesSQL, Process and Tooling at Scale
rocio
170
14k
It's Worth the Effort
3n
184
28k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Transcript
Azure Serverless 2019 Summer edition Serverless Meetup Tokyo #13 1
About Me 三宅 和之 @kazuyukimiyake 株式会社ゼンアーキテクツ CTO Microsoft MVP (
for Microsoft Azure ) Azure/azure-functions-durable-extension Contributer Vue.js-jp, typescript-jp コアスタッフ PaaS がかりの部屋(Blog): https://k-miyake.github.io/blog/ 2
Serverless Community(JP) と私 いつも⼤変お世話になっております。感謝しかありません︕ 3
Serverless の定義 (※ このセッションでの定義) Serverless = BaaS ( Backend as
a Service) + FaaS ( Functions as a Service) martinfowler.com 記事 4
Azure Serverless ファミリー Azure Functions だけが Serverless ではない 5
Azure Serverless アーキテクチャ例#1 IoT データやクリックストリームのデータ処理フローを Serverless で構築 動画(くらでべ - de:code
2019 DP81): https://youtu.be/qBmNi3ZrsUk 6
Azure Serverless アーキテクチャ例#2 グローバルにスケールするアプリケーションを Serverless で構築 MS 本社の Matias Quaranta
が Azure Friday でデモを実施したアーキテクチャ 動画( Azure Friday )https://youtu.be/cfZUiVQIhTw 7
今⽇紹介するキーテクノロジー 1. Azure Functions 2. Azure Cosmos DB 3. Azure
SignalR Service 4. Azure SQL Database Serverless 8
キーテクノロジー: Azure Functions バインディングによりコード量が⼤幅に減る C# だけではない( Node.js オススメ︕ ) OSS
として開発されている- https://github.com/Azure/Azure-Functions V2 に進化した 9
トリガーとバインディング トリガー: イベントに応じて Function を発⽕ バインディング: I/O に関するコードを隠蔽し、コードをシンプルに保てる 10
Azure Functions は V2 へ進化(更新を推奨) Runtime を Host process と
Worker process に分離 新機能はほとんどが V2 のみをサポート (V1 はほぼメンテナンスされていない) 11
Premium Plan 登場 コールドスタート回避機能あり ⾼度なスケーリング設定が可能 インスタンスサイズ 最⼩/最⼤(200 まで) (※ プレビュー)
12
TypeScript サポート Node.js ベースでの Azure Functions 開発が安全・快適に︕ import { AzureFunction,
Context, HttpRequest } from "@azure/functions"; // API のペイロード定義 type Member = { name: string; isMember: boolean; }; // Function (HTTP トリガー) の実装 const httpTrigger: AzureFunction = async function( context: Context, req: HttpRequest): Promise<void> { const member = { name: req.body.name, isMember: true }; context.res = { status: 200, body: member }; }; export default httpTrigger; 13
Durable Functions "orchestrator function" を使⽤してステートフルワークフローを定義できる 2.0 で Entity Functions が追加(
≒ アクターモデル) 14
KEDA Kubernetes-based Event Driven Autoscaling Azure Functions のスケールコントローラ ーを応⽤して OSS
化 Microsoft と Redhat で共同開発 イベント駆動型 Pod をオートスケール可能 KEDA: イベント連動でスケール(0->1) HPC: リソースに応じたスケール(1->n) 15
キーテクノロジー: Azure Cosmos DB A globally distributed, massively scalable, multi-model
database service. 主な特⻑ サーバーレス - No infrastructure or VM management グローバル分散 - Turnkey geo-replication マルチモデル, マルチ API ストレージとスループットをエラスティックにスケール可能 99th パーセンタイル内に 10ms 以下のレイテンシーを SLA で保証 16
Cosmos DB Change Feed Serverless なマイクロサービスを実現するためのキーテクノロジー 同時に複数の Feed を出⼒可能(DB は稼働させながら追加可能)
17
Azure Functions CosmosDB Trigger Cosmos DB のデータ変更によって Azure Functions が発⽕する
複数の Change Feed を独⽴して配置可能 クロスパーテーションでデータにアクセスしたい場合に便利 18
キーテクノロジー: SignalR Service Web にリアルタイム通信機能を実装できるサービス WebSocket の Hub 機能が Serverless
化 19
CosmosDB トリガー + SignalR バインディングの例 import { AzureFunction, Context }
from "@azure/functions"; const cosmosDBTrigger: AzureFunction = async function( context: Context, documents: Tweet[] ): Promise<void> { // CosmosDB からのデータ⼊⼒確認 if (!!documents && documents.length > 0) { context.log("Document: ", documents[0].tweetText); } // SignalR へのメッセージ登録 context.bindings.signalRMessages = [ { target: "newMessage", arguments: [documents] } ]; }; 20
signalr.js によるクライアント側の実装 created: async function(): Promise<void> { // SignalRとコネクションを作成 const
connection = new HubConnectionBuilder() .withUrl(this.baseUrl) .configureLogging(LogLevel.Information) .build(); console.log("connecting..."); // SignalR Serviceへの接続 connection .start() .then(() => console.log("connected!")) .catch(console.error); // SignalRからの呼び出し connection.on("newMessage", (tweets: Tweet[]) => this.displayTweet(tweets)); // 切断 connection.onclose(() => console.log("disconnected")); } 21
キーテクノロジー: SQL DB Serverless (プレビュー) ⼀定時間アクセスしなければ、インスタンスが停⽌する 課⾦も⽌まるため、コストを最適化できる 再始動時やオートスケール時はコールドスタートなので⽤途は選ぶ 22
Azure Serverless の課題(個⼈的⾒解) フロントエンド SPA ベース Web アプリのデプロイ先が。。 SPA にとって
App Service はオーバースペック Static Website ホスティング機能がショボい Firebase や Netlify 相当の機能が求められる 23
本⽇のまとめ Azure Serverless は FaaS (Azure Functions) だけではない Serverless だけでも幅広いシナリオに対応したアーキテクチャを実現できる
OSS プロダクトが多いので、コントリビュートしましょう︕ 本⽇話せなかったこと Serverless での分散トレーシング(App Insights) Serverless なマイクロサービスの⼀括デプロイ(ARM Template) Smart Store リファレンスアーキテクチャ 24
ご清聴ありがとうございました Special Thanks! @yokawasa (Microsoft) @Ealsur (Microsoft) @shibayan(Microsoft MVP) @dz_(Microsoft
MVP) のステッカーご希望の⽅はお声がけ下さい 25