SlideShare a Scribd company logo
four architectural patterns
“ W H Y, S O M E T I M E S I ’ V E R E V I E W E D A S M A N Y A S
B E F O R E B R E A K FA S T ”
Slides Available: http://tinyurl.com/ArchiAlice
W H AT I S A N
“ A R C H I T E C T U R A L
PAT T E R N ”
• Enough ideas, rules and best
practices that stick together and form
a consistent approach to
development of systems.
• There is no one best or correct
pattern. It depends on your use case.
Some named ones may even be out
of favour.
“And what is the use of a book,” thought Alice, “without pictures or conversations?” 
domain driven design
W H AT I S D O M A I N
D R I V E N D E S I G N ?
• Your system is formed organically
through consideration of the real-
world domain it exists in.
• Since all 300 of us do not want to do
this together, we can identify
subdomains and/or bounded contexts.
• This is discovered through
collaboration with domain experts and
the adoption of a “ubiquitous
language”
W H AT I S D O M A I N
D R I V E N D E S I G N ?
• It believes strongly in the layered architecture,
and defines what it thinks can exist in the
“domain” layer:
• Entity (things with state)
• Value Object (Immutable attributes)
• Aggregate (Cluster of objects treated as one
for data changes)
• Event (“something has happened”)
• Service, Repository, Factory (for managing
changing, retrieval or creation of any of the
above)
W H Y ?
• Reduces cost of communication
across different parts of the
organisation
• Minimises risk of significant
refactoring
“She generally gave herself very good advice, (though she very seldom followed it).”
command-query segregation
W H AT I S C Q S ?
• You should have some interfaces to
your system that mutate logic; and
some that read state.
• They should not mix.
W H Y ?
• Clean code
• Reusable code
• Self-documentation / Principle of
least surprise
“But it’s no use now,” thought poor Alice, “to pretend to be two people!
Why, there’s hardly enough of me left to make one respectable person!” 
command-query
responsibility segregation
W H AT I S C Q R S ?
• You should have separate systems in
place for creating and reading data.
• This is more often used to describe
interfaces at a system or domain level
W H AT I S C Q R S ?
W R I T E R E A D
R E A D
W H Y ?
• (This is the most controversial of the
patterns presented today)
• Encourage re-use of APIs and
services
• Clear single source of truth for data
• Read and write can be scaled
independently
“I could tell you my adventures—beginning from this morning,” said Alice a little timidly
“but it’s no use going back to yesterday, because I was a different person then.”
event sourcing
W H AT I S E V E N T
S O U R C I N G ?
• The source of truth for your domain
is a series of events that tells the
system what state has changed.
• Any higher fidelity views are
“materialised” from this event stream
and are second class data citizen
W H Y ?
• Data restoration for free (if you treat
your events right)
• Audit log for free
• Can understand the state of a system
at a given time
“It seems very pretty,” she said when she had
finished it, “but it’s rather hard to understand!”
( Y O U S E E S H E D I D N ’ T L I K E T O C O N F E S S ,
E V E N T O H E R S E L F, T H AT S H E C O U L D N ’ T
M A K E I T O U T AT A L L . )
W H AT Y O U N E E D T O M O D E L …
D O M A I N
E V E N T S
C O M M A N D
E V E N T
• Requests by a user/system/etc. to change something
• Often written in the imperative mood
• Meaningful domain events - not just CRUD operations
• “Cancel Direct Debit”, “Onboard Customer”,
“Submit Meter Read”
• A notification that the state of the system has
explicitly changed (or that is hasn’t)
• Often written as participles
• Meaningful domain events - not just CRUD operations
• “Direct Debit Cancelled”, “Customer was not
onboarded”
W H AT Y O U N E E D T O M O D E L …
A G G R E G AT E S
C O M M A N D
E V E N T
• The aggregate contains the business logic to validate
a command, and understand the impact it should
have on the system.
• If you remember from DDD: Aggregate is a domain
entity. Domain entities should have the knowledge
internally to determine whether a command is
successful. (Clean Code, SOLID, Feature Envy etc.)
• The aggregate will be a noun, and could be
“Customer” or “CustomerAggregate”
• May be split up for ease, in which case the top-level
aggregate is an “aggregate root”.
E V E N T
E V E N T
W H AT Y O U N E E D T O M O D E L …
S A G A
E V E N T
E V E N T
• A saga is a state machine that manages processes
that span multiple services. These should still be
domain processes!
• The state of the saga is driven by the events that other
services generate. If the saga feels that a change is
needed based on the events, it can implement those
changes by issuing one or more commands.
• A saga should named after a business process, such
as “Account Creation” or “Account Creation Saga”
E V E N T
C O M M A N D
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E D
V I E W
M AT E R I A L I S E R
C O M M A N D
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
C O M M A N D
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E D
V I E W
M AT E R I A L I S E R
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
E V E N T
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E D
V I E W
M AT E R I A L I S E R
E V E N T
E V E N T
M AT E R I A L I S E R
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
E V E N T
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E D
V I E W
E V E N T
E V E N T
N E W R E C O R D
M AT E R I A L I S E R
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E D
V I E W
N E W R E C O R D
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
E V E N T
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E D
V I E W
M AT E R I A L I S E R
E V E N T
E V E N T
Z O O M I N G O U T…
A G G R E G AT E
W R I T E A P I
R E A D A P I
S A G A
E V E N T
S T O R E
M AT E R I A L I S E R
M AT E R I A L I S E D
V I E W
C O M M A N D
W H Y ?
• All the benefits of the other patterns
we’ve discussed
• Single, consolidated architecture that
scales nicely with the number of
teams
• Can spin up new microservices with
minimal cost down the line
“So she was considering in her own mind whether
the pleasure of making
a daisy-chain would
be worth the trouble
of getting up & picking the daisies...”
M I N I S T RY O F
J U S T I C E
• https://github.com/
CJSCommonPlatform/
microservice_framework_version_6
• Did the project succeed? Not really.
(And the consultancy behind was trashed in the news.)
• Did the architecture work? No.
Developers not good enough to
understand it, Ivory Tower Architecture
Function, 8 weeks to get words on a
screen.
M E T T L E
• Challenger bank targeting SMEs.
• Did the project succeed? Still going
strong. (And the consultancy behind was trashed
in the news.)
• Did it work? Kind of? After a bit of
wrangling. But we didn’t get half of
what it promised.
P E R S O N A L
P R O J E C T
• https://github.com/
SwamWithTurtles/decrypto-be/
• Did it work? Yeah, kinda but one
person projects are always doomed
to succeed.
Everything’s got a moral
(if only you can find it)

More Related Content

What's hot

Who is Doing the Work? Designing for AI across modes of interaction.
Who is Doing the Work? Designing for AI across modes of interaction.Who is Doing the Work? Designing for AI across modes of interaction.
Who is Doing the Work? Designing for AI across modes of interaction.
ChrisNoessel
 
XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...
XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...
XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...
UX STRAT
 
Swarming 2015 copy powerpoint
Swarming 2015 copy powerpointSwarming 2015 copy powerpoint
Swarming 2015 copy powerpoint
Dhaval Panchal
 
The Ethics of Everybody Else
The Ethics of Everybody ElseThe Ethics of Everybody Else
The Ethics of Everybody Else
Tyler Schnoebelen
 
Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...
Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...
Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...
Erno Hannink
 
Architecting your IT career
Architecting your IT careerArchitecting your IT career
Architecting your IT career
John Mark Troyer
 
TDD Using the SOLID Principles
TDD Using the SOLID PrinciplesTDD Using the SOLID Principles
TDD Using the SOLID PrinciplesJenna Pederson
 
Part 2: Leadership & Innovation Tactics
Part 2: Leadership & Innovation TacticsPart 2: Leadership & Innovation Tactics
Part 2: Leadership & Innovation Tactics
Dustin Haisler
 
Agile metrics
Agile metricsAgile metrics
Agile metrics
Chandan Patary
 
Lean startup - ProductTank Talk
Lean startup - ProductTank TalkLean startup - ProductTank Talk
Lean startup - ProductTank Talk
Stefan Lange-Hegermann
 
Understanding Invisible Labour
Understanding Invisible LabourUnderstanding Invisible Labour
Understanding Invisible Labour
IWMW
 

What's hot (11)

Who is Doing the Work? Designing for AI across modes of interaction.
Who is Doing the Work? Designing for AI across modes of interaction.Who is Doing the Work? Designing for AI across modes of interaction.
Who is Doing the Work? Designing for AI across modes of interaction.
 
XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...
XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...
XD Immersive: Andrew McHugh, "Making the Transition to VR / AR Experience Des...
 
Swarming 2015 copy powerpoint
Swarming 2015 copy powerpointSwarming 2015 copy powerpoint
Swarming 2015 copy powerpoint
 
The Ethics of Everybody Else
The Ethics of Everybody ElseThe Ethics of Everybody Else
The Ethics of Everybody Else
 
Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...
Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...
Getting Things Done met David Allen - Masterclass met ScaleUp Company 22 apri...
 
Architecting your IT career
Architecting your IT careerArchitecting your IT career
Architecting your IT career
 
TDD Using the SOLID Principles
TDD Using the SOLID PrinciplesTDD Using the SOLID Principles
TDD Using the SOLID Principles
 
Part 2: Leadership & Innovation Tactics
Part 2: Leadership & Innovation TacticsPart 2: Leadership & Innovation Tactics
Part 2: Leadership & Innovation Tactics
 
Agile metrics
Agile metricsAgile metrics
Agile metrics
 
Lean startup - ProductTank Talk
Lean startup - ProductTank TalkLean startup - ProductTank Talk
Lean startup - ProductTank Talk
 
Understanding Invisible Labour
Understanding Invisible LabourUnderstanding Invisible Labour
Understanding Invisible Labour
 

Similar to Four Architectural Patterns

Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at Scale
David Simons
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
Ronald Ashri
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
Ronald Ashri
 
Digital Data Commons - Emergence of AI Blockchain Convergence
Digital Data Commons - Emergence of AI Blockchain ConvergenceDigital Data Commons - Emergence of AI Blockchain Convergence
Digital Data Commons - Emergence of AI Blockchain Convergence
Gokul Alex
 
Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
David Simons
 
Content First in Action
Content First in ActionContent First in Action
Content First in Action
Stephanie Leary
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to Agile
Doc Norton
 
Development and Deployment: The Human Factor
Development and Deployment: The Human FactorDevelopment and Deployment: The Human Factor
Development and Deployment: The Human Factor
Boris Adryan
 
Decoupled APIs through Microservices
Decoupled APIs through MicroservicesDecoupled APIs through Microservices
Decoupled APIs through Microservices
David Simons
 
Domínio: Dividir e conquistar
Domínio: Dividir e conquistarDomínio: Dividir e conquistar
Domínio: Dividir e conquistar
Nelson Senna do Amaral
 
PHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented ArchitecturePHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented Architecture
iMasters
 
Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...
Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...
Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...
Sergii Khomenko
 
From the right process to a solid cultural change
From the right process to a solid cultural changeFrom the right process to a solid cultural change
From the right process to a solid cultural change
Francesco Zaia
 
Choosing the Right Database
Choosing the Right DatabaseChoosing the Right Database
Choosing the Right Database
David Simons
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQL
David Simons
 
Gain Maximum Visibility into Your Applications - DEM03 - Chicago AWS Summit
Gain Maximum Visibility into Your Applications - DEM03 - Chicago AWS SummitGain Maximum Visibility into Your Applications - DEM03 - Chicago AWS Summit
Gain Maximum Visibility into Your Applications - DEM03 - Chicago AWS Summit
Amazon Web Services
 
The Expanding Boundaries of CSS
The Expanding Boundaries of CSSThe Expanding Boundaries of CSS
The Expanding Boundaries of CSS
chriseppstein
 
100% Visibility - Jason Yee - Codemotion Amsterdam 2018
100% Visibility - Jason Yee - Codemotion Amsterdam 2018100% Visibility - Jason Yee - Codemotion Amsterdam 2018
100% Visibility - Jason Yee - Codemotion Amsterdam 2018
Codemotion
 
Small data big impact
Small data big impactSmall data big impact
Small data big impact
University of Hertfordshire
 
Gain Maximum Visibility into Your Applications
Gain Maximum Visibility into Your Applications Gain Maximum Visibility into Your Applications
Gain Maximum Visibility into Your Applications
Amazon Web Services
 

Similar to Four Architectural Patterns (20)

Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at Scale
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
Digital Data Commons - Emergence of AI Blockchain Convergence
Digital Data Commons - Emergence of AI Blockchain ConvergenceDigital Data Commons - Emergence of AI Blockchain Convergence
Digital Data Commons - Emergence of AI Blockchain Convergence
 
Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
 
Content First in Action
Content First in ActionContent First in Action
Content First in Action
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to Agile
 
Development and Deployment: The Human Factor
Development and Deployment: The Human FactorDevelopment and Deployment: The Human Factor
Development and Deployment: The Human Factor
 
Decoupled APIs through Microservices
Decoupled APIs through MicroservicesDecoupled APIs through Microservices
Decoupled APIs through Microservices
 
Domínio: Dividir e conquistar
Domínio: Dividir e conquistarDomínio: Dividir e conquistar
Domínio: Dividir e conquistar
 
PHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented ArchitecturePHP Experience 2016 - ROA – Resource Oriented Architecture
PHP Experience 2016 - ROA – Resource Oriented Architecture
 
Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...
Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...
Scaling your Tableau - Migrating from Tableau Online to a proper DWH solution...
 
From the right process to a solid cultural change
From the right process to a solid cultural changeFrom the right process to a solid cultural change
From the right process to a solid cultural change
 
Choosing the Right Database
Choosing the Right DatabaseChoosing the Right Database
Choosing the Right Database
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQL
 
Gain Maximum Visibility into Your Applications - DEM03 - Chicago AWS Summit
Gain Maximum Visibility into Your Applications - DEM03 - Chicago AWS SummitGain Maximum Visibility into Your Applications - DEM03 - Chicago AWS Summit
Gain Maximum Visibility into Your Applications - DEM03 - Chicago AWS Summit
 
The Expanding Boundaries of CSS
The Expanding Boundaries of CSSThe Expanding Boundaries of CSS
The Expanding Boundaries of CSS
 
100% Visibility - Jason Yee - Codemotion Amsterdam 2018
100% Visibility - Jason Yee - Codemotion Amsterdam 2018100% Visibility - Jason Yee - Codemotion Amsterdam 2018
100% Visibility - Jason Yee - Codemotion Amsterdam 2018
 
Small data big impact
Small data big impactSmall data big impact
Small data big impact
 
Gain Maximum Visibility into Your Applications
Gain Maximum Visibility into Your Applications Gain Maximum Visibility into Your Applications
Gain Maximum Visibility into Your Applications
 

More from David Simons

Statistical Programming with JavaScript
Statistical Programming with JavaScriptStatistical Programming with JavaScript
Statistical Programming with JavaScript
David Simons
 
Non-Functional Requirements
Non-Functional RequirementsNon-Functional Requirements
Non-Functional Requirements
David Simons
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-End
David Simons
 
Build Tools & Maven
Build Tools & MavenBuild Tools & Maven
Build Tools & Maven
David Simons
 
Graph Modelling
Graph ModellingGraph Modelling
Graph Modelling
David Simons
 
Graph theory in Practise
Graph theory in PractiseGraph theory in Practise
Graph theory in Practise
David Simons
 
Decoupled APIs through microservices
Decoupled APIs through microservicesDecoupled APIs through microservices
Decoupled APIs through microservices
David Simons
 
TDD: What is it good for?
TDD: What is it good for?TDD: What is it good for?
TDD: What is it good for?
David Simons
 
Domain Driven Design: A Precis
Domain Driven Design: A PrecisDomain Driven Design: A Precis
Domain Driven Design: A Precis
David Simons
 
10 d bs in 30 minutes
10 d bs in 30 minutes10 d bs in 30 minutes
10 d bs in 30 minutesDavid Simons
 
Using Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open DemocracyUsing Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open Democracy
David Simons
 
Exploring Election Results with Neo4J
Exploring Election Results with Neo4JExploring Election Results with Neo4J
Exploring Election Results with Neo4J
David Simons
 

More from David Simons (12)

Statistical Programming with JavaScript
Statistical Programming with JavaScriptStatistical Programming with JavaScript
Statistical Programming with JavaScript
 
Non-Functional Requirements
Non-Functional RequirementsNon-Functional Requirements
Non-Functional Requirements
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-End
 
Build Tools & Maven
Build Tools & MavenBuild Tools & Maven
Build Tools & Maven
 
Graph Modelling
Graph ModellingGraph Modelling
Graph Modelling
 
Graph theory in Practise
Graph theory in PractiseGraph theory in Practise
Graph theory in Practise
 
Decoupled APIs through microservices
Decoupled APIs through microservicesDecoupled APIs through microservices
Decoupled APIs through microservices
 
TDD: What is it good for?
TDD: What is it good for?TDD: What is it good for?
TDD: What is it good for?
 
Domain Driven Design: A Precis
Domain Driven Design: A PrecisDomain Driven Design: A Precis
Domain Driven Design: A Precis
 
10 d bs in 30 minutes
10 d bs in 30 minutes10 d bs in 30 minutes
10 d bs in 30 minutes
 
Using Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open DemocracyUsing Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open Democracy
 
Exploring Election Results with Neo4J
Exploring Election Results with Neo4JExploring Election Results with Neo4J
Exploring Election Results with Neo4J
 

Recently uploaded

UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
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
 
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
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
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
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 

Recently uploaded (20)

UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
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...
 
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 -...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
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
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 

Four Architectural Patterns

  • 1. four architectural patterns “ W H Y, S O M E T I M E S I ’ V E R E V I E W E D A S M A N Y A S B E F O R E B R E A K FA S T ”
  • 3. W H AT I S A N “ A R C H I T E C T U R A L PAT T E R N ” • Enough ideas, rules and best practices that stick together and form a consistent approach to development of systems. • There is no one best or correct pattern. It depends on your use case. Some named ones may even be out of favour.
  • 4. “And what is the use of a book,” thought Alice, “without pictures or conversations?”  domain driven design
  • 5. W H AT I S D O M A I N D R I V E N D E S I G N ? • Your system is formed organically through consideration of the real- world domain it exists in. • Since all 300 of us do not want to do this together, we can identify subdomains and/or bounded contexts. • This is discovered through collaboration with domain experts and the adoption of a “ubiquitous language”
  • 6. W H AT I S D O M A I N D R I V E N D E S I G N ? • It believes strongly in the layered architecture, and defines what it thinks can exist in the “domain” layer: • Entity (things with state) • Value Object (Immutable attributes) • Aggregate (Cluster of objects treated as one for data changes) • Event (“something has happened”) • Service, Repository, Factory (for managing changing, retrieval or creation of any of the above)
  • 7. W H Y ? • Reduces cost of communication across different parts of the organisation • Minimises risk of significant refactoring
  • 8. “She generally gave herself very good advice, (though she very seldom followed it).” command-query segregation
  • 9. W H AT I S C Q S ? • You should have some interfaces to your system that mutate logic; and some that read state. • They should not mix.
  • 10. W H Y ? • Clean code • Reusable code • Self-documentation / Principle of least surprise
  • 11. “But it’s no use now,” thought poor Alice, “to pretend to be two people! Why, there’s hardly enough of me left to make one respectable person!”  command-query responsibility segregation
  • 12. W H AT I S C Q R S ? • You should have separate systems in place for creating and reading data. • This is more often used to describe interfaces at a system or domain level
  • 13. W H AT I S C Q R S ? W R I T E R E A D R E A D
  • 14. W H Y ? • (This is the most controversial of the patterns presented today) • Encourage re-use of APIs and services • Clear single source of truth for data • Read and write can be scaled independently
  • 15. “I could tell you my adventures—beginning from this morning,” said Alice a little timidly “but it’s no use going back to yesterday, because I was a different person then.” event sourcing
  • 16. W H AT I S E V E N T S O U R C I N G ? • The source of truth for your domain is a series of events that tells the system what state has changed. • Any higher fidelity views are “materialised” from this event stream and are second class data citizen
  • 17. W H Y ? • Data restoration for free (if you treat your events right) • Audit log for free • Can understand the state of a system at a given time
  • 18. “It seems very pretty,” she said when she had finished it, “but it’s rather hard to understand!” ( Y O U S E E S H E D I D N ’ T L I K E T O C O N F E S S , E V E N T O H E R S E L F, T H AT S H E C O U L D N ’ T M A K E I T O U T AT A L L . )
  • 19. W H AT Y O U N E E D T O M O D E L … D O M A I N E V E N T S C O M M A N D E V E N T • Requests by a user/system/etc. to change something • Often written in the imperative mood • Meaningful domain events - not just CRUD operations • “Cancel Direct Debit”, “Onboard Customer”, “Submit Meter Read” • A notification that the state of the system has explicitly changed (or that is hasn’t) • Often written as participles • Meaningful domain events - not just CRUD operations • “Direct Debit Cancelled”, “Customer was not onboarded”
  • 20. W H AT Y O U N E E D T O M O D E L … A G G R E G AT E S C O M M A N D E V E N T • The aggregate contains the business logic to validate a command, and understand the impact it should have on the system. • If you remember from DDD: Aggregate is a domain entity. Domain entities should have the knowledge internally to determine whether a command is successful. (Clean Code, SOLID, Feature Envy etc.) • The aggregate will be a noun, and could be “Customer” or “CustomerAggregate” • May be split up for ease, in which case the top-level aggregate is an “aggregate root”. E V E N T E V E N T
  • 21. W H AT Y O U N E E D T O M O D E L … S A G A E V E N T E V E N T • A saga is a state machine that manages processes that span multiple services. These should still be domain processes! • The state of the saga is driven by the events that other services generate. If the saga feels that a change is needed based on the events, it can implement those changes by issuing one or more commands. • A saga should named after a business process, such as “Account Creation” or “Account Creation Saga” E V E N T C O M M A N D
  • 22. Z O O M I N G O U T… A G G R E G AT E W R I T E A P I R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E D V I E W M AT E R I A L I S E R C O M M A N D
  • 23. Z O O M I N G O U T… A G G R E G AT E W R I T E A P I C O M M A N D R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E D V I E W M AT E R I A L I S E R
  • 24. Z O O M I N G O U T… A G G R E G AT E W R I T E A P I E V E N T R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E D V I E W M AT E R I A L I S E R E V E N T E V E N T
  • 25. M AT E R I A L I S E R Z O O M I N G O U T… A G G R E G AT E W R I T E A P I E V E N T R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E D V I E W E V E N T E V E N T N E W R E C O R D
  • 26. M AT E R I A L I S E R Z O O M I N G O U T… A G G R E G AT E W R I T E A P I R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E D V I E W N E W R E C O R D
  • 27. Z O O M I N G O U T… A G G R E G AT E W R I T E A P I E V E N T R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E D V I E W M AT E R I A L I S E R E V E N T E V E N T
  • 28. Z O O M I N G O U T… A G G R E G AT E W R I T E A P I R E A D A P I S A G A E V E N T S T O R E M AT E R I A L I S E R M AT E R I A L I S E D V I E W C O M M A N D
  • 29. W H Y ? • All the benefits of the other patterns we’ve discussed • Single, consolidated architecture that scales nicely with the number of teams • Can spin up new microservices with minimal cost down the line
  • 30. “So she was considering in her own mind whether the pleasure of making a daisy-chain would be worth the trouble of getting up & picking the daisies...”
  • 31. M I N I S T RY O F J U S T I C E • https://github.com/ CJSCommonPlatform/ microservice_framework_version_6 • Did the project succeed? Not really. (And the consultancy behind was trashed in the news.) • Did the architecture work? No. Developers not good enough to understand it, Ivory Tower Architecture Function, 8 weeks to get words on a screen.
  • 32. M E T T L E • Challenger bank targeting SMEs. • Did the project succeed? Still going strong. (And the consultancy behind was trashed in the news.) • Did it work? Kind of? After a bit of wrangling. But we didn’t get half of what it promised.
  • 33. P E R S O N A L P R O J E C T • https://github.com/ SwamWithTurtles/decrypto-be/ • Did it work? Yeah, kinda but one person projects are always doomed to succeed.
  • 34. Everything’s got a moral (if only you can find it)