SlideShare une entreprise Scribd logo
1  sur  32
Building stateful serverless orchestrations
with Azure Durable Functions
Callon Campbell
Microsoft MVP | Azure
@flying_maverick
About me
Callon Campbell
Azure Architect | Developer
Adastra
Microsoft MVP | Azure
 20 years enterprise development with Microsoft technologies – .NET (C#),
Azure, ASP.NET, Desktop, SQL, and Mobile
 Passionate about serverless and cloud-native application development,
with focus on app migration and modernization, app integration and data
analytics
 Blogging at https://TheFlyingMaverick.com
 Speaker at community events and meetups
 Organizer of “Canada’s Technology Triangle .NET User Group” in Kitchener,
Ontario
Agenda  Serverless refresher
 Serverless challenges
 Solutions through Durable Functions
 Storage provider options
 Demos
 Wrap up
The evolution of application platforms
4
Azure Functions
Run code when events occur
Event-driven scaling
No infrastructure management
Consumption pricing with free grant
What is Azure Functions?
Platform
Application
delivery
Operating
system
●●● ●●●
●●●
+
https://github.com/azure/azure-functions-host
(+other repos)
Azure Functions
host runtime
Azure Functions
Core Tools
Azure Functions
base Docker image
Azure Functions
.NET Docker image
Azure Functions
Node Docker image
●●●
Functions everywhere
Azure Functions Hosting Models
In-process
 Migrate from .NET Core 3.1 in-
process
 Need Durable Functions or
“rich” SDK type bindings
Isolated process
 Migrate from .NET 5 or .NET 6
isolated process
 Durable Functions now
supported in .NET 7*
Which one do I use?
What are the challenges in serverless?
Pattern #1: Function chaining
Problems:
• No visualization to show relationships between functions and queues
• Middle queues are an implementation detail – conceptual overhead
• Error handling adds a lot more complexity
Pattern #2: Fan-out/fan-in
Problems:
• Fanning-out is easy, but fanning-in is significantly more complicated
• Functions offers to help with this scenario today
• All the same problems as the previous pattern
Introducing Durable Functions
 Durable Functions is an extension of Azure Functions and is built on
top of the Durable Task Framework.
 Enables you to write long-running orchestration as a single function,
that is reliable, event-driven, and is stateful.
 Simplifies complex, stateful coordination requirements in serverless
applications
 Execution state is saved in an Azure Storage account, ensuring that
functions could recover automatically from any infrastructure failure
 Supports .NET (C#/F#), Java, JavaScript, TypeScript, Python, and
PowerShell.
Application Patterns
The primary use case for Durable Functions is simplifying complex,
stateful coordination requirements in serverless applications.
Typical application patterns that can benefit from Durable Functions:
 Function chaining
 Fan-out/fan-in
 Async HTTP APIs
 Monitoring
 Human interaction
 Aggregartor (stateful entities)
20
Durable Functions Components
What makes up Durable Functions:
 Starter Function
 Orchestrator Function
 Activity Function
Event Sourcing Log
Durable Functions uses a pattern called “Event Sourcing” to store state
in a backing storage account, which is how its made durable.
“Hello Amsterdam!”
[“Hello Amsterdam!”]
Orchestrator
Function
Activity
Function
Execution
History
var outputs = new List<string>();
outputs.Add(await context.CallActivityAsync<string>("SayHello", “Amsterdam"));
return outputs;
Orchestrator
Function
?
Activity
Function
“Hello Amsterdam!”
Orchestrator Started
Execution Started
Task Scheduled, SayHello, “Amsterdam”
Orchestrator Completed
Task Completed, “Hello Amsterdam!”
Orchestrator Started
Execution Completed, ["Hello Amsterdam!"]
Orchestrator Completed
How does it work?
Orchestration Constraints
 Orchestrator code must be deterministic
 Never use random numbers, DateTime.UtcNow, Guid.NewGuid(), etc.
 Use DurableOrchestrationContext.CurrentUtcDateTime
 Orchestrator code should be non-blocking. Never do I/O directly in
the orchestrator
 Do I/O in activity functions
 Don't write infinite loops
 Use DurableOrchestrationContext.ContinueAsNew()
Demo 1 – Hello Durable!
Function Chaining
Demo 2 – Configuration!
Demo 3 – Star Wars API!
Function Fan-out / Fan-in
New Storage Providers
Support for two new backend storage providers for storing durable runtime state,
“Netherite” and Microsoft SQL Server (including full support for Azure SQL
Database).
These new storage options allow you to:
• Run at higher scale
• Greater price-performance efficiency
• Greater portability compared to the default Azure Storage configuration
Limitations of Azure Storage Provider
Azure Storage has the following limitations:
• Limits on the number of transactions per second
• Strict data size limits for queue messages and Azure Table entities
• Hard to predict costs
• Can’t easily support certain enterprise business continuity requirements, such
as backup/restore and disaster recovery without data loss
• Azure only
Introducing “Netherite”
• The Netherite name originates from the world of Minecraft
• Developed by Microsoft Research, it combines Azure Event Hubs
with the FASTER database technology on top of Azure Page Blobs
• Supports significantly higher-throughput of orchestrations and
entities compared to other Durable storage providers
• More cost-effective for high-throughput loads
Performance
Benchmark
Single Azure Event Hubs throughput unit (1 TU), costing approximately $22/month USD on the Standard plan, running a
simple function-chaining sample with 5 activity calls running on the Azure Functions Elastic Premium plan.
Introducing SQL Server Provider
• SQL Server provider allows Durable Functions to run anywhere
• Azure SQL Database
• On-premises
• Docker Containers / Kubernetes
• IaaS
• Multi-Cloud
• Leverage your existing SQL Server investments
• Backup/restore
• Failover
• Encryption
• Compliance
• Easily integrate with existing SQL-based applications
Demo 4 – Netherite storage!
Alternate Storage Provider
Choosing the right storage provider
Azure Storage
 Generally available
 Dependencies:
 Azure Storage Account
(general purpose v1)
 Minimal setup
 Lowest minimum cost
 Consumption plan: Yes
 Elastic Premium plan: Yes
 Disconnected support: No
Netherite
 Generally available
 Dependencies:
 Azure Event Hubs
 Azure Storage Account
 Max throughput
 Lower cost at scale
 Consumption plan: No
 Elastic Premium plan -
requires runtime scale
monitoring
 Disconnected support: No
SQL Server
 Generally available
 Dependencies:
 SQL Server 2019 or Azure
SQL Database
 Runs anywhere
 Enterprise friendly
 Consumption plan: No
 Elastic Premium plan-
requires runtime scale
monitoring
 Disconnected support: Yes
In closing
 Input/output of functions should be serializable.
 Orchestration Functions can only call Activity Functions in the same
Function App.
 Don’t use an orchestration function to call a single activity function.
 Keep your orchestrations small.
 What changes together should be deployed together.
 Azure Durable Functions make managing state and complex
workflows easy and familiar.
What’s New
 Durable Function’s support for .NET 7.0 running in the isolated
worker process is now generally available (supports .NET 6.0 and
.NET Framework too!)
 However, not all features from in-process Durable Functions have
been migrated to the isolated worker. Known missing features are:
 Durable Entities
 CallHttpAsync
Let’s Connect
https://LinkedIn.com/in/CallonCampbell
@flying_maverick
Callon@CloudMavericks.ca
https://GitHub.com/CallonCampbell
References
• Azure Durable Functions documentation | Microsoft Learn
• Durable orchestrator code constraints - Azure Functions | Microsoft
Learn
• Handling errors in Durable Functions - Azure | Microsoft Learn
• Durable Functions storage providers - Azure | Microsoft Learn
• Overview of Durable Functions in the .NET isolated worker - Azure |
Microsoft Learn
• Task hubs in Durable Functions - Azure | Microsoft Learn
Thank You

Contenu connexe

Tendances

AAD B2Cでゆるっと真面目に認証しよう【Interact2019】
AAD B2Cでゆるっと真面目に認証しよう【Interact2019】AAD B2Cでゆるっと真面目に認証しよう【Interact2019】
AAD B2Cでゆるっと真面目に認証しよう【Interact2019】Tsubasa Yoshino
 
Azure vm introduction
Azure  vm introductionAzure  vm introduction
Azure vm introductionLalit Rawat
 
MS Interact 2019 - Azureサービスで実現するセキュリティ全体像
MS Interact 2019 - Azureサービスで実現するセキュリティ全体像 MS Interact 2019 - Azureサービスで実現するセキュリティ全体像
MS Interact 2019 - Azureサービスで実現するセキュリティ全体像 Ai Hayakawa
 
Introduction to Microsoft Azure
Introduction to Microsoft AzureIntroduction to Microsoft Azure
Introduction to Microsoft AzureGuy Barrette
 
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry ServiceAzure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry ServiceIlyas F ☁☁☁
 
Why kubernetes matters
Why kubernetes mattersWhy kubernetes matters
Why kubernetes mattersPlatform9
 
Azure Fundamentals Part 2
Azure Fundamentals Part 2Azure Fundamentals Part 2
Azure Fundamentals Part 2CCG
 
Azure role based access control (rbac)
Azure role based access control (rbac)Azure role based access control (rbac)
Azure role based access control (rbac)Srikanth Kappagantula
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudEberhard Wolff
 
Azure kubernetes service (aks)
Azure kubernetes service (aks)Azure kubernetes service (aks)
Azure kubernetes service (aks)Akash Agrawal
 
Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon Web Services
 
GitOps with Amazon EKS Anywhere by Dan Budris
GitOps with Amazon EKS Anywhere by Dan BudrisGitOps with Amazon EKS Anywhere by Dan Budris
GitOps with Amazon EKS Anywhere by Dan BudrisWeaveworks
 
Mastering Azure Monitor
Mastering Azure MonitorMastering Azure Monitor
Mastering Azure MonitorRichard Conway
 
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵Amazon Web Services Korea
 
Advanced Load Balancer/Traffic Manager and App Gateway for Microsoft Azure
Advanced Load Balancer/Traffic Manager and App Gateway for Microsoft AzureAdvanced Load Balancer/Traffic Manager and App Gateway for Microsoft Azure
Advanced Load Balancer/Traffic Manager and App Gateway for Microsoft AzureKemp
 
Azure Blueprints - 企業で期待される背景と特徴、活用方法
Azure Blueprints - 企業で期待される背景と特徴、活用方法Azure Blueprints - 企業で期待される背景と特徴、活用方法
Azure Blueprints - 企業で期待される背景と特徴、活用方法Toru Makabe
 

Tendances (20)

AAD B2Cでゆるっと真面目に認証しよう【Interact2019】
AAD B2Cでゆるっと真面目に認証しよう【Interact2019】AAD B2Cでゆるっと真面目に認証しよう【Interact2019】
AAD B2Cでゆるっと真面目に認証しよう【Interact2019】
 
AWS Fargate on EKS 실전 사용하기
AWS Fargate on EKS 실전 사용하기AWS Fargate on EKS 실전 사용하기
AWS Fargate on EKS 실전 사용하기
 
Azure vm introduction
Azure  vm introductionAzure  vm introduction
Azure vm introduction
 
Deep dive into AWS fargate
Deep dive into AWS fargateDeep dive into AWS fargate
Deep dive into AWS fargate
 
MS Interact 2019 - Azureサービスで実現するセキュリティ全体像
MS Interact 2019 - Azureサービスで実現するセキュリティ全体像 MS Interact 2019 - Azureサービスで実現するセキュリティ全体像
MS Interact 2019 - Azureサービスで実現するセキュリティ全体像
 
Veeam ONE v11a入門編の紹介
Veeam ONE v11a入門編の紹介Veeam ONE v11a入門編の紹介
Veeam ONE v11a入門編の紹介
 
Introduction to Microsoft Azure
Introduction to Microsoft AzureIntroduction to Microsoft Azure
Introduction to Microsoft Azure
 
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry ServiceAzure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
 
Why kubernetes matters
Why kubernetes mattersWhy kubernetes matters
Why kubernetes matters
 
Azure Fundamentals Part 2
Azure Fundamentals Part 2Azure Fundamentals Part 2
Azure Fundamentals Part 2
 
Azure role based access control (rbac)
Azure role based access control (rbac)Azure role based access control (rbac)
Azure role based access control (rbac)
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
Azure kubernetes service (aks)
Azure kubernetes service (aks)Azure kubernetes service (aks)
Azure kubernetes service (aks)
 
Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for Kubernetes
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
GitOps with Amazon EKS Anywhere by Dan Budris
GitOps with Amazon EKS Anywhere by Dan BudrisGitOps with Amazon EKS Anywhere by Dan Budris
GitOps with Amazon EKS Anywhere by Dan Budris
 
Mastering Azure Monitor
Mastering Azure MonitorMastering Azure Monitor
Mastering Azure Monitor
 
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 
Advanced Load Balancer/Traffic Manager and App Gateway for Microsoft Azure
Advanced Load Balancer/Traffic Manager and App Gateway for Microsoft AzureAdvanced Load Balancer/Traffic Manager and App Gateway for Microsoft Azure
Advanced Load Balancer/Traffic Manager and App Gateway for Microsoft Azure
 
Azure Blueprints - 企業で期待される背景と特徴、活用方法
Azure Blueprints - 企業で期待される背景と特徴、活用方法Azure Blueprints - 企業で期待される背景と特徴、活用方法
Azure Blueprints - 企業で期待される背景と特徴、活用方法
 

Similaire à Build stateful serverless apps with Azure Durable Functions

Azure Functions.pptx
Azure Functions.pptxAzure Functions.pptx
Azure Functions.pptxYachikaKamra
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBizTalk360
 
#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2Vincent Biret
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure FunctionsPushkar Saraf
 
Getting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated ModeGetting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated ModeCallon Campbell
 
BestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptxBestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptxCallon Campbell
 
#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting started#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting startedVincent Biret
 
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesGIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesPatrick Chanezon
 
Azure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overviewAzure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overviewGeorge Walters
 
Azure Serverless Toolbox
Azure Serverless ToolboxAzure Serverless Toolbox
Azure Serverless ToolboxJohan Eriksson
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiGirish Kalamati
 
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesDockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesPatrick Chanezon
 
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDocker, Inc.
 
Azure serverless architectures
Azure serverless architecturesAzure serverless architectures
Azure serverless architecturesBenoit Le Pichon
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...VMware Tanzu
 
#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learnedVincent Biret
 

Similaire à Build stateful serverless apps with Azure Durable Functions (20)

Azure Functions.pptx
Azure Functions.pptxAzure Functions.pptx
Azure Functions.pptx
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
Sky High With Azure
Sky High With AzureSky High With Azure
Sky High With Azure
 
#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
 
Getting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated ModeGetting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated Mode
 
BestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptxBestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptx
 
#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting started#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting started
 
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesGIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
 
Azure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overviewAzure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overview
 
Azure Serverless Toolbox
Azure Serverless ToolboxAzure Serverless Toolbox
Azure Serverless Toolbox
 
Azure Functions - Introduction
Azure Functions - IntroductionAzure Functions - Introduction
Azure Functions - Introduction
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish Kalamati
 
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesDockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
 
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
 
Azure serverless architectures
Azure serverless architecturesAzure serverless architectures
Azure serverless architectures
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
 
#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned
 
ServerLess by usama Azure fuctions.pptx
ServerLess by usama Azure fuctions.pptxServerLess by usama Azure fuctions.pptx
ServerLess by usama Azure fuctions.pptx
 

Plus de Callon Campbell

Global Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in AzureGlobal Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in AzureCallon Campbell
 
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...Callon Campbell
 
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyGlobal Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyCallon Campbell
 
Festive Tech Calendar 2021
Festive Tech Calendar 2021Festive Tech Calendar 2021
Festive Tech Calendar 2021Callon Campbell
 
Festive Tech Calendar 2022
Festive Tech Calendar 2022Festive Tech Calendar 2022
Festive Tech Calendar 2022Callon Campbell
 
Whats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptxWhats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptxCallon Campbell
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Callon Campbell
 
Building scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloudBuilding scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloudCallon Campbell
 
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)Callon Campbell
 
Developing scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .netDeveloping scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .netCallon Campbell
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API ManagementCallon Campbell
 
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)Callon Campbell
 
Centralized configuration with azure app configuration
Centralized configuration with azure app configurationCentralized configuration with azure app configuration
Centralized configuration with azure app configurationCallon Campbell
 
Creating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event GridCreating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event GridCallon Campbell
 
Getting Started with Azure Artifacts
Getting Started with Azure ArtifactsGetting Started with Azure Artifacts
Getting Started with Azure ArtifactsCallon Campbell
 
Serverless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable FunctionsServerless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable FunctionsCallon Campbell
 
Serverless Application Development with Azure
Serverless Application Development with AzureServerless Application Development with Azure
Serverless Application Development with AzureCallon Campbell
 
Introduction to Azure Event Grid
Introduction to Azure Event GridIntroduction to Azure Event Grid
Introduction to Azure Event GridCallon Campbell
 

Plus de Callon Campbell (20)

Global Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in AzureGlobal Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in Azure
 
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
 
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyGlobal Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
 
Festive Tech Calendar 2021
Festive Tech Calendar 2021Festive Tech Calendar 2021
Festive Tech Calendar 2021
 
Festive Tech Calendar 2022
Festive Tech Calendar 2022Festive Tech Calendar 2022
Festive Tech Calendar 2022
 
Whats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptxWhats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptx
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
 
Building scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloudBuilding scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloud
 
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
 
Developing scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .netDeveloping scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .net
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
 
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
 
Centralized configuration with azure app configuration
Centralized configuration with azure app configurationCentralized configuration with azure app configuration
Centralized configuration with azure app configuration
 
Creating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event GridCreating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event Grid
 
Getting Started with Azure Artifacts
Getting Started with Azure ArtifactsGetting Started with Azure Artifacts
Getting Started with Azure Artifacts
 
Serverless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable FunctionsServerless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable Functions
 
Azure DevOps in Action
Azure DevOps in ActionAzure DevOps in Action
Azure DevOps in Action
 
Tour of Azure DevOps
Tour of Azure DevOpsTour of Azure DevOps
Tour of Azure DevOps
 
Serverless Application Development with Azure
Serverless Application Development with AzureServerless Application Development with Azure
Serverless Application Development with Azure
 
Introduction to Azure Event Grid
Introduction to Azure Event GridIntroduction to Azure Event Grid
Introduction to Azure Event Grid
 

Dernier

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Build stateful serverless apps with Azure Durable Functions

  • 1. Building stateful serverless orchestrations with Azure Durable Functions Callon Campbell Microsoft MVP | Azure @flying_maverick
  • 2. About me Callon Campbell Azure Architect | Developer Adastra Microsoft MVP | Azure  20 years enterprise development with Microsoft technologies – .NET (C#), Azure, ASP.NET, Desktop, SQL, and Mobile  Passionate about serverless and cloud-native application development, with focus on app migration and modernization, app integration and data analytics  Blogging at https://TheFlyingMaverick.com  Speaker at community events and meetups  Organizer of “Canada’s Technology Triangle .NET User Group” in Kitchener, Ontario
  • 3. Agenda  Serverless refresher  Serverless challenges  Solutions through Durable Functions  Storage provider options  Demos  Wrap up
  • 4. The evolution of application platforms 4
  • 5. Azure Functions Run code when events occur Event-driven scaling No infrastructure management Consumption pricing with free grant
  • 6. What is Azure Functions?
  • 7. Platform Application delivery Operating system ●●● ●●● ●●● + https://github.com/azure/azure-functions-host (+other repos) Azure Functions host runtime Azure Functions Core Tools Azure Functions base Docker image Azure Functions .NET Docker image Azure Functions Node Docker image ●●● Functions everywhere
  • 8. Azure Functions Hosting Models In-process  Migrate from .NET Core 3.1 in- process  Need Durable Functions or “rich” SDK type bindings Isolated process  Migrate from .NET 5 or .NET 6 isolated process  Durable Functions now supported in .NET 7* Which one do I use?
  • 9. What are the challenges in serverless?
  • 10. Pattern #1: Function chaining Problems: • No visualization to show relationships between functions and queues • Middle queues are an implementation detail – conceptual overhead • Error handling adds a lot more complexity
  • 11. Pattern #2: Fan-out/fan-in Problems: • Fanning-out is easy, but fanning-in is significantly more complicated • Functions offers to help with this scenario today • All the same problems as the previous pattern
  • 12. Introducing Durable Functions  Durable Functions is an extension of Azure Functions and is built on top of the Durable Task Framework.  Enables you to write long-running orchestration as a single function, that is reliable, event-driven, and is stateful.  Simplifies complex, stateful coordination requirements in serverless applications  Execution state is saved in an Azure Storage account, ensuring that functions could recover automatically from any infrastructure failure  Supports .NET (C#/F#), Java, JavaScript, TypeScript, Python, and PowerShell.
  • 13. Application Patterns The primary use case for Durable Functions is simplifying complex, stateful coordination requirements in serverless applications. Typical application patterns that can benefit from Durable Functions:  Function chaining  Fan-out/fan-in  Async HTTP APIs  Monitoring  Human interaction  Aggregartor (stateful entities) 20
  • 14. Durable Functions Components What makes up Durable Functions:  Starter Function  Orchestrator Function  Activity Function
  • 15. Event Sourcing Log Durable Functions uses a pattern called “Event Sourcing” to store state in a backing storage account, which is how its made durable.
  • 16. “Hello Amsterdam!” [“Hello Amsterdam!”] Orchestrator Function Activity Function Execution History var outputs = new List<string>(); outputs.Add(await context.CallActivityAsync<string>("SayHello", “Amsterdam")); return outputs; Orchestrator Function ? Activity Function “Hello Amsterdam!” Orchestrator Started Execution Started Task Scheduled, SayHello, “Amsterdam” Orchestrator Completed Task Completed, “Hello Amsterdam!” Orchestrator Started Execution Completed, ["Hello Amsterdam!"] Orchestrator Completed How does it work?
  • 17. Orchestration Constraints  Orchestrator code must be deterministic  Never use random numbers, DateTime.UtcNow, Guid.NewGuid(), etc.  Use DurableOrchestrationContext.CurrentUtcDateTime  Orchestrator code should be non-blocking. Never do I/O directly in the orchestrator  Do I/O in activity functions  Don't write infinite loops  Use DurableOrchestrationContext.ContinueAsNew()
  • 18. Demo 1 – Hello Durable! Function Chaining
  • 19. Demo 2 – Configuration!
  • 20. Demo 3 – Star Wars API! Function Fan-out / Fan-in
  • 21. New Storage Providers Support for two new backend storage providers for storing durable runtime state, “Netherite” and Microsoft SQL Server (including full support for Azure SQL Database). These new storage options allow you to: • Run at higher scale • Greater price-performance efficiency • Greater portability compared to the default Azure Storage configuration
  • 22. Limitations of Azure Storage Provider Azure Storage has the following limitations: • Limits on the number of transactions per second • Strict data size limits for queue messages and Azure Table entities • Hard to predict costs • Can’t easily support certain enterprise business continuity requirements, such as backup/restore and disaster recovery without data loss • Azure only
  • 23. Introducing “Netherite” • The Netherite name originates from the world of Minecraft • Developed by Microsoft Research, it combines Azure Event Hubs with the FASTER database technology on top of Azure Page Blobs • Supports significantly higher-throughput of orchestrations and entities compared to other Durable storage providers • More cost-effective for high-throughput loads
  • 24. Performance Benchmark Single Azure Event Hubs throughput unit (1 TU), costing approximately $22/month USD on the Standard plan, running a simple function-chaining sample with 5 activity calls running on the Azure Functions Elastic Premium plan.
  • 25. Introducing SQL Server Provider • SQL Server provider allows Durable Functions to run anywhere • Azure SQL Database • On-premises • Docker Containers / Kubernetes • IaaS • Multi-Cloud • Leverage your existing SQL Server investments • Backup/restore • Failover • Encryption • Compliance • Easily integrate with existing SQL-based applications
  • 26. Demo 4 – Netherite storage! Alternate Storage Provider
  • 27. Choosing the right storage provider Azure Storage  Generally available  Dependencies:  Azure Storage Account (general purpose v1)  Minimal setup  Lowest minimum cost  Consumption plan: Yes  Elastic Premium plan: Yes  Disconnected support: No Netherite  Generally available  Dependencies:  Azure Event Hubs  Azure Storage Account  Max throughput  Lower cost at scale  Consumption plan: No  Elastic Premium plan - requires runtime scale monitoring  Disconnected support: No SQL Server  Generally available  Dependencies:  SQL Server 2019 or Azure SQL Database  Runs anywhere  Enterprise friendly  Consumption plan: No  Elastic Premium plan- requires runtime scale monitoring  Disconnected support: Yes
  • 28. In closing  Input/output of functions should be serializable.  Orchestration Functions can only call Activity Functions in the same Function App.  Don’t use an orchestration function to call a single activity function.  Keep your orchestrations small.  What changes together should be deployed together.  Azure Durable Functions make managing state and complex workflows easy and familiar.
  • 29. What’s New  Durable Function’s support for .NET 7.0 running in the isolated worker process is now generally available (supports .NET 6.0 and .NET Framework too!)  However, not all features from in-process Durable Functions have been migrated to the isolated worker. Known missing features are:  Durable Entities  CallHttpAsync
  • 31. References • Azure Durable Functions documentation | Microsoft Learn • Durable orchestrator code constraints - Azure Functions | Microsoft Learn • Handling errors in Durable Functions - Azure | Microsoft Learn • Durable Functions storage providers - Azure | Microsoft Learn • Overview of Durable Functions in the .NET isolated worker - Azure | Microsoft Learn • Task hubs in Durable Functions - Azure | Microsoft Learn

Notes de l'éditeur

  1. Serverless is the culmination of several iterations of cloud platforms. The evolution began with physical metal in the data center and progressed through Infrastructure as a Service (IaaS) and Platform as a Service (PaaS).
  2. Quick overview of Azure Functions - Don’t have to worry about infrastructure, that’s handled for you. - It will scale from not running to 1000s of instances and back down as needed. - As it scales you only pay for what you use.
  3. Dynamically and elastically scale to meet demand. Allows you as the developer get to focus on the fun stuff…your code and business logic. Everything else is taken cared for you. This drastically increases time to market.
  4. At the center of serverless is FaaS. Break it up into single responsibility. No state…but when you require state it gets tricky.
  5. Over the years we have seen an accelerated shift to adopting serverless and cloud native application architectures. Benefits to these architectures include decreased infrastructure costs and improved time to market, however it's still important to consider high availability and resiliency in your application design. In this session, Callon will talk about developing scalable enterprise serverless applications on Azure with .NET and use a real world example of a solution he developed and running in production.
  6. Function as a service (FaaS) platforms present a small delay on their first executions, known as cold start. This makes it challenging to adopt serverless functions for mission critical apps where a few seconds can make a huge difference.  Instead of billing per execution & mem used, Premium is based on the number of core seconds and mem used across warm and needed instances. Regardless of the function app timeout setting, 230 seconds (4min and 50sec) is the maximum amount of time that an HTTP triggered function can take to respond to a request. This is because of the default idle timeout of Azure Load Balancer. For longer processing times, consider using the Durable Functions async pattern or defer the actual work and return an immediate response.
  7. Better hardware, you can do a lot more now. Elastic scaling, bursts out nicely Networking options – I didn’t have time to show this but service endpoints and VNET integrations Reserved instance, helps with the cold start and long running. And custom containers.
  8. Functions is open source – runtime, core tools, docker images. Run it locally, its exactly what you see in the cloud. Very easy to get going and publish. Publish to Azure Functions services – consumption, app service, and premium (best of both worlds) There is also other places to run functions – Raspberry Pi, Kubernetes cluster, or on non-azure hosts and on-prem.
  9. For .NET, Azure Functions supports both in-process and isolated (out-of-process) execution models. Choose in-process if you are upgrading from .NET Core 3.1 Azure Functions or if you are looking for features, such as Durable Functions, that are currently only available to in-process apps. Isolated function apps provide more control of the function worker process and greater compatibility with libraries.
  10. Some sequencing that needs to happen and I have to chain them all together. If I want to parallel some work and then pull in the results into one function Waiting for external events Watcher pattern Long running http requests Human interaction and I don’t want to wait forever…I want a timeout. The answer to some of these is I don’t know. Let’s take a look at two patterns and how we can solve them
  11. Is an extension of Azure Functions and is built on top of the Durable Task Framework Allows you to write long-running, reliable, event-driven, and stateful logic while simplifying complex, stateful coordination in serverless applications The execution state is saved in an Azure Storage account, ensuring that functions can recover automatically from any infrastructure failure Ideal for situations where you want to chain functions together, fan-out/fan-in, HTTP API Async, Monitoring, Waiting on user interaction They automatically checkpoint their progress whenever the function awaits. Local state is never lost if the process recycles or the VM reboots.
  12. In Durable Functions we introduce the concept of an orchestrator function. The starter function triggers the orchestrator to start the execution. Often this starter function is an Http endpoint. Once the starter has called the orchestrator function, it goes to sleep for the rest of the day or until it’s triggered again. This reduces the cost significantly. The orchestrator function is responsible for calling and receiving the output of the activity functions (what you know as normal functions). The activity function output becomes part of the local state of the orchestrator function.
  13. So how does this all work?
  14. 23
  15. Orchestrator code must be deterministic, as it will be replayed multiple times and must produce the same result each time.
  16. .NET 7 with the new isolated process hosting model
  17. .NET 6 with the old in-process hosting model
  18. Azure Durable Functions now supports two new backend storage providers for storing durable runtime state, “Netherite” and Microsoft SQL Server (including full support for Azure SQL Database).   These new storage options allow you to: Run at higher scale Greater price-performance efficiency Greater portability compared to the default Azure Storage configuration
  19. The default Azure Storage configuration provider does have some limitations: Has limits on the number of transactions per second for a storage account Has strict data size limits for queue messages and Azure Table entities Costs can be hard to predict since they are per-transaction and have very limited support for batching Can’t easily support certain enterprise business continuity requirements, such as backup/restore and disaster recovery without data loss Can’t be used outside of the Azure cloud
  20. Looking at the GitHub repos - “Netherite” comes from the world of Minecraft and is the name of a rare material that is more durable than diamond, can float in lava, and cannot burn. The Netherite storage provider aspires to have similar qualities, but in the context of Durable Functions. Developed by Microsoft Research, it combines Azure Event Hubs with the FASTER database technology that sits on top of Azure Page Blobs Supports significantly higher-throughput and is more cost-effective for high-throughput loads
  21. The orchestrator used in this test is a simple function-chaining sample with 5 activity calls running on the Azure Functions Elastic Premium plan. As you can see the Netherite provider has considerable throughput compared to Azure Storage.
  22. While the Netherite provider was designed for maximum throughput, the Microsoft SQL Server provider for Durable Functions is designed for the needs of the enterprise, including the ability to decouple from the Azure cloud. With the ability to run Microsoft SQL anywhere, including on-premises servers, Edge devices, Linux Docker containers, on the Azure SQL Database serverless tier, and even on competitor cloud providers like AWS and GCP. This means you can run Durable Functions anywhere that Azure Functions can run, including your own Azure Arc-enabled Kubernetes clusters. The design of the Microsoft SQL storage provider for Durable Functions also makes it easy to integrate with existing SQL-based applications. When your function app starts up, it automatically provisions a set of tables, functions, and procedures in the target database within a “dt” schema (“dt” stands for Durable Tasks). You can easily monitor your orchestrations and entities by running SELECT queries against these tables. 
  23. The choice to use storage providers other than Azure Storage should be made carefully. Most function apps running in Azure should use the default Azure Storage provider for Durable Functions. However, there are important cost, scalability, and data management tradeoffs that should be considered when deciding whether to use an alternate storage provider. Either of these alternate storage providers can be configured without any code changes to your application if you so choose to try them out.