SlideShare a Scribd company logo
Advanced design patterns
in action
Me – Chris Anderson @crandycodes
Senior Program Manager on Azure Functions
@crandcodes
Day job: Senior Program Manager Azure Functions
What is the right way to design a
serverless application?
42
Don’t Panic
What makes serverless applications
different than “serverful” applications?
Inherently event oriented
State must be externalized
Platform specific APIs for hosting logic
Don’t have to manage infrastructure
Really, though? “Serverful” applications
are:
Inherently Probably event oriented
State must should be externalized from business logic
Platform/framework specific APIs for hosting logic
Don’t have to manage infrastructure
So what’s really different?
Don’t have to manage infrastructure
In exchange, we took away all your existing
frameworks for solving problems
If I don’t have any existing
frameworks, what do I do now?
Taking inventory:
what does serverless leave us with?
Events Logic
Events are messages
What kinds of messages are there?
Actions – user clicked/navigated, order has been shipped
Data – status heartbeat, temperature readings, logs
Actions represent that something happened and
usually gets an individual response
Data usually gets aggregated, can create actions
https://aka.ms/messaging-services
@clemensv
Scenario
1. Manufacturing device sends us temperature data
periodically
2. When a threshold is crossed, we emit an event that
says the threshold has been crossed
3. When we see the event for threshold being
crossed, we emit an event which says we should
notify someone on the production line
Scenario
1. Manufacturing device sends us temperature data
periodically
2. When a threshold is crossed, we emit an event that
says the threshold has been crossed
3. When we see the event for threshold being
crossed, we emit an event which says we should
notify someone on the production line
Intents
When we intend something should happen, we can
think of that message has having intent.
Something that should happen, should eventually
have happened
Whether it has happened or not is state
Advanced design patterns in action
State
State? I thought serverless was
supposed to be stateless?
Stateless is for your logic, not your
application
Most applications, arguably, have state.
Serverless applications, largely, need to externalize
their state
Complexity of managing state is where the relative
dearth of frameworks for serverless applications can
be painful
Scenario: trading app
Jack
Jill
Trader app
status
update
accept
cancel
Scenario: trading app
Jack
Jill
Trader app
status
update
accept
unaccept
Store
Jack accepts
Jill accepts
Wait for both to
accept
Someone unaccepts
Yes, we’ve waited for 1 event, but what
about 2?
Approaches:
1. Each event publishes its status, and when it does, it also checks its fellow
event’s status and if both trades are in, it closes the deal.
2. Each event publishes its status, and then sends an event out that says it has
finished. When the finished event is received, it checks whether Jack and Jill
have agreed on a trade, and then closes the deal.
1 is probably good enough, but 2 has the advantage
of splitting up the logic for accepting trades and
closing trades.
Add a timer and notificationss
Jack
Jill
Trader app
status
update
accept
unaccept
Store
Jack accepts
Jill accepts
Wait for both to
accept
Someone unaccepts
Cancel
Now there were 3
If it weren’t for notifications, we could just add checks
so everytime we check the status or try to
update/accept the trade, we just enforce the timeout
and stick with option 1 from before
Luckily, if we went with option 2, we could add a
queue message scheduled in the future which would
attempt to cancel the trade if it is not done.
More actions, more complexity
We eventually have lots of actions, lots of different
rules for state
Many implementations move towards Event Sourcing
as the pattern for success
So I have to manage all this
manually? There’s no frameworks to
help me?
Sponsored by Microsoft
Introducing Durable Functions
Announcing “beta” release of Durable Functions -
https://aka.ms/durable-functions
Framework for managing more complex, stateful
orchestrations
• Expression of tasks in code
• Automatic persistence and check-pointing of program state
• Versioning of orchestrations and activities
• Async timers, orchestration composition
Complements and extends “code-less” orchestration
in Logic Apps via async HTTP friendly API
Introducing Binding Extensibility
Now in preview: binding extensibility
Durable Functions is just an extension to Azure
Functions
You can now create your own!
Author the extension in C# and use from any
language
Learn more at https://aka.ms/BYOB
Workflow
Fan in & fan out – (MapReduce)
Long Callbacks (Human interaction)

More Related Content

PPTX
Microservices in Action: putting microservice-based applications into production
PPTX
What it Means to be a Next-Generation Managed Service Provider
PPTX
Spring I_O 2024 - Flexible Spring with Event Sourcing.pptx
PDF
Incident Management in the Age of DevOps and SRE
PDF
Incident Management in the Age of DevOps and SRE
PPTX
WinSmart Technologies
PDF
Design Summit - Advanced policy state management - John Hardy
PDF
Join 2017_Deep Dive_Workflows with Zapier
Microservices in Action: putting microservice-based applications into production
What it Means to be a Next-Generation Managed Service Provider
Spring I_O 2024 - Flexible Spring with Event Sourcing.pptx
Incident Management in the Age of DevOps and SRE
Incident Management in the Age of DevOps and SRE
WinSmart Technologies
Design Summit - Advanced policy state management - John Hardy
Join 2017_Deep Dive_Workflows with Zapier

Similar to Advanced design patterns in action (20)

PDF
The Last Mile Continued: Incident Management
PDF
Long running processes in DDD
PPTX
Evolving toward devops through transaction centric monitoring
PPT
Automatic Assessment of Failure Recovery in Erlang Applications
PDF
How to write your database: the story about Event Store
PPTX
Crack the Domain with Event Storming By Vivek
PDF
Expo qa from user stories to automated acceptance tests with bdd
PDF
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
PPTX
Test execution
PPTX
Cerner APM Journey with AppDynamics
PPTX
Understanding Cross-site Request Forgery
PPTX
1-Software Construction and Development.pptx
PDF
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Hillel Solow's presentation
PPTX
"Don’t Run with Scissors: Serverless Security Survival Guide" | Hillel Solow,...
PPTX
2010 10 25 lean startup for wealthfront
PDF
Why i prefer_jira
PDF
Automatic Proactive Troubleshooting with IBM Rational Build Forge
PDF
Introduction to Apex Triggers
PDF
SELJE - VFP and IT Security.pdf
PPTX
Event Driven Architecture
The Last Mile Continued: Incident Management
Long running processes in DDD
Evolving toward devops through transaction centric monitoring
Automatic Assessment of Failure Recovery in Erlang Applications
How to write your database: the story about Event Store
Crack the Domain with Event Storming By Vivek
Expo qa from user stories to automated acceptance tests with bdd
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Test execution
Cerner APM Journey with AppDynamics
Understanding Cross-site Request Forgery
1-Software Construction and Development.pptx
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Hillel Solow's presentation
"Don’t Run with Scissors: Serverless Security Survival Guide" | Hillel Solow,...
2010 10 25 lean startup for wealthfront
Why i prefer_jira
Automatic Proactive Troubleshooting with IBM Rational Build Forge
Introduction to Apex Triggers
SELJE - VFP and IT Security.pdf
Event Driven Architecture
Ad

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Cloud computing and distributed systems.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
A comparative analysis of optical character recognition models for extracting...
Reach Out and Touch Someone: Haptics and Empathic Computing
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Ad

Advanced design patterns in action

  • 2. Me – Chris Anderson @crandycodes Senior Program Manager on Azure Functions @crandcodes Day job: Senior Program Manager Azure Functions
  • 3. What is the right way to design a serverless application?
  • 4. 42
  • 6. What makes serverless applications different than “serverful” applications? Inherently event oriented State must be externalized Platform specific APIs for hosting logic Don’t have to manage infrastructure
  • 7. Really, though? “Serverful” applications are: Inherently Probably event oriented State must should be externalized from business logic Platform/framework specific APIs for hosting logic Don’t have to manage infrastructure
  • 8. So what’s really different? Don’t have to manage infrastructure In exchange, we took away all your existing frameworks for solving problems
  • 9. If I don’t have any existing frameworks, what do I do now?
  • 10. Taking inventory: what does serverless leave us with? Events Logic
  • 11. Events are messages What kinds of messages are there? Actions – user clicked/navigated, order has been shipped Data – status heartbeat, temperature readings, logs Actions represent that something happened and usually gets an individual response Data usually gets aggregated, can create actions https://aka.ms/messaging-services @clemensv
  • 12. Scenario 1. Manufacturing device sends us temperature data periodically 2. When a threshold is crossed, we emit an event that says the threshold has been crossed 3. When we see the event for threshold being crossed, we emit an event which says we should notify someone on the production line
  • 13. Scenario 1. Manufacturing device sends us temperature data periodically 2. When a threshold is crossed, we emit an event that says the threshold has been crossed 3. When we see the event for threshold being crossed, we emit an event which says we should notify someone on the production line
  • 14. Intents When we intend something should happen, we can think of that message has having intent. Something that should happen, should eventually have happened Whether it has happened or not is state
  • 16. State
  • 17. State? I thought serverless was supposed to be stateless?
  • 18. Stateless is for your logic, not your application Most applications, arguably, have state. Serverless applications, largely, need to externalize their state Complexity of managing state is where the relative dearth of frameworks for serverless applications can be painful
  • 19. Scenario: trading app Jack Jill Trader app status update accept cancel
  • 20. Scenario: trading app Jack Jill Trader app status update accept unaccept Store Jack accepts Jill accepts Wait for both to accept Someone unaccepts
  • 21. Yes, we’ve waited for 1 event, but what about 2? Approaches: 1. Each event publishes its status, and when it does, it also checks its fellow event’s status and if both trades are in, it closes the deal. 2. Each event publishes its status, and then sends an event out that says it has finished. When the finished event is received, it checks whether Jack and Jill have agreed on a trade, and then closes the deal. 1 is probably good enough, but 2 has the advantage of splitting up the logic for accepting trades and closing trades.
  • 22. Add a timer and notificationss Jack Jill Trader app status update accept unaccept Store Jack accepts Jill accepts Wait for both to accept Someone unaccepts Cancel
  • 23. Now there were 3 If it weren’t for notifications, we could just add checks so everytime we check the status or try to update/accept the trade, we just enforce the timeout and stick with option 1 from before Luckily, if we went with option 2, we could add a queue message scheduled in the future which would attempt to cancel the trade if it is not done.
  • 24. More actions, more complexity We eventually have lots of actions, lots of different rules for state Many implementations move towards Event Sourcing as the pattern for success
  • 25. So I have to manage all this manually? There’s no frameworks to help me?
  • 27. Introducing Durable Functions Announcing “beta” release of Durable Functions - https://aka.ms/durable-functions Framework for managing more complex, stateful orchestrations • Expression of tasks in code • Automatic persistence and check-pointing of program state • Versioning of orchestrations and activities • Async timers, orchestration composition Complements and extends “code-less” orchestration in Logic Apps via async HTTP friendly API
  • 28. Introducing Binding Extensibility Now in preview: binding extensibility Durable Functions is just an extension to Azure Functions You can now create your own! Author the extension in C# and use from any language Learn more at https://aka.ms/BYOB
  • 30. Fan in & fan out – (MapReduce)
  • 31. Long Callbacks (Human interaction)