@adriennetacke

Delightful

Durable Function Patterns

Adrienne Tacke

Senior Developer Advocate

Who's familiar with Azure Functions?

Who's created one?

"I just need to do {insert small event-based task here}... WITHOUT provisioning resources first (but can dynamically scale if I need to) oh, and I only want to pay for the compute resources I use."
@adriennetacke

So, what are Durable Functions?

@adriennetacke
So, what are Durable Functions?

Durable Functions

{Code-first}
Stateful
Consolidated

How does it do that?

@adriennetacke

Function Types

Client

Function Types

Client

Orchestrator

Function Types

Client

Orchestrator

Activity

Function Types

Client
Orchestrator
Activity
Entity
@adriennetacke

What's happening under the hood?

@adriennetacke
What's happening under the hood?
Orchestrator
➡ Queue ✉
Activity

Orchestrator stops!

(Meanwhile, Activity Function does it's job...)

Activity
➡ Queue ✉ (result)
Orchestrator
💾 Result is stored
🔄 Reloads history
🤔 Decides
@adriennetacke

Deterministic Orchestrators

(in a single meme)

@adriennetacke

Durable Function Patterns

@adriennetacke
Durable Function Patterns
🤔
🤔
🤔
🤔
🤔
🤔
Function Chaining
🤔
🤔
🤔
🤔
🤔

Function Chaining pattern

Sequential; Output of one is Input of another (sound familiar?)

Function Chaining
🤔
🤔
🤔
🤔
🤔
Function Chaining
Fan Out/Fan In
🤔
🤔
🤔
🤔

Fan Out/Fan In pattern

Multiple functions executed in parallel, then combined

Tita Angelique
Tita Marivic
Tita Sheryl
Tita Andy
Function Chaining
Fan Out/Fan In
🤔
🤔
🤔
🤔
Function Chaining
Fan Out/Fan In
Async HTTP API
🤔
🤔
🤔

Async HTTP API pattern

Also known as Polling Consumer pattern. When client calls HTTP API, 202 result and URLs to check status are returned

Function Chaining
Fan Out/Fan In
Async HTTP API
🤔
🤔
🤔
Function Chaining
Fan Out/Fan In
Async HTTP API
Monitor
🤔
🤔

Monitor pattern

Mirror of Async HTTP API. Orchestration polls a service at regular intervals.

Function Chaining
Fan Out/Fan In
Async HTTP API
Monitor
🤔
🤔
Function Chaining
Fan Out/Fan In
Async HTTP API
Monitor
Human Interaction
🤔

Human Interaction pattern

Some workflows need human intervention (shocking!). Next steps require human interaction (or lack thereof).

Function Chaining
Fan Out/Fan In
Async HTTP API
Monitor
Human Interaction
🤔
Function Chaining
Fan Out/Fan In
Async HTTP API
Monitor
Human Interaction
Aggregator

Aggregator pattern

Collecting data over various sources and time periods into a single entity.

Function Chaining
Fan Out/Fan In
Async HTTP API
Monitor
Human Interaction
Aggregator

Maraming Salamat!

@adriennetacke