SlideShare a Scribd company logo
1 of 26
Download to read offline
Shaping Serverless
Architecture with
Domain-Driven Design
Patterns
Asher Sterkin
asher.sterkin@gmail.com
AWS Users Group IL Meetup
02/06/2018, Tlv Partners
About Myself
● Software technologist/architect
● Former VP Technology @ NDS and Distinguished Engineer @ Cisco
● Currently CTO @ IRKI
● C-level mentoring on software strategy
● Cross-discipline approach (connecting the dots):
○ (Strategic) Domain-Driven Design
○ Serverless Architecture
○ Cynefin
○ Wardley Maps
○ Lean Startup
○ Promise Theory
○ ...
What is Serverless Architecture?
● No server management (pure on-demand computing)
● Flexible scaling (automatic or throttled)
● Highly available (AWS services are always on)
● Two flavors:
○ AWS Lambda - no pay for idle (ideal for spiky, unpredictable workloads)
○ AWS Fargate - log running containers (for stable latency and/or full control over run-time)
○ Could be combined
● More details
● Serverless computing is a tectonic shift in software industry
○ S. Wardley “Why the fuss about serverless?”
Serverless 3-tier Web Application
Credit: Boaz Ziniman, “Serverless Use Cases with AWS Lambda”
Data Store in
Amazon
DynamoDB
Amazon S3
(static content)
Amazon
CloudFront
Amazon API
Gateway
AWS Lambda
(dynamic content)
How many Lambda Functions
and DynamoDB Tables are
required to implement this?
Why Bother?
Just throw in as many Lambdas as you wish
It Grows Rather Quickly
Yan Cui, “Yubl’s Road to Serverless Architecture”
Serverless
The danger is to come up with
Need Some Organizing Principles
Serverless Application Structure Factors
● Scalability
● Resource Utilization
● Access Control
● Productivity
● See also
Detour
Documenting AWS Serverless Architecture
AWS Icons are Hopelessly Inconsistent
When to use this?
And when this?
And when that?
What Does this Mean?
AWS Service?
SAM Template?
AWS Lambda Deployment?
Running Instance?
AWS Service?
SAM Template?
DynamoDB Schema?
DynamoDB Table Deployment?
DynamoDB Table Instance?
SDK Function Call?
Data Flow?
Address Reference?
Access Rights?
4+1 View of Software Architecture
Conceptual Physical
Process View Deployment View
Logical View
Use-Case View
Implementation View
End-user
Functionality
Programmers
Software management
Performance
Scalability
Throughput
System integrators
System topology
Delivery, installation
communication
System engineering
Analysts/Designers
Structure
...
...
P. Krutchen, “Architectural Blueprints - The “4+1” View Model of Software Architecture
Let’s Do It Again
mysite.com
api.mysite.com
mySiteData
/
mySiteRequestHandler
API resource running instance(s) table instance
invoke crud
bucket instance Evaluation?
address reference
API Gateway instance
address reference
Separate Application and Domain Services
mysite.com
api.mysite.com
DomainService_Data
/
mySiteWebFrontendService
smartPhone
mySiteSmartPhoneFrontendService
DomainService
DDD Focus is Here
crud
Ref: Netflix API
Server-side Rendering
Evaluation?
Domain-Driven Design at a Glance
Language
Model
Boundaries
Nesting
Today’s focus
An introductory presentation
could be found here. Look at the
end for recommended materials.
Introducing Bounded Context
● Maintaining “one-size fits all” domain model is seldom practical
● Any non-trivial software system usually needs multiple models
○ Highly cohesive inside (Bounded Context)
○ Loosely coupled outside (Context Map)
○ Good candidates for Microservices (E. Evans, “DDD and Microservices: At Last, Some
Boundaries!”)
Bounded Context A
Strong Semantic
Consistency Insides
Bounded Context B
Strong Semantic
Consistency Inside
Loose Coupling Outside
Context Map
Examples?
Bounded Context Services
DomainServiceA_DataDomainServiceA
DomainServiceB DomainServiceB_Data
crud
crud
Contains sensitive data!
Copy of publicly available data
Evaluation?
mySiteWebFrontendService
Bounded Context Services + Context Map
DomainServiceA_DataDomainServiceA
DomainServiceB DomainServiceB_Data
crud
crud
Evaluation?
mySiteWebFrontendService
DomainServiceB_DataStreams
DomainServiceB_EventHandler
trigger
put
Introducing Aggregate and Repository
Strong Transaction
Consistency + Invariant
<<Aggregate Root>>
Entity
Entity Value
Value
Eventual
Transaction
Consistency
aggregate storage
store/retrieve requests -->
command/query requests -->
update/query method call -->
● Data integrity boundaries
● Strong transactional consistency inside
● Eventual consistency outside
● Inner parts are accessible only via Aggregate Root
● Inside Aggregate some form of invariant is maintained
● Aggregates of the same type are stored within Repository
Command/query
Request Processor
Aggregate
Repository
Aggregate
Example?
Aggregate, Repository, Command/Query Handler
DomainServiceA_
AggregateX_Data
DomainServiceA
_AggregateX
DomainServiceA
_AggregateY DomainServiceA_
AggregateY_Data
crud
crud
Evaluation?
mySiteWebFrontendService
command/query requests
DomainServiceA
AggregateY_EventHandler
Introducing CQRS
● Stands for Command/Query Request Segregation
● Was first proposed by Greg Yung
● Based on Command-Query Separation advocated by Bertrand Meyer:
○ Each method should either return something and leave object state intact
○ Or change the object state and return nothing (declared void)
● Interesting Aggregates usually justify separate Command/Query interfaces
and data models
Query
Model
Aggregate A
State
Aggregate B
State
Command interface Query interface
Example?
CQRS
DomainServiceA_
AggregateX_StateData
DomainServiceA
_AggregateX_CommandHandler
DomainServiceA
_AggregateY_CommandHandler DomainServiceA_
AggregateY_StateData
get/put/delete
get/put/delete
Evaluation?
mySiteWebFrontendService
DomainServiceA_
View
DomainServiceA
_ViewBuilder
queries put/delete
get
get
commands
commands
Not Covered Here
● Separate Functions per Method/Event (easy, but needs justification)
● Event Sourcing (less easy, needs justification)
● Computation Services (not hard)
● Distributed Transactions (Saga)
● Fine-grained integration with API Gateway
● Integration with AppSync (GraphQL)
● Integration with IoT(Gateway)
● Integration with specialized AWS services (e.g. AWS Comprehend)
● Custom Machine Learning in Event/Command Handlers
● Integration with Blockchain
Interim Conclusions
● Serverless Architecture is a new beast to tame:
○ Gojko Adzic, “Designing for the Serverless Age”
● “4+1 View” approach helps with removing clutter from diagrams
○ Could used for Lightweight Architecture Decision Records
● Domain-Driven Design suggests a set of useful organizing principles
● Different options are valid under different circumstances
● It’s mostly about price/performance optimization
● Objective validation criteria:
○ Organizational structure (E. Evans, “DDD and Microservices: At Last, Some Boundaries!”)
○ Consistency tolerance (E. Evans “Acknowledging CAP at the Root - in the Domain Model”)
○ Security guidelines
○ Scalability needs
○ SOLID architecture principles
“Consensus is poisonous
for innovation”
D. Snowden

More Related Content

What's hot

MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...
MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...
MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...Restlet
 
Sustainable software development / Jätkusuutlik tarkvaraarendus
Sustainable software development / Jätkusuutlik tarkvaraarendusSustainable software development / Jätkusuutlik tarkvaraarendus
Sustainable software development / Jätkusuutlik tarkvaraarendusGreteStrandberg
 
Kubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stackKubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stackLuram Archanjo
 
Letswift18 키노트
Letswift18 키노트Letswift18 키노트
Letswift18 키노트Jung Kim
 
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...WSO2
 
DevOps: Coding Defines Monitoring
DevOps: Coding Defines MonitoringDevOps: Coding Defines Monitoring
DevOps: Coding Defines MonitoringOpsta
 
Clean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalkClean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalkHalyna Halkina
 
Go lambda-presentation
Go lambda-presentationGo lambda-presentation
Go lambda-presentationSteven White
 
StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...
StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...
StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...Álvaro Agea Herradón
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013Aaron Saunders
 
Microservices: A developer's approach
Microservices: A developer's approachMicroservices: A developer's approach
Microservices: A developer's approachFoyzul Karim
 
Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)Sigasi
 
Integracia security do ci cd pipelines
Integracia security do ci cd pipelinesIntegracia security do ci cd pipelines
Integracia security do ci cd pipelinesJuraj Hantak
 
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NETEntity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NETMicrosoft Tech Community
 
Modern ClojureScript
Modern ClojureScriptModern ClojureScript
Modern ClojureScriptWen Chun Lin
 
Lightning Web Components by Abdul Gafoor
Lightning Web Components by Abdul GafoorLightning Web Components by Abdul Gafoor
Lightning Web Components by Abdul GafoorJayesh Tejwani
 
NoSQLEU: Different NoSQL tools in Production
NoSQLEU: Different NoSQL tools in ProductionNoSQLEU: Different NoSQL tools in Production
NoSQLEU: Different NoSQL tools in ProductionBit Zesty
 
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...Red Hat Developers
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)Red Hat Developers
 

What's hot (20)

MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...
MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...
MuleSoft Connect 2016 - Getting started with RAML using Restlet’s visual desi...
 
Sustainable software development / Jätkusuutlik tarkvaraarendus
Sustainable software development / Jätkusuutlik tarkvaraarendusSustainable software development / Jätkusuutlik tarkvaraarendus
Sustainable software development / Jätkusuutlik tarkvaraarendus
 
Kubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stackKubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stack
 
Letswift18 키노트
Letswift18 키노트Letswift18 키노트
Letswift18 키노트
 
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
 
DevOps: Coding Defines Monitoring
DevOps: Coding Defines MonitoringDevOps: Coding Defines Monitoring
DevOps: Coding Defines Monitoring
 
Clean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalkClean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalk
 
Go lambda-presentation
Go lambda-presentationGo lambda-presentation
Go lambda-presentation
 
StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...
StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...
StratioDeep: an Integration Layer Between Spark and Cassandra - Spark Summit ...
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
 
Microservices: A developer's approach
Microservices: A developer's approachMicroservices: A developer's approach
Microservices: A developer's approach
 
Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)
 
Javantura v4 - Android App Development in 2017 - Matej Vidaković
Javantura v4 - Android App Development in 2017 - Matej VidakovićJavantura v4 - Android App Development in 2017 - Matej Vidaković
Javantura v4 - Android App Development in 2017 - Matej Vidaković
 
Integracia security do ci cd pipelines
Integracia security do ci cd pipelinesIntegracia security do ci cd pipelines
Integracia security do ci cd pipelines
 
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NETEntity Framework Core 2.1: Simple, Powerful Data Access for .NET
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
 
Modern ClojureScript
Modern ClojureScriptModern ClojureScript
Modern ClojureScript
 
Lightning Web Components by Abdul Gafoor
Lightning Web Components by Abdul GafoorLightning Web Components by Abdul Gafoor
Lightning Web Components by Abdul Gafoor
 
NoSQLEU: Different NoSQL tools in Production
NoSQLEU: Different NoSQL tools in ProductionNoSQLEU: Different NoSQL tools in Production
NoSQLEU: Different NoSQL tools in Production
 
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
 

Similar to Shaping serverless architecture with domain driven design patterns

Shaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-ilShaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-ilAsher Sterkin
 
Asp.Net_ Developer Resume Remotely
Asp.Net_ Developer Resume RemotelyAsp.Net_ Developer Resume Remotely
Asp.Net_ Developer Resume RemotelySumitKumar2504
 
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitDiscover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitAmazon Web Services
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql databasePARIKSHIT SAVJANI
 
Sprint 45 review
Sprint 45 reviewSprint 45 review
Sprint 45 reviewManageIQ
 
Airflow techtonic template
Airflow   techtonic templateAirflow   techtonic template
Airflow techtonic templateSampath Kumar
 
ArchitectNow - Designing Cloud-Native apps in Microsoft Azure
ArchitectNow  -  Designing Cloud-Native apps in Microsoft AzureArchitectNow  -  Designing Cloud-Native apps in Microsoft Azure
ArchitectNow - Designing Cloud-Native apps in Microsoft AzureKevin Grossnicklaus
 
Learn about AWS Certifications - Andrew May, Columbus
Learn about AWS Certifications - Andrew May, ColumbusLearn about AWS Certifications - Andrew May, Columbus
Learn about AWS Certifications - Andrew May, ColumbusAWS Chicago
 
Dynamics ax 2012 development overview
Dynamics ax 2012 development overviewDynamics ax 2012 development overview
Dynamics ax 2012 development overviewAli Raza Zaidi
 
Developing cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD PerspectiveDeveloping cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD PerspectiveAsher Sterkin
 
Crafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoCrafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoJAXLondon2014
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azureSergey Seletsky
 
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
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arpGary Pedretti
 
AWS Summit Singapore - Managing a Database Migration Project | Best Practices
AWS Summit Singapore - Managing a Database Migration Project | Best PracticesAWS Summit Singapore - Managing a Database Migration Project | Best Practices
AWS Summit Singapore - Managing a Database Migration Project | Best PracticesAmazon Web Services
 
Google Cloud Study Jam | GDSC NCU
Google Cloud Study Jam | GDSC NCUGoogle Cloud Study Jam | GDSC NCU
Google Cloud Study Jam | GDSC NCUShivam254129
 
January 2017 - Deep dive on AWS Lambda and DevOps
January 2017 - Deep dive on AWS Lambda and DevOpsJanuary 2017 - Deep dive on AWS Lambda and DevOps
January 2017 - Deep dive on AWS Lambda and DevOpsDavid McDaniel
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open SourceAll Things Open
 

Similar to Shaping serverless architecture with domain driven design patterns (20)

Shaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-ilShaping serverless architecture with domain driven design patterns - py web-il
Shaping serverless architecture with domain driven design patterns - py web-il
 
Asp.Net_ Developer Resume Remotely
Asp.Net_ Developer Resume RemotelyAsp.Net_ Developer Resume Remotely
Asp.Net_ Developer Resume Remotely
 
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitDiscover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
 
Sprint 45 review
Sprint 45 reviewSprint 45 review
Sprint 45 review
 
An introduction to cloud systems architecture
An introduction to cloud systems architectureAn introduction to cloud systems architecture
An introduction to cloud systems architecture
 
Sprint 57
Sprint 57Sprint 57
Sprint 57
 
Airflow techtonic template
Airflow   techtonic templateAirflow   techtonic template
Airflow techtonic template
 
ArchitectNow - Designing Cloud-Native apps in Microsoft Azure
ArchitectNow  -  Designing Cloud-Native apps in Microsoft AzureArchitectNow  -  Designing Cloud-Native apps in Microsoft Azure
ArchitectNow - Designing Cloud-Native apps in Microsoft Azure
 
Learn about AWS Certifications - Andrew May, Columbus
Learn about AWS Certifications - Andrew May, ColumbusLearn about AWS Certifications - Andrew May, Columbus
Learn about AWS Certifications - Andrew May, Columbus
 
Dynamics ax 2012 development overview
Dynamics ax 2012 development overviewDynamics ax 2012 development overview
Dynamics ax 2012 development overview
 
Developing cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD PerspectiveDeveloping cloud serverless components in Python: DDD Perspective
Developing cloud serverless components in Python: DDD Perspective
 
Crafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoCrafted Design - Sandro Mancuso
Crafted Design - Sandro Mancuso
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azure
 
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
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
AWS Summit Singapore - Managing a Database Migration Project | Best Practices
AWS Summit Singapore - Managing a Database Migration Project | Best PracticesAWS Summit Singapore - Managing a Database Migration Project | Best Practices
AWS Summit Singapore - Managing a Database Migration Project | Best Practices
 
Google Cloud Study Jam | GDSC NCU
Google Cloud Study Jam | GDSC NCUGoogle Cloud Study Jam | GDSC NCU
Google Cloud Study Jam | GDSC NCU
 
January 2017 - Deep dive on AWS Lambda and DevOps
January 2017 - Deep dive on AWS Lambda and DevOpsJanuary 2017 - Deep dive on AWS Lambda and DevOps
January 2017 - Deep dive on AWS Lambda and DevOps
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open Source
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Shaping serverless architecture with domain driven design patterns

  • 1. Shaping Serverless Architecture with Domain-Driven Design Patterns Asher Sterkin asher.sterkin@gmail.com AWS Users Group IL Meetup 02/06/2018, Tlv Partners
  • 2. About Myself ● Software technologist/architect ● Former VP Technology @ NDS and Distinguished Engineer @ Cisco ● Currently CTO @ IRKI ● C-level mentoring on software strategy ● Cross-discipline approach (connecting the dots): ○ (Strategic) Domain-Driven Design ○ Serverless Architecture ○ Cynefin ○ Wardley Maps ○ Lean Startup ○ Promise Theory ○ ...
  • 3. What is Serverless Architecture? ● No server management (pure on-demand computing) ● Flexible scaling (automatic or throttled) ● Highly available (AWS services are always on) ● Two flavors: ○ AWS Lambda - no pay for idle (ideal for spiky, unpredictable workloads) ○ AWS Fargate - log running containers (for stable latency and/or full control over run-time) ○ Could be combined ● More details ● Serverless computing is a tectonic shift in software industry ○ S. Wardley “Why the fuss about serverless?”
  • 4. Serverless 3-tier Web Application Credit: Boaz Ziniman, “Serverless Use Cases with AWS Lambda” Data Store in Amazon DynamoDB Amazon S3 (static content) Amazon CloudFront Amazon API Gateway AWS Lambda (dynamic content) How many Lambda Functions and DynamoDB Tables are required to implement this?
  • 5. Why Bother? Just throw in as many Lambdas as you wish
  • 6. It Grows Rather Quickly Yan Cui, “Yubl’s Road to Serverless Architecture”
  • 7. Serverless The danger is to come up with
  • 8. Need Some Organizing Principles
  • 9. Serverless Application Structure Factors ● Scalability ● Resource Utilization ● Access Control ● Productivity ● See also
  • 11. AWS Icons are Hopelessly Inconsistent When to use this? And when this? And when that?
  • 12. What Does this Mean? AWS Service? SAM Template? AWS Lambda Deployment? Running Instance? AWS Service? SAM Template? DynamoDB Schema? DynamoDB Table Deployment? DynamoDB Table Instance? SDK Function Call? Data Flow? Address Reference? Access Rights?
  • 13. 4+1 View of Software Architecture Conceptual Physical Process View Deployment View Logical View Use-Case View Implementation View End-user Functionality Programmers Software management Performance Scalability Throughput System integrators System topology Delivery, installation communication System engineering Analysts/Designers Structure ... ... P. Krutchen, “Architectural Blueprints - The “4+1” View Model of Software Architecture
  • 14. Let’s Do It Again mysite.com api.mysite.com mySiteData / mySiteRequestHandler API resource running instance(s) table instance invoke crud bucket instance Evaluation? address reference API Gateway instance address reference
  • 15. Separate Application and Domain Services mysite.com api.mysite.com DomainService_Data / mySiteWebFrontendService smartPhone mySiteSmartPhoneFrontendService DomainService DDD Focus is Here crud Ref: Netflix API Server-side Rendering Evaluation?
  • 16. Domain-Driven Design at a Glance Language Model Boundaries Nesting Today’s focus An introductory presentation could be found here. Look at the end for recommended materials.
  • 17. Introducing Bounded Context ● Maintaining “one-size fits all” domain model is seldom practical ● Any non-trivial software system usually needs multiple models ○ Highly cohesive inside (Bounded Context) ○ Loosely coupled outside (Context Map) ○ Good candidates for Microservices (E. Evans, “DDD and Microservices: At Last, Some Boundaries!”) Bounded Context A Strong Semantic Consistency Insides Bounded Context B Strong Semantic Consistency Inside Loose Coupling Outside Context Map Examples?
  • 18. Bounded Context Services DomainServiceA_DataDomainServiceA DomainServiceB DomainServiceB_Data crud crud Contains sensitive data! Copy of publicly available data Evaluation? mySiteWebFrontendService
  • 19. Bounded Context Services + Context Map DomainServiceA_DataDomainServiceA DomainServiceB DomainServiceB_Data crud crud Evaluation? mySiteWebFrontendService DomainServiceB_DataStreams DomainServiceB_EventHandler trigger put
  • 20. Introducing Aggregate and Repository Strong Transaction Consistency + Invariant <<Aggregate Root>> Entity Entity Value Value Eventual Transaction Consistency aggregate storage store/retrieve requests --> command/query requests --> update/query method call --> ● Data integrity boundaries ● Strong transactional consistency inside ● Eventual consistency outside ● Inner parts are accessible only via Aggregate Root ● Inside Aggregate some form of invariant is maintained ● Aggregates of the same type are stored within Repository Command/query Request Processor Aggregate Repository Aggregate Example?
  • 21. Aggregate, Repository, Command/Query Handler DomainServiceA_ AggregateX_Data DomainServiceA _AggregateX DomainServiceA _AggregateY DomainServiceA_ AggregateY_Data crud crud Evaluation? mySiteWebFrontendService command/query requests DomainServiceA AggregateY_EventHandler
  • 22. Introducing CQRS ● Stands for Command/Query Request Segregation ● Was first proposed by Greg Yung ● Based on Command-Query Separation advocated by Bertrand Meyer: ○ Each method should either return something and leave object state intact ○ Or change the object state and return nothing (declared void) ● Interesting Aggregates usually justify separate Command/Query interfaces and data models Query Model Aggregate A State Aggregate B State Command interface Query interface Example?
  • 24. Not Covered Here ● Separate Functions per Method/Event (easy, but needs justification) ● Event Sourcing (less easy, needs justification) ● Computation Services (not hard) ● Distributed Transactions (Saga) ● Fine-grained integration with API Gateway ● Integration with AppSync (GraphQL) ● Integration with IoT(Gateway) ● Integration with specialized AWS services (e.g. AWS Comprehend) ● Custom Machine Learning in Event/Command Handlers ● Integration with Blockchain
  • 25. Interim Conclusions ● Serverless Architecture is a new beast to tame: ○ Gojko Adzic, “Designing for the Serverless Age” ● “4+1 View” approach helps with removing clutter from diagrams ○ Could used for Lightweight Architecture Decision Records ● Domain-Driven Design suggests a set of useful organizing principles ● Different options are valid under different circumstances ● It’s mostly about price/performance optimization ● Objective validation criteria: ○ Organizational structure (E. Evans, “DDD and Microservices: At Last, Some Boundaries!”) ○ Consistency tolerance (E. Evans “Acknowledging CAP at the Root - in the Domain Model”) ○ Security guidelines ○ Scalability needs ○ SOLID architecture principles
  • 26. “Consensus is poisonous for innovation” D. Snowden