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
250
Mirroring Azure Cosmos DB in Microsoft Fabric
miyake
2
150
LLM 時代におさえておきたい Azure Serverless ファミリーまとめ / serverlessdaystokyo2023-llm-aoai
miyake
9
2.6k
Nuxt Studio を使ってみた / nuxt-studio-intro
miyake
1
810
Microsoft Build 2023 で発表された Cosmos DB の注目アップデート / Microsoft Build 2023 Cosmos DB update
miyake
1
810
祝 🎉 両方とも正式リリース! GitHub Codespaces と Nuxt3 で次世代開発体験 / codespaces-nuxt3
miyake
0
1.4k
Static Site Generator でサイト構築 / building sites with static site generator
miyake
1
320
Design and implementation of Cosmos DB Change Feed-centric architecture
miyake
0
930
Well-Architected Framework を活用した Azure 設計パターン / azure-well-architected-framework
miyake
2
1.4k
Other Decks in Technology
See All in Technology
Building Products in the LLM Era
ymatsuwitter
10
5.4k
個人開発から公式機能へ: PlaywrightとRailsをつなげた3年の軌跡
yusukeiwaki
11
3k
バックエンドエンジニアのためのフロントエンド入門 #devsumiC
panda_program
18
7.5k
プロセス改善による品質向上事例
tomasagi
2
2.6k
プロダクトエンジニア構想を立ち上げ、プロダクト志向な組織への成長を続けている話 / grow into a product-oriented organization
hiro_torii
1
200
一度 Expo の採用を断念したけど、 再度 Expo の導入を検討している話
ichiki1023
1
170
開発スピードは上がっている…品質はどうする? スピードと品質を両立させるためのプロダクト開発の進め方とは #DevSumi #DevSumiB / Agile And Quality
nihonbuson
2
2.9k
速くて安いWebサイトを作る
nishiharatsubasa
10
13k
開発組織のための セキュアコーディング研修の始め方
flatt_security
3
2.4k
2.5Dモデルのすべて
yu4u
2
860
OpenID BizDay#17 KYC WG活動報告(法人) / 20250219-BizDay17-KYC-legalidentity
oidfj
0
250
なぜ私は自分が使わないサービスを作るのか? / Why would I create a service that I would not use?
aiandrox
0
740
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Visualization
eitanlees
146
15k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
Into the Great Unknown - MozCon
thekraken
35
1.6k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Designing Experiences People Love
moore
140
23k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
Scaling GitHub
holman
459
140k
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