SlideShare a Scribd company logo
"SERVERLESS" CQRS USING
AZURE EVENT GRID
Using Azure Event Grid as the backbone for a serverless CQRS architecture
DUBLIN
Lets trend! …
#GlobalAzure
@Merrion
AGENDA
• What is CQRS?
• What is event sourcing?
• How to do it on Event Grid
• Q & A
WHAT IS CQRS?
Command Query
Handler Handler
Expensive and terrifying
witchcraft
WHAT IS EVENT SOURCING?
Open
Account
Open
Account
Open
Account
Deposit Money
Deposit Money
Deposit Money
Withdraw
Money
Withdraw
Money
Close Account
$10.00
$10.00
$5.00
$5.00
$10.00
Aidan
00001
Margaret
00002
Fearghal
00003
PROJECTION
Opened
Account
Deposited
Money
Withdrew
Money
$10.00 $ 3.00
Event
Type
Action
Opened
Account
Skip
Deposited
Money
Increase balance by $
Withdrew
Money
Decrease balance by $
$10.00 $ 7.00
WHAT IS EVENT GRID?
Azure Event Grid uses a pay-
per-event pricing model, so
you only pay for what you use.
Command
Query
PUTTING THEM TOGETHER…
Implementation
WHAT YOU WILL NEED…
Azure subscription
Programming environment
Domain design
GETTING DATA IN… Command
Join Team
Register for race
Complete lap
Finish Race
Start race
PERSISTING THE EVENTS
What
Happened?
Who to / for?
123
456
GETTING THE DATA OUT Query
SHOW ME THE CODE !!!
DOMAINS
League Race Runner
RUNNING A COMMAND
Command Logger
Command Handler
Event(s) Persisted
Command Validator
RUNNING A QUERY
Query Logger
Query Handler
Results Cache
DEVOPS / SYSTEM MAINTENANCE
LESSONS LEARNED
• Keep your functions small (do only one business thing per
function)
• Hook up application insights to see inside your business
application
• Be wary of knitting together domains – you can make an anti
corruption layer in Event Grid
• Be careful with what can be parallel vs what cannot. (If things
have to happen in a sequence then have them trigger each
other as a function pipeline.)
• Only write the code that only you can write (business)
THE FINANCIALS
https://azure.microsoft.com/en-us/pricing/
Q & A ?
@Merrion
Expensive and terrifying
witchcraft
A BIG thank you to Dublin Sponsors!
A BIG thank you to the 2018 Global Sponsors!
XBOX & OTHER PRIZES…
FILL IN THE FORM!
https://aka.ms/azurebootcampireland

More Related Content

Similar to Serverless cqrs using azure event grid

Power Platform24: Essential Azure for Dynamics 365 Professionals
Power Platform24: Essential Azure for Dynamics 365 ProfessionalsPower Platform24: Essential Azure for Dynamics 365 Professionals
Power Platform24: Essential Azure for Dynamics 365 Professionals
Ali Khan
 
O365Con19 - Azure Blackbelt - Jussi Roine
O365Con19 - Azure Blackbelt - Jussi RoineO365Con19 - Azure Blackbelt - Jussi Roine
O365Con19 - Azure Blackbelt - Jussi Roine
NCCOMMS
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with Azure
Marco Parenzan
 
Azure 103 Certification Course
Azure 103 Certification CourseAzure 103 Certification Course
Azure 103 Certification Course
wiTTyMinds1
 
AWS Summit Milan - Opening Keynote
AWS Summit Milan - Opening KeynoteAWS Summit Milan - Opening Keynote
AWS Summit Milan - Opening KeynoteAmazon Web Services
 
Experts Live Norway - Azure Infrastructure Security
Experts Live Norway - Azure Infrastructure SecurityExperts Live Norway - Azure Infrastructure Security
Experts Live Norway - Azure Infrastructure Security
Tom Janetscheck
 
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptxGab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Vincent Thavonekham-Pro
 
AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...
AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...
AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...
Amazon Web Services
 
How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...
How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...
How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...
ScyllaDB
 
7.habits.every.azure.admin.must.have.v082020
7.habits.every.azure.admin.must.have.v0820207.habits.every.azure.admin.must.have.v082020
7.habits.every.azure.admin.must.have.v082020
Wim Matthyssen
 
Tour to Azure Security Center
Tour to Azure Security CenterTour to Azure Security Center
Tour to Azure Security Center
Lalit Rawat
 
Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...
Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...
Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...
Simplilearn
 
Microsoft azure
Microsoft azureMicrosoft azure
Microsoft azure
pushkar baviskar
 
How to build a serverless helmet detection system
How to build a serverless helmet detection systemHow to build a serverless helmet detection system
How to build a serverless helmet detection system
Mandar Dharmadhikari
 
Azure signalR
Azure signalRAzure signalR
Azure signalR
Christoffer Noring
 
Good Bye Credentials in Code, Welcome Azure Managed Identities
Good Bye Credentials in Code, Welcome Azure Managed IdentitiesGood Bye Credentials in Code, Welcome Azure Managed Identities
Good Bye Credentials in Code, Welcome Azure Managed Identities
Kasun Kodagoda
 
Deploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data SolutionsDeploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data Solutions
Marco Parenzan
 
Azuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data FactoryAzuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data Factory
Riccardo Perico
 
Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...
Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...
Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...
Edureka!
 
AzureCostManagementAndBilling
AzureCostManagementAndBillingAzureCostManagementAndBilling
AzureCostManagementAndBilling
Udaiappa Ramachandran
 

Similar to Serverless cqrs using azure event grid (20)

Power Platform24: Essential Azure for Dynamics 365 Professionals
Power Platform24: Essential Azure for Dynamics 365 ProfessionalsPower Platform24: Essential Azure for Dynamics 365 Professionals
Power Platform24: Essential Azure for Dynamics 365 Professionals
 
O365Con19 - Azure Blackbelt - Jussi Roine
O365Con19 - Azure Blackbelt - Jussi RoineO365Con19 - Azure Blackbelt - Jussi Roine
O365Con19 - Azure Blackbelt - Jussi Roine
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with Azure
 
Azure 103 Certification Course
Azure 103 Certification CourseAzure 103 Certification Course
Azure 103 Certification Course
 
AWS Summit Milan - Opening Keynote
AWS Summit Milan - Opening KeynoteAWS Summit Milan - Opening Keynote
AWS Summit Milan - Opening Keynote
 
Experts Live Norway - Azure Infrastructure Security
Experts Live Norway - Azure Infrastructure SecurityExperts Live Norway - Azure Infrastructure Security
Experts Live Norway - Azure Infrastructure Security
 
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptxGab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
 
AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...
AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...
AWS re:Invent 2016: Automating Security Event Response, from Idea to Code to ...
 
How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...
How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...
How Level Infinite Implemented CQRS and Event Sourcing on Top of Apache Pulsa...
 
7.habits.every.azure.admin.must.have.v082020
7.habits.every.azure.admin.must.have.v0820207.habits.every.azure.admin.must.have.v082020
7.habits.every.azure.admin.must.have.v082020
 
Tour to Azure Security Center
Tour to Azure Security CenterTour to Azure Security Center
Tour to Azure Security Center
 
Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...
Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...
Cloud Computing For Beginners | Cloud Computing Explained | Cloud Computing T...
 
Microsoft azure
Microsoft azureMicrosoft azure
Microsoft azure
 
How to build a serverless helmet detection system
How to build a serverless helmet detection systemHow to build a serverless helmet detection system
How to build a serverless helmet detection system
 
Azure signalR
Azure signalRAzure signalR
Azure signalR
 
Good Bye Credentials in Code, Welcome Azure Managed Identities
Good Bye Credentials in Code, Welcome Azure Managed IdentitiesGood Bye Credentials in Code, Welcome Azure Managed Identities
Good Bye Credentials in Code, Welcome Azure Managed Identities
 
Deploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data SolutionsDeploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data Solutions
 
Azuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data FactoryAzuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data Factory
 
Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...
Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...
Microsoft Azure Overview | Cloud Computing Tutorial with Azure | Azure Traini...
 
AzureCostManagementAndBilling
AzureCostManagementAndBillingAzureCostManagementAndBilling
AzureCostManagementAndBilling
 

More from Duncan Jones

State o' yer WAN
State o' yer WANState o' yer WAN
State o' yer WAN
Duncan Jones
 
Hitchhiker systems deepdive
Hitchhiker systems deepdiveHitchhiker systems deepdive
Hitchhiker systems deepdive
Duncan Jones
 
Hitchhiker systems
Hitchhiker systemsHitchhiker systems
Hitchhiker systems
Duncan Jones
 
Event sourcing on azure functions code example
Event sourcing on azure functions code exampleEvent sourcing on azure functions code example
Event sourcing on azure functions code example
Duncan Jones
 
Boxcar computing
Boxcar computingBoxcar computing
Boxcar computing
Duncan Jones
 
Boxcar computing
Boxcar computingBoxcar computing
Boxcar computing
Duncan Jones
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
Duncan Jones
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven Design
Duncan Jones
 
Event sourcing continued
Event sourcing continuedEvent sourcing continued
Event sourcing continued
Duncan Jones
 
Event sourcing - from wtf to why to wow
Event sourcing - from wtf to why to wowEvent sourcing - from wtf to why to wow
Event sourcing - from wtf to why to wow
Duncan Jones
 
3 myths of it
3 myths of it3 myths of it
3 myths of it
Duncan Jones
 
Event sourcing from wtf to why to wow
Event sourcing   from wtf to why to wowEvent sourcing   from wtf to why to wow
Event sourcing from wtf to why to wow
Duncan Jones
 
Crud or event sourcing
Crud or event sourcingCrud or event sourcing
Crud or event sourcing
Duncan Jones
 
cqrs and event sourcing on Windows Azure
cqrs and event sourcing on Windows Azurecqrs and event sourcing on Windows Azure
cqrs and event sourcing on Windows AzureDuncan Jones
 
event sourcing - from wtf to why to wow
event sourcing - from wtf to why to wowevent sourcing - from wtf to why to wow
event sourcing - from wtf to why to wowDuncan Jones
 
CQRS on Azure
CQRS on AzureCQRS on Azure
CQRS on Azure
Duncan Jones
 
Printing-a-NET-developers-guide-Part1
Printing-a-NET-developers-guide-Part1Printing-a-NET-developers-guide-Part1
Printing-a-NET-developers-guide-Part1Duncan Jones
 
Cqrs and the cloud
Cqrs and the cloudCqrs and the cloud
Cqrs and the cloud
Duncan Jones
 

More from Duncan Jones (18)

State o' yer WAN
State o' yer WANState o' yer WAN
State o' yer WAN
 
Hitchhiker systems deepdive
Hitchhiker systems deepdiveHitchhiker systems deepdive
Hitchhiker systems deepdive
 
Hitchhiker systems
Hitchhiker systemsHitchhiker systems
Hitchhiker systems
 
Event sourcing on azure functions code example
Event sourcing on azure functions code exampleEvent sourcing on azure functions code example
Event sourcing on azure functions code example
 
Boxcar computing
Boxcar computingBoxcar computing
Boxcar computing
 
Boxcar computing
Boxcar computingBoxcar computing
Boxcar computing
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven Design
 
Event sourcing continued
Event sourcing continuedEvent sourcing continued
Event sourcing continued
 
Event sourcing - from wtf to why to wow
Event sourcing - from wtf to why to wowEvent sourcing - from wtf to why to wow
Event sourcing - from wtf to why to wow
 
3 myths of it
3 myths of it3 myths of it
3 myths of it
 
Event sourcing from wtf to why to wow
Event sourcing   from wtf to why to wowEvent sourcing   from wtf to why to wow
Event sourcing from wtf to why to wow
 
Crud or event sourcing
Crud or event sourcingCrud or event sourcing
Crud or event sourcing
 
cqrs and event sourcing on Windows Azure
cqrs and event sourcing on Windows Azurecqrs and event sourcing on Windows Azure
cqrs and event sourcing on Windows Azure
 
event sourcing - from wtf to why to wow
event sourcing - from wtf to why to wowevent sourcing - from wtf to why to wow
event sourcing - from wtf to why to wow
 
CQRS on Azure
CQRS on AzureCQRS on Azure
CQRS on Azure
 
Printing-a-NET-developers-guide-Part1
Printing-a-NET-developers-guide-Part1Printing-a-NET-developers-guide-Part1
Printing-a-NET-developers-guide-Part1
 
Cqrs and the cloud
Cqrs and the cloudCqrs and the cloud
Cqrs and the cloud
 

Recently uploaded

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

Serverless cqrs using azure event grid

Editor's Notes

  1. The key words are “CQRS” which is what we are going to do, and “Event Grid” which is how.
  2. I’ll start by describing the architecture pattern CQRS and a side track into a concept called “event sourcing” which are applicable to many different technologies then will go ahead and show how you would go about doing this on top of Event Grid.
  3. At its simplest, CQRS – command query separation of responsibilities – is an architecture whereby commands (those things that alter the state of the system) are kept separate from queries (that get the state of the system).
  4. Commands map to the things that can cause the state of your application to change – the event publishers. 1) Blob storage could be used as a sort of “in tray” that converts a file arrival into a command. 2) Event Hubs can be used to react to commands sent from other domains (or internally within this domain) 3) Custom topics
  5. Event Grid is now in “General Availability” so can be run from whichever region you have chosen for your domain. There are SDKs for a number of programming languages – C#, Python, Node.js – and the REST API means you can access it from a large range of other programming environments. You should also have some idea of the commands and events that make up your application – although it is as easy (maybe arguably easier) to add new events as your business domain requires them.
  6. For commands that have a data payload greater than the maximum size of an event (64kb) then saving the file data as a file into a designated blob storage location can trigger the event with the file location being a parameter of that command. You can envisage these blob storage locations as application in-trays. For smaller commands you can wrap the entire business data in an application specific event that goes in a custom topic For events relating to an actual race we can envisage an IoT hub being used to send data from sensors (or fit bit type devices) and here we rely on the massive throughput capabilities of IoT hub. Alternatively for an occasionally connected model you could record the events on a tablet and fire them up to your system by saving the results file to a storage location.
  7. When something (a domain event) happens and is ingested by the system we need to do a two step process in order to persist that event’s occurrence Turn the event into an event classification Append it to whichever entity’s event stream that it applies to Trigger any notifications that the event occurred that other parts of the system may be listening to The event stream can be stored as an AppendBlob, in Azure Tables, File, CosmosDB etc.
  8. To trigger a query to run, a specific query requested custom topic is passed into the system with the appropriate parameters. This is then routed to an appropriate query handler which can be an azure function, a logic app or even calling an external program using webhooks. Results are calculated by running the appropriate projections over the event streams and performing any map-reduce collation on the returned data. Results can then be distributed – either back to the caller’s application by web hooks or by email, twitter etc. using a logic app. (This could be triggered by the results being written to an “out-tray” location in Azure storage for example) This approach works best for predefined queries with matching predefined query handlers. However you can, of course, persist the output of these queries to a denormalised relational database store for more ad hoc querying.
  9. OK – a quick demo to show how these ideas sit on top of Azure Event Grid… The application for this demo represents a rudimentary system for use by a running organisation – if you are familiar with the “Meet and train league” or “Parkruns” you will know the general idea. This is split up into four domains:- League, Team, Race and Runner and each domain is represented as its own Azure functions app. There is also a linked storage account for each of these domains that holds the event streams and data snapshots for that domain.
  10. Each domain has its own distinct storage account in order to keep everything separate. Each of these has a number of containers in e.g. command logs / query logs to store the incoming commands details for debugging and audit purposes An in-tray for message payloads that are greater than 64kb Documentation to describe the commands/queries and parameters for the public interface to your domain 2) Separate event hubs for routing commands and queries around 3) Custom event grid topics for each specific command or query
  11. We send a command into the system by posting a message to the command endpoint with the event detail contained in the HTTP request body. Security is performed by having an access token passed in the HTTP request headers. The event grid topic triggers a subscription for the “Command Logger” which is an azure function which gives the command an unique identifier then writes it to the “command-log” This is so we have an audit trail of every command and can deal with failed commands. Then the command is passed to the function or functions that comprise the command handling. This could include validation and any set-up actions that need to be performed. Finally the command is turned into one or more events which are persisted to the event stream to cause the change to occur.
  12. Running a query is triggered in a very similar manner to the command – we pass a message to the event grid topic for the query type with the parameters in the HTTP request body. In addition we pass parameters to tell the query handler where and how to deliver the results when the query completes. The query parameters are logged and then passed to a query handler function. The query handler is tasked with picking up the identity group over which the query will run and then running the projection (or projections) that comprise the query before collating the results. When a query completes the results are written to a results cache (so that we do not process the same question twice) The results are then returned to where the request specified
  13. For the latest pricing, check the above link because prices do change fairly rapidly (nearly always downwards though).