00:00:15
all right thank you all right fantastic
00:00:21
well hello everyone and welcome to the
00:00:24
intersection of architecture and
00:00:27
implementation I want to start this talk
00:00:31
with a little
00:00:33
story so a business sponsor says we need
00:00:36
an
00:00:37
architecture that will support 500,000
00:00:41
users concurrently uh with an average
00:00:44
response time of 600 milliseconds
00:00:47
underload and the architect says no
00:00:50
problem I'm on it and the architect
00:00:52
develops creates an
00:00:55
architecture so the architect brings
00:00:58
that architecture to the development
00:00:59
teams
00:01:00
and says here's the uh here's the new
00:01:03
architecture well you can guess the
00:01:07
development team has a few questions uh
00:01:09
first question well for all of the
00:01:11
asynchronous communication that we have
00:01:14
um should we use topics or should we use
00:01:17
streams like in Kafka what do you
00:01:20
suppose the answer is from the
00:01:24
architect oh no it's not it depends you
00:01:29
see there are two very famous continual
00:01:33
quotes from Architects you're right the
00:01:36
first one is it
00:01:38
depends and you know what the second one
00:01:40
is that's an implementation
00:01:43
detail yeah but what about the
00:01:46
persistence framework what should we use
00:01:48
there again that's an implementation
00:01:51
detail look look my job is architecture
00:01:55
your job is implementation now get to it
00:01:58
and of course the developers implement
00:02:02
the
00:02:03
architecture and what do you suppose
00:02:06
happens once we hit about 1,000
00:02:10
users errors exactly and after about
00:02:14
2,000 users the whole system just comes
00:02:17
up in Flames I think you're going to
00:02:20
need this for the rest of your talk so
00:02:22
I'll I'll leave that here okay thank you
00:02:27
yes there we go
00:02:30
I better put this somewhere because we
00:02:31
will be using a lot of it
00:02:35
yes this is frustrating this is an all
00:02:39
too common
00:02:42
situation where we try to do the right
00:02:45
things but it doesn't work why turns out
00:02:50
most of these cases are because the
00:02:53
architecture is not lined up and aligned
00:02:56
with the implementation and vice versa
00:02:59
and that's a exactly what I want to show
00:03:01
you in this session I want to talk about
00:03:04
the intersection of architecture and
00:03:08
implementation where they
00:03:10
intersect but also where they diverge
00:03:13
because they
00:03:15
do so I'm going to talk about some of
00:03:17
these problems but then I'm going to
00:03:20
show you some techniques and tools you
00:03:22
can use to realign and bring
00:03:26
architecture and implementation back
00:03:28
together
00:03:31
in our journey uh we'll be looking at
00:03:33
three roads we're going to travel on the
00:03:37
first road of alignment will be that of
00:03:40
operational
00:03:42
alignment the second Road on our journey
00:03:45
will be that of structural alignment
00:03:48
between the architecture and
00:03:50
implementation the Third Road will be
00:03:53
about constraints that we place on the
00:03:56
architecture which also is a form of
00:03:59
alignment
00:04:00
so we're going to take a look at all
00:04:02
three of these and then see how to fix
00:04:06
some of these
00:04:08
problems well let's put some stop signs
00:04:10
on our structural and constraint and
00:04:14
let's take a journey down that
00:04:17
operational road to see how this
00:04:19
alignment works well or doesn't
00:04:24
work so we talk about operational
00:04:27
alignment I'm talking about those
00:04:28
operational kind of characteristics as
00:04:31
the system or product or application is
00:04:35
running does it scale is it reliable is
00:04:38
it responsive all of those kind of
00:04:40
operational
00:04:42
characteristics so here's another
00:04:45
scenario well in this new system we're
00:04:48
expecting anywhere from thousands to
00:04:50
upwards to half a million concurrent
00:04:54
users so what does the architect do well
00:04:57
the architect goes to our star rating
00:05:00
chart that we developed in a ne's book
00:05:03
The fundamentals of software
00:05:05
architecture and does some qualitative
00:05:08
analysis comparing the quality of one
00:05:11
thing to the quality of another which
00:05:15
architecture would be suitable for this
00:05:16
kind of problem well one star is really
00:05:21
bad five stars is really good well our
00:05:25
concerns with this kind of problem are
00:05:28
all about scalability and
00:05:30
elasticity and if we take a look we
00:05:33
indeed do have some architectures that
00:05:35
rate Five Stars for these microservices
00:05:39
being one and space-based architecture
00:05:42
being another Well due to kind of the
00:05:44
shape of the problem and some of the
00:05:46
complexities with space space-based the
00:05:50
architect chooses to use
00:05:53
microservices and
00:05:55
architecturally this is a really good
00:05:58
choice because it will satisfy those
00:06:02
requirements of thousands to a half a
00:06:05
million users that kind of elasticity
00:06:09
because not only of the bounded context
00:06:11
but because of the short in terms of
00:06:15
hundreds of milliseconds of meantime to
00:06:17
start with each individual
00:06:20
service yeah this architecture will work
00:06:23
and it's a good
00:06:25
choice now let's go to
00:06:28
development so we have an order
00:06:30
placement service where a customer can
00:06:32
go and place an order to create an order
00:06:36
but the development team realizes
00:06:38
because of these bounded contexts in
00:06:41
microservices that order placement
00:06:44
service is going to have to go make a
00:06:46
call over to the inventory service
00:06:50
retrieve the inventory and send that
00:06:52
inventory back to that order placement
00:06:55
service development team looks at this
00:06:57
and they're sharp by the way and sayou
00:07:00
know this is way too slow and it's
00:07:04
coupling these Services
00:07:06
together um this is a
00:07:10
problem I know to better decouple these
00:07:14
Services what we can do is put an
00:07:17
inmemory replicated cache in inventory
00:07:21
and then have a corresponding read only
00:07:24
replica in our order placement and the
00:07:27
team says and we'll use Hazel cast to
00:07:30
always keep these in sync so that when
00:07:34
we do have an update to inventory now
00:07:37
the cash gets updated in inventory
00:07:40
hazelcast synchronizes
00:07:42
it
00:07:44
wow this is cool this is a smart choice
00:07:49
because it is a lot faster we increase
00:07:52
our responsiveness and we've decoupled
00:07:55
our
00:07:56
services devel development team give
00:07:58
each other a high five and go ahead and
00:08:01
implement this
00:08:06
solution after production
00:08:10
release what happens well it works fine
00:08:14
until we start to scale and we realize
00:08:17
that that inmemory cache in each
00:08:19
instance is 500
00:08:21
megabytes of items and their inventory
00:08:24
and as we start to
00:08:26
scale
00:08:28
2,000 3,000 users 10,000 users we can
00:08:32
start to see we will never ever reach
00:08:37
close to half a million
00:08:39
users yet again another epic
00:08:46
failure there we go yes what
00:08:51
happened these were two really good
00:08:55
choices between the architect choosing
00:08:57
the appropriate architecture and the
00:09:00
development
00:09:01
teams realizing
00:09:04
inefficiencies what happened was a
00:09:06
misalignment where the architecture was
00:09:09
focused on scalability and
00:09:12
elasticity but
00:09:14
implementation placed more of a focus on
00:09:16
performance and
00:09:18
decoupling thereby misaligning the
00:09:21
architecture and those quote are you
00:09:24
ready implementation details yeah right
00:09:29
so this is the concern with operational
00:09:32
characteristics and operational
00:09:34
alignment but there's two other kinds of
00:09:37
alignment we
00:09:40
have let's put a stop sign on the
00:09:43
operational and open the road and take a
00:09:46
journey through structural
00:09:53
alignment let's take a look for example
00:09:56
at a typical house or a flat or
00:09:58
apartment
00:10:00
it consists of rooms as a matter of fact
00:10:03
we can say that that that house is made
00:10:05
up of
00:10:06
rooms those rooms each serve a different
00:10:09
purpose we have a kitchen different
00:10:11
kinds of bedrooms we have a office a
00:10:13
bathroom all these kind of hallway
00:10:16
stairs so you can kind of think of these
00:10:19
rooms as the building blocks of that
00:10:23
house well by the same token logical
00:10:27
components things that a system
00:10:31
does become the building blocks of our
00:10:36
systems portions of the system things
00:10:40
that that system has tasks for has to do
00:10:44
and as a matter of fact those building
00:10:47
blocks all form together just like that
00:10:50
floor
00:10:51
plan for the application or maybe it's
00:10:54
services that they combine
00:10:57
into either way logical components are
00:11:02
the building blocks of any software
00:11:05
solution this is what I mean by
00:11:09
structure by the internal architecture
00:11:12
of a particular monolithic application
00:11:15
or even a service so let's take a look a
00:11:19
little bit at this structure piece and
00:11:22
this is called a logical architecture
00:11:25
and as a matter of fact we couple or
00:11:27
combine some of these compon on together
00:11:30
into
00:11:31
domains we could actually
00:11:34
see the
00:11:36
architecture we
00:11:38
realize that logical architecture
00:11:41
through the way we structure our
00:11:45
code so these logical components the
00:11:48
building box they're just not boxes on a
00:11:51
page no they're actually manifested
00:11:55
through the directory structure or
00:11:57
namespace of our systems
00:11:59
and so for example the higher level
00:12:02
nodes represent the domains and
00:12:04
subdomains of our system and then the
00:12:06
lower level nodes represent those
00:12:09
Architectural Components those building
00:12:12
blocks of our
00:12:14
system so let me show you an example
00:12:17
let's take payment processing for
00:12:21
example well I need to write a class so
00:12:23
I will write a class and notice it's
00:12:25
getting placed right in that payment
00:12:28
directory called credit card. Java and
00:12:31
this charge is a credit card when we
00:12:34
write software when we write class files
00:12:38
we physically have to put them somewhere
00:12:41
so this one goes inside the payment
00:12:43
directory or payment namespace why well
00:12:47
Market has to do with Payment Processing
00:12:49
ah but
00:12:50
remember a logical
00:12:53
component in an
00:12:55
architecture is manifested or realized
00:12:59
through the name space or package
00:13:02
structure or directory which means that
00:13:06
that class file is one of the many
00:13:08
classes that implements the payment
00:13:12
logical architecture component so that's
00:13:15
our
00:13:17
definition
00:13:18
now let's see how
00:13:21
disastrous this could get so here's our
00:13:25
scenario in this case um company needs a
00:13:28
new system system for their customers to
00:13:30
be able to enter trouble tickets into
00:13:34
the system for products that they buy
00:13:35
from our company if they have a problem
00:13:38
with it for installation or the thing
00:13:39
just breaks uh they can enter a trouble
00:13:42
ticket and our field experts will come
00:13:44
to your home or office and fix your
00:13:47
problem well as an architect this is The
00:13:51
Logical
00:13:53
architecture now this is void of any
00:13:55
databases or services this is The
00:13:58
Logical architecture
00:13:59
how the system will be
00:14:01
constructed and you'll notice there's
00:14:03
things like ticket creation assigning a
00:14:06
ticket ticket assignment ticket routing
00:14:08
to Route it to the field expert uh
00:14:10
there's customer profile registration uh
00:14:13
surveys to send and receive them um all
00:14:16
of these are the building blocks of that
00:14:19
system The Logical architecture of a
00:14:22
system shows how that system will work
00:14:26
and how it's coupled the dependent
00:14:29
between these pieces of
00:14:33
functionality okay so an architect
00:14:35
spends a lot of time drawing lines and
00:14:37
boxes and realizing um how is this going
00:14:40
to work now we go to
00:14:44
development so the developers code this
00:14:47
up by the way good
00:14:50
news 100% code
00:14:54
coverage absolutely everything works and
00:14:58
this is is what the development team
00:15:00
came up
00:15:03
with do we
00:15:07
remember the logical architecture of any
00:15:10
system can be realized through the way
00:15:13
the source code is
00:15:16
organized well here's my logical
00:15:19
architecture but but where is ticket
00:15:22
creation I I can't find it in the source
00:15:26
code um how about things like for
00:15:30
example the customer registration or or
00:15:33
even the customer
00:15:35
profile I don't see it there and this
00:15:37
ticket State that's not even in my
00:15:41
architecture well all that work that I
00:15:44
did to draw and realize a logical
00:15:48
architecture a structure of the
00:15:50
system is not there this is what that
00:15:54
logical architecture looks
00:15:57
like and as a matter of fact we can
00:16:00
compare these two because the structure
00:16:03
the architecture of a system allows us
00:16:07
to have better understanding of how it
00:16:09
works learnability
00:16:12
maintainability the ease of testing of
00:16:14
our system the risk of deployment in our
00:16:17
system how easy is it to change to
00:16:20
understand the system extend the system
00:16:23
adopt it to New
00:16:26
functionality which of these looks a
00:16:29
little closer to all of those
00:16:32
goals the original one but of course
00:16:36
even though all the functional tests
00:16:39
pass this system is not maintainable not
00:16:44
reliable not testable no one understands
00:16:47
it it's just a bunch of
00:16:49
lines yeah so here we see another type
00:16:55
of alignment between architecture and
00:16:58
implementation
00:16:59
the fact that the logical architecture
00:17:02
and the way the C was structured didn't
00:17:06
match
00:17:08
okay there's one more road to go through
00:17:12
and that is the constraints road so
00:17:15
let's move that stop sign over to the
00:17:17
structural and go down this road of
00:17:20
constraints yet another type of
00:17:23
alignment between architecture and
00:17:25
implementation
00:17:29
when we talk about constraints let me
00:17:31
show you an
00:17:33
example here's another business case we
00:17:37
have a very tight time frame and a very
00:17:40
tight budget for this new project no
00:17:43
one's ever heard that
00:17:45
before however we also expect a lot of
00:17:50
continuous
00:17:51
change of the data structures in this
00:17:55
system we anticipate it we know what
00:17:57
going to happen we don't have a good
00:17:59
understanding of this particular domain
00:18:03
and when we make those database changes
00:18:06
we have to move and make those as fast
00:18:10
as
00:18:10
possible there's our problem
00:18:14
domain so the architect goes back to
00:18:16
those star rating charts and says I
00:18:19
wonder what architecture would satisfy
00:18:21
that kind of shape of a
00:18:24
problem and so key point is tight time
00:18:27
frame and tight budget lend itself lend
00:18:30
itself towards cost and simplicity now
00:18:35
here this might look confusing um
00:18:37
because a lot of stars mean really good
00:18:40
the fewer Stars means really bad so cost
00:18:43
here is five stars that does not mean
00:18:45
it's expensive that means it's really
00:18:48
good and we can see a lot of choices
00:18:50
here the traditional end tiered layered
00:18:53
architecture hm that might be a
00:18:56
possibility modular monolith oo that's
00:18:59
popular maybe we should use that micr
00:19:02
kernel architecture otherwise known as
00:19:04
the plug-in
00:19:06
oo maybe I should put that in my wish
00:19:08
list but also there's service-based
00:19:11
architecture not as many stars but has
00:19:15
some
00:19:18
H wait a minute do you
00:19:21
remember our
00:19:24
problem we're anticipating and will
00:19:27
experience a lot of changes to the
00:19:31
structure of that
00:19:35
data that's
00:19:37
changes not to a
00:19:39
domain that's changes to a technical
00:19:42
layer in the architecture architectures
00:19:45
are partitioned either technically or by
00:19:49
domain partitioning but if we have a lot
00:19:52
of changes to our data wouldn't it make
00:19:54
sense to have a technically partitioned
00:19:57
architecture and as a matter of fact it
00:20:00
would one star for domain means it's
00:20:02
Technical and so that kind of says well
00:20:05
I think the layered
00:20:07
architecture is the way to go and as a
00:20:10
matter of fact it would be the right
00:20:13
choice for this kind of problem I mean
00:20:15
think about it we've got a separation of
00:20:18
concerns technically and also layers of
00:20:21
isolation those two things combined in a
00:20:24
layered architecture give us great
00:20:27
Change Control
00:20:29
because done correctly those constant
00:20:32
changes to the
00:20:33
database means I'm only changing one
00:20:36
layer in that architecture all the other
00:20:39
ones are
00:20:42
good interesting the layered
00:20:45
architecture which we've been doing for
00:20:47
70 decades is not
00:20:51
dead no this is a viable option as a
00:20:54
matter of fact it's a really good
00:20:56
architecture for this particular domain
00:20:58
proc
00:20:59
problem however to make this work what
00:21:02
do I need to
00:21:03
do I need to apply
00:21:07
constraints our first
00:21:10
constraint um presentation business and
00:21:12
services yeah you can't talk directly to
00:21:15
the database you have to kind of go
00:21:17
through all those layers that's our
00:21:19
first constraint second constraint um
00:21:22
you have to respect the open and closed
00:21:25
layers now a closed layer means ah I got
00:21:28
to go right through that an open one
00:21:30
means I can bypass it and the third
00:21:33
constraint is this all databased logic
00:21:38
must exist in the persistence
00:21:41
layer three
00:21:43
constraints you
00:21:46
know I would hire this architect I would
00:21:50
work beside this architect because this
00:21:53
will
00:21:57
work let's take take a look at the quote
00:22:00
implementation
00:22:02
detail because the presentation
00:22:04
developers realize that this is nonsense
00:22:08
a lot of our queries just need simple
00:22:11
data I have to go through every one of
00:22:13
these closed layers this is silly um one
00:22:16
of the members on this team realized
00:22:19
that there's a pattern called the fast
00:22:20
lane reader pattern we can shortcut
00:22:23
those layers and go to the database
00:22:25
directly therefore significantly in
00:22:28
increasing the
00:22:30
performance and responsiveness of our
00:22:33
system yeah cool stuff let's do
00:22:38
it the backend developers get really
00:22:41
frustrated about the fact that all the
00:22:44
databased logic is moved from the
00:22:47
business logic I mean one of the trends
00:22:50
that we have in this industry is of
00:22:52
course to try to bring data closer to
00:22:55
the processing not further away and this
00:22:58
is making it a real hassle to maintain
00:23:01
anything it's taking too long so the
00:23:04
backend developers realize you know it
00:23:06
just makes a lot more sense and it is a
00:23:08
trend to keep that database logic close
00:23:11
to me so I could see everything at once
00:23:14
much better
00:23:16
maintainability so they implement it
00:23:19
that
00:23:20
way and of course let's do our
00:23:24
production release boy don't you hate
00:23:26
releasing software
00:23:31
better get ready because you know what's
00:23:32
going to happen all of a sudden what
00:23:36
well that database change sure enough
00:23:39
comes about all the time but because the
00:23:43
constraints weren't
00:23:46
followed I have to change every single
00:23:51
layer in this
00:23:53
architecture and yeah you know what
00:23:56
happens yeah
00:23:59
disaster yes database changes take way
00:24:02
too long that was our primary
00:24:05
goal so what happened here in this
00:24:09
scenario scenario was the architecture
00:24:12
very
00:24:13
sound focused on
00:24:16
isolation of technical layers agility
00:24:19
that ability to respond quickly to
00:24:21
change where as the implementation of
00:24:23
this architecture Place more focus on
00:24:26
maintenance and performance
00:24:28
again misaligned with the
00:24:32
architecture wow a lot of fires in this
00:24:35
uh talk isn't
00:24:36
[Laughter]
00:24:39
it all
00:24:41
right well now we see the problem there
00:24:45
are three types of alignment that we
00:24:48
continuously get
00:24:50
misaligned so how do we solve this
00:24:57
problem what one way to do it is through
00:25:02
governance governance or compliance done
00:25:05
through architectural Fitness functions
00:25:08
a fitness function in architecture is a
00:25:10
test it's something we write or metrics
00:25:13
We Gather that tests some sort of
00:25:18
architectural characteristic objectively
00:25:21
meaning through
00:25:22
metrics these are tests that we can run
00:25:25
to govern all three of these problems
00:25:29
operational structural and
00:25:32
constraints well let's take a look at
00:25:34
how to apply governance Fitness
00:25:37
functions to our problem let's start
00:25:39
with operational where we started
00:25:43
before we have a lot of tools and
00:25:46
metrics or tools I should say that
00:25:49
generate all sorts of metrics for us
00:25:51
that we can start tracking and gathering
00:25:54
for things like scalability
00:25:57
responsiveness elasticity reliability
00:26:00
error rates we can leverage these tools
00:26:03
or sometimes we write them ourselves in
00:26:06
production and let me give you an
00:26:07
example here's a website a service a
00:26:10
system a product and what that does is
00:26:13
it streams it makes observable some sort
00:26:16
of metric let's say response times and
00:26:18
user load that we stream to let's say
00:26:21
Kafka or a q we then write a capture
00:26:24
service which then receives all that raw
00:26:27
data and maybe does some filtering on it
00:26:29
because we don't need every data point
00:26:32
usually then the fun part comes because
00:26:34
then we write an analytics service this
00:26:37
is the fitness function that basically
00:26:40
reads that data and starts tracking
00:26:43
things over time uh looks for Trends
00:26:46
looks for thresholds and when a
00:26:48
threshold is reached or a trend is
00:26:50
noticed alert me otherwise just leave me
00:26:53
alone and this just continuously runs in
00:26:56
production yeah
00:26:58
here's a good example we needed high
00:27:01
levels of
00:27:03
scalability so we measure our user load
00:27:06
against response time and notice our
00:27:11
response time starting to vary a bit but
00:27:13
we have a
00:27:15
consistent increase in the number of
00:27:18
users but look at our response time this
00:27:22
is what that analytic service does that
00:27:24
Fitness function does it it calculates
00:27:26
either the slope for example
00:27:28
or maybe a standard deviation from a
00:27:30
variance of a mean and we can see that
00:27:33
this is overall pretty
00:27:35
flat yeah this test
00:27:39
demonstrates a scalable system or it
00:27:42
would demonstrate that it isn't
00:27:46
scalable so these Fitness functions are
00:27:48
really useful for for these kind of
00:27:51
operational concerns and isn't it
00:27:54
interesting most of you have probably
00:27:56
heard of Fitness function I'm hoping a
00:27:59
lot of you use Fitness functions we tend
00:28:02
to think of these kind of tests only for
00:28:05
operational
00:28:07
stuff but they can also be used not only
00:28:11
to align
00:28:13
operational characteristics and
00:28:16
architecture with
00:28:17
implementation but also for other
00:28:20
aspects for example let's take a look
00:28:23
again at our structural alignment or the
00:28:27
problems we had with that that what we
00:28:29
can do to leverage these are free tools
00:28:31
that are available in Java Arc unit uh
00:28:35
in net um Arc unit net net Arc test uh
00:28:40
sonar graph for python C++ Java c um py
00:28:45
Arc test for python these are all tools
00:28:49
that are available to you here that you
00:28:51
could actually
00:28:53
write
00:28:55
tests to govern the structure
00:28:58
of our system that logical
00:29:01
architecture let me give you a very
00:29:03
simple
00:29:04
example we want to have that directory
00:29:07
structure represent our logical
00:29:11
architecture but what's to stop a
00:29:13
developer from naming it anything they
00:29:15
wanted to or creating more and more and
00:29:18
more
00:29:18
domains this
00:29:21
tests stops them because this will fail
00:29:25
if that directory structure becomes
00:29:26
misaligned with our iCal architecture
00:29:29
are components classes should reside in
00:29:32
a package A B C or D and we can continue
00:29:36
to write these tests to basically
00:29:40
codify our logical
00:29:43
architecture that's really cool and of
00:29:47
course we can plug this into nunit junit
00:29:50
um any kind of testing framework or even
00:29:52
just our
00:29:55
pipeline neat and this is one way of
00:29:59
assuring this alignment between our
00:30:02
logical
00:30:04
architecture and the way our code is
00:30:06
actually
00:30:08
structured okay well there was a third
00:30:11
wasn't there that was
00:30:13
constraints let's take a look at
00:30:15
constraints because we can use these
00:30:17
same tools that I just showed you to
00:30:21
also govern constraints we
00:30:23
have so presentation layer can't talk to
00:30:28
the
00:30:29
database can't talk to persistence you
00:30:31
have to go through all of the layers
00:30:34
they're closed layers okay that's a
00:30:36
constraint but no one's going to follow
00:30:38
that no one cares so how do we write a
00:30:41
test for it well in our unit it's
00:30:44
actually pretty simple no classes that
00:30:48
reside in a package presentation or
00:30:51
persistence or in this case presentation
00:30:53
should access classes that reside in a
00:30:57
package or
00:30:58
space persistence
00:31:02
check yeah these are really cool tools
00:31:05
the same thing in C for example um types
00:31:08
in the current domain that reside in a
00:31:10
particular name space should not have a
00:31:13
dependency on
00:31:14
these now Neil Ford and I have been
00:31:17
experimenting we we we we use these all
00:31:19
the time and past couple of months ago
00:31:24
we were musing hey I wonder how uh
00:31:27
generative AI would work for generating
00:31:31
these kind of tests if we can describe
00:31:33
our constraint describe our architecture
00:31:37
uh describe what we need um Can it
00:31:40
generate Arc unit
00:31:43
code net Arc test code well the good
00:31:47
news
00:31:48
is yeah it actually did a really good
00:31:51
job at generating this stuff yeah which
00:31:55
now okay I'm sorry you just simply don't
00:31:58
have an excuse now to do this I don't
00:32:00
have time it's a
00:32:02
[Laughter]
00:32:05
prompt all right so this is yet another
00:32:08
way of aligning
00:32:10
constraints another alignment between
00:32:12
architecture and quote that
00:32:15
implementation
00:32:19
detail
00:32:21
H that stuff
00:32:24
works
00:32:26
governance is really
00:32:29
good I mean this going to keep things
00:32:31
aligned but there's a
00:32:34
problem there's a big
00:32:37
problem because the only thing
00:32:39
governance shows
00:32:41
us is that we have a
00:32:45
problem we're continually slapping
00:32:47
developers hands saying don't do that
00:32:49
don't do this don't do this yeah
00:32:51
governance is good I would urge you to
00:32:54
use these tools use Fitness functions
00:32:56
any of these tools to govern but it's
00:32:59
not going to solve the problem of
00:33:04
alignment because the root problem is
00:33:07
all about communication and
00:33:12
collaboration let's face it this is
00:33:15
tough developing software is
00:33:18
hard because we do have software
00:33:21
architecture way over here and we do
00:33:25
have implementation way over there
00:33:28
and the problem is these are two
00:33:32
separate things I mean a software
00:33:35
architect has specific roles on any
00:33:39
product the first is to understand what
00:33:42
are those architectural characteristics
00:33:44
that are critical or important to us
00:33:47
what kind of architecture style matches
00:33:49
those and the shape of our problem and
00:33:54
designing the internal structure those
00:33:56
logical components
00:33:58
of the
00:33:59
system that's what an architect
00:34:02
does and then those artifacts get sent
00:34:05
over to
00:34:07
implementation what do developers do
00:34:09
well they take those
00:34:11
components like payment or order
00:34:14
placement and now they figure out what
00:34:17
classes should I do that's design um
00:34:20
class diagrams figuring out inheritance
00:34:23
composition structures and what patterns
00:34:25
to use also maybe it's UI design
00:34:28
and of course
00:34:31
coding
00:34:33
well this picture right here shows you
00:34:37
exactly
00:34:39
why we continually get out of alignment
00:34:43
with architecture and implementation why
00:34:47
things will never
00:34:49
work and it's because of this single
00:34:53
unidirectional line right here
00:34:59
everyone there's really not a Gray Line
00:35:02
a gray area between architecture and
00:35:05
design or architecture and
00:35:07
implementation no we can get rid of that
00:35:09
Gray Line because you know what it is
00:35:12
it's a Chasm that separates these two
00:35:17
camps and as a matter of fact most of
00:35:19
the decisions an architect makes go
00:35:22
straight into this Canyon right here
00:35:25
developers never ever see that
00:35:28
what do development teams do when they
00:35:31
Implement our
00:35:32
architecture what they do is they
00:35:35
actually validate our assertions and
00:35:40
assumptions about the problem about the
00:35:42
architecture oh yeah and those are
00:35:45
always correct yeah so changes need to
00:35:48
be made to the overall architecture and
00:35:51
design development teams do that and
00:35:53
those changes go straight into that
00:35:55
Chasm never reaching the poor hapless
00:35:58
architect who thinks that their
00:36:00
Solutions are perfect everywhere wow no
00:36:02
one says anything about it it must be
00:36:04
great
00:36:07
oi
00:36:09
listen to get architecture to
00:36:12
work to realign architecture and
00:36:15
implementation that requires us to fill
00:36:19
in this Chasm and form a bidirectional
00:36:23
relationship between architecture and
00:36:26
also implement ation where the
00:36:29
Architects are on the same virtual
00:36:31
team allowing for very effective
00:36:34
communication of changes and the
00:36:36
architecture itself to the development
00:36:38
team and when not if we're wrong as the
00:36:44
architect those changes effectively get
00:36:46
back to me so that I can change the
00:36:48
architecture and get those changes
00:36:50
effectively back to the development team
00:36:53
and as a matter of fact this is one of
00:36:55
the only ways I've found everyone to
00:36:57
facilitate those soft skills of
00:36:59
mentoring coaching and
00:37:02
Leadership that an architect is supposed
00:37:05
to do with development teams
00:37:10
H so how do we do
00:37:13
this I mean we're told yeah we should
00:37:16
communicate and
00:37:18
collaborate we're always told that but
00:37:20
we're never told how we should do it let
00:37:24
me show you how so there's two golden
00:37:28
rules of
00:37:31
collaboration between Architects and
00:37:33
development teams engagement models
00:37:36
here's the first one if developers don't
00:37:39
know why you made a
00:37:42
decision they're less likely to agree
00:37:45
with it number
00:37:48
two if developers aren't
00:37:51
involved in the architectural decisions
00:37:54
they're less likely to follow it oh they
00:37:57
might agree oh I agree with you but
00:37:59
we're not going to do that we're going
00:38:01
to do our own thing yeah well let's take
00:38:03
a look at these two golden rules of
00:38:06
collaboration and how to solve these
00:38:08
issues or address these
00:38:10
issues let's start with the first one
00:38:13
gold in rule number one if developers
00:38:15
don't know why you made a decision
00:38:18
they're less likely to agree with it
00:38:21
this leads to what Neil and I coined in
00:38:24
our fundamentals book the second law of
00:38:28
software
00:38:29
architecture why is more important than
00:38:34
how oh I could look at an architecture
00:38:37
diagram and I could see how the system
00:38:39
works but what I don't know is why you
00:38:42
chose to do it that way yes so one of
00:38:46
the ways to solve this problem
00:38:48
architecture decision records to the
00:38:51
rescue
00:38:53
adrs now I want to pause right here
00:38:57
because
00:38:58
it used to be back in around 2018
00:39:02
2019 uh the the the prepandemic days uh
00:39:06
we used to have a drinking game at
00:39:08
conferences and it was called the
00:39:10
conways law drinking game uh anytime
00:39:14
anybody up on stage said the words
00:39:16
Conway's law you had to take a
00:39:18
drink you wondered why all the speakers
00:39:21
were stumbling around on stage yeah
00:39:24
because it was mentioned about every
00:39:25
five minutes
00:39:28
well now enter 2023 2024 that drinking
00:39:33
game has changed anytime a speaker
00:39:35
mentions ADR you got to take a drink
00:39:37
yeah and we still have a bunch of drunk
00:39:39
people in the conference but here's the
00:39:43
thing a lot of you may have heard of
00:39:46
architecture decision records maybe
00:39:48
using them but most of us think of those
00:39:51
as grown yet another form of
00:39:54
documentation
00:39:58
nope I'm going to show you how to
00:40:02
leverage an ADR as a
00:40:06
tool for engagement as a tool for
00:40:09
collaboration not
00:40:11
documentation so when we make an
00:40:13
architecture decision we fill out an
00:40:16
architecture decision record each
00:40:17
decision has its own I put the title the
00:40:20
status whether it's proposed or accepted
00:40:22
maybe it's superseded by another one uh
00:40:25
a short paragraph a couple of sentences
00:40:27
about the context what is it I'm having
00:40:30
to make a decision on the decision
00:40:32
itself with justifications and the
00:40:34
consequences of that decision the
00:40:38
impact this is not
00:40:42
documentation this is a tool we could
00:40:45
all use because we could leverage two
00:40:50
sections here first the decision section
00:40:54
I have to provide a justification for
00:40:57
for my decision and also the
00:41:00
consequences I can now describe the
00:41:02
trade-off analysis and the impact and
00:41:04
the consequences of this
00:41:06
decision this is a fantastic vehicle
00:41:10
between Architects and
00:41:12
developers to solve this why
00:41:16
problem so this is a this just
00:41:18
leveraging them by the way you're like
00:41:20
ah wow what a great idea Mark but our
00:41:23
company doesn't use adrs well neither
00:41:26
does ours we still use
00:41:29
them you don't have to embrace the whole
00:41:32
infrastructure of an architecture
00:41:34
decision record I call these temporal
00:41:37
architecture decision records in other
00:41:40
words we're not going to use them for
00:41:41
documentation no I'm using these as a
00:41:44
vehicle so that developers understand
00:41:48
why I'm making certain choices okay
00:41:52
let's take a look at that second Golden
00:41:53
Rule here if developers aren't involved
00:41:57
in a decision they're less likely to
00:42:00
follow it here's the problem let's read
00:42:04
this so the architect says this we're
00:42:07
going to use request reply messaging
00:42:09
between our services because it's faster
00:42:12
and it's uh it's more scalable than
00:42:15
rest
00:42:16
okay right away we see a couple of
00:42:19
problems with this statement oh the good
00:42:22
thing the good thing is that I did
00:42:24
justify it we're using it because it's
00:42:28
faster and more scalable than rest but
00:42:31
this is not
00:42:32
collaboration this is
00:42:35
communication I'm telling the
00:42:37
development team this and what do you
00:42:39
suppose a likely response would be yeah
00:42:43
actually we're going to use rest we
00:42:44
checked with chat g chat GPT and it says
00:42:47
it's actually faster and more scalable
00:42:49
so but but but but but wait a minute
00:42:52
says the architect I'm the architect
00:42:54
this is my decision and in our
00:42:56
environment is faster yeah what whatever
00:42:58
whatever
00:43:01
hey wow what do we do
00:43:05
now yeah talk about losing control of
00:43:08
the team the root cause of these kind of
00:43:11
real world scenarios is actually a
00:43:15
matter of lack of trust and respect if
00:43:19
we had another 45 minutes we would
00:43:21
launch into that topic oh but we only
00:43:23
have a couple of minutes left so how do
00:43:27
we address this problem well let's
00:43:29
address
00:43:30
it the
00:43:32
answer is right here
00:43:36
DDD ah but not domain driven design no
00:43:42
that will not solve this problem what
00:43:45
will is
00:43:47
DDD remember those three
00:43:51
letters
00:43:52
demonstration defeats
00:43:55
discussion DD D we could talk all day
00:44:00
and argue all day about something and
00:44:02
not get
00:44:03
anywhere if I can demonstrate for you
00:44:05
with metrics actual results it usually
00:44:10
stifles the argument and stops the
00:44:12
discussion let's go back to that really
00:44:16
bad
00:44:17
scenario and look how to repair it so
00:44:20
the architect says this hey I ran some
00:44:22
benchmarks in our production environment
00:44:25
against rest and messaging
00:44:27
and take a look at this this is really
00:44:30
interesting so in our environment
00:44:32
response times go north and we've got of
00:44:35
course user load and watch this when I
00:44:38
ran these benchmarks in production check
00:44:41
it
00:44:42
out chat PT close to right I mean yeah
00:44:47
it was just as scalable just as
00:44:49
responsive but look what happens because
00:44:51
this is where our expected user load is
00:44:55
and this
00:44:57
is our response time service level
00:45:00
agreement and you can see messaging is
00:45:03
well within this range but at these
00:45:05
levels in our environment rest is
00:45:08
Not So based on this says the architect
00:45:12
I'm thinking we should probably use
00:45:14
request reply messaging between the
00:45:16
services are you ready what do you
00:45:19
think that's collaboration I'm not
00:45:22
telling you so based on this we're going
00:45:24
to use this I think we should use this
00:45:26
what do you you think and now the
00:45:28
response is wow well you know we were
00:45:30
going to use rest but wow based on this
00:45:33
yeah well you're right I'm glad glad you
00:45:35
did this we'll definitely use
00:45:38
messaging and there's one last Technique
00:45:41
we can use to involve developers with
00:45:45
our architecture and architecture
00:45:47
decisions you know what that is
00:45:50
architecture decision records again to
00:45:53
the
00:45:54
rescue a vehicle for
00:45:57
engagement with the development team so
00:46:02
we can look at the status right here
00:46:03
proposed accepted superseded let's add
00:46:07
another one and that status is request
00:46:11
for comment by a certain date RFC status
00:46:16
this I'm opening up to say development
00:46:20
teams um pick it apart uh what's your
00:46:23
opinions uh what's your criticism about
00:46:25
it and this allows developers to look at
00:46:28
the decision before I make it and say
00:46:30
yeah this this is this is bad yeah no I
00:46:33
don't like this oh yeah this is spot on
00:46:35
so on and so forth this is a win-win
00:46:38
situation you you can't lose by doing
00:46:42
this I win as an
00:46:45
architect because developers feel
00:46:47
involved in the decisions it's not just
00:46:51
me I
00:46:53
win as an
00:46:55
architect because now
00:46:57
there might be a comment in there of
00:46:58
something I missed I might have a
00:47:00
comment about the fact you can't do that
00:47:02
there's a firewall between these oh
00:47:04
right and therefore together we're
00:47:07
making the right
00:47:08
decision these are all kind of
00:47:11
techniques that we can
00:47:12
use to basically
00:47:16
realign architecture with
00:47:21
implementation so let me leave you all
00:47:25
with this this is one of my fav quotes
00:47:28
from our book The fundamentals of
00:47:30
software
00:47:31
architecture and it goes as follows
00:47:34
developers should never take the
00:47:37
components designed by Architects as the
00:47:40
last
00:47:41
word rather it should be
00:47:45
viewed as a first
00:47:48
draft where
00:47:51
implementation will reveal more details
00:47:54
and refinements my favorite quote in our
00:47:59
book
00:48:01
collaboration constant iterative
00:48:04
architecture working
00:48:08
together with architecture and
00:48:11
implementation to solve that business
00:48:15
problem ladies and
00:48:17
gentlemen it is not an
00:48:21
implementation
00:48:23
detail awesome thank you all so much
00:48:26
thank you
00:48:27
all
00:48:32
right I I do believe we have some time
00:48:36
for uh a couple of questions if there
00:48:38
are any from uh from the crowd we do we
00:48:42
do raise your hands oh the Wonder ball
00:48:46
goes round and round I like that thing
00:48:49
hello yeah perfect um amazing
00:48:52
presentation by the way um one question
00:48:54
actually is um I've been hearing quite a
00:48:56
lot like in the like common point of
00:49:00
like uh talk is like between how do you
00:49:03
like communicate stuff between
00:49:05
Architects and the D teams and that was
00:49:07
a central point in your end of
00:49:09
presentation and then I propose a
00:49:11
question why do we still keep Architects
00:49:15
separated from developers in general why
00:49:17
not empowering the development teams to
00:49:20
take architectural decisions yes so
00:49:22
fantastic question about this separation
00:49:25
that we still continue you have and
00:49:28
development teams being able to empower
00:49:31
them to make their own decisions be more
00:49:33
aware of architecture um one of the
00:49:36
things that I evangelize perhaps the
00:49:38
most in Consulting gigs and trainings
00:49:42
and conferences master classes is this
00:49:46
notion of what's called architectural
00:49:49
thinking and this notion is about how do
00:49:53
you actually think like an architect
00:49:57
this concept empowers development teams
00:50:00
to be more aware of
00:50:03
architecture and so by doing this kind
00:50:06
of architectural thinking um we put less
00:50:09
stress and less need on an architect and
00:50:12
we get much more effective uh and
00:50:15
efficient software uh for example uh
00:50:19
things such as knowing what are the
00:50:21
architectural characteristics those nfrs
00:50:23
or non-functional requirements that we
00:50:26
need
00:50:27
and constantly thinking about those as
00:50:31
we're developing software that keeps
00:50:33
that alignment going and I don't have to
00:50:35
be the architect to say that um things
00:50:39
about trade-off analysis understanding
00:50:41
that how I make a decision is usually
00:50:44
based on those architectural
00:50:46
characteristics scalability
00:50:48
responsiveness agility whatever they
00:50:50
happen to be um and also the third thing
00:50:53
is increasing our technical breadth of
00:50:56
of knowledge uh the amount of things I
00:50:59
know less about but more of and it's
00:51:02
that middle part of our knowledge
00:51:04
triangle things we know we don't know uh
00:51:07
those three techniques are one way of
00:51:09
starting to really Empower development
00:51:12
teams uh to start thinking
00:51:14
architecturally putting themselves in
00:51:16
the brain of an architect when trying to
00:51:19
solve problems so yeah yeah uh this is
00:51:22
one of the things that I am evangelizing
00:51:24
and hopefully before I uh passed from
00:51:27
this world into another one um uh more
00:51:30
development teams will be embracing
00:51:32
architectural
00:51:35
Concepts do we have more questions one
00:51:39
more question there's a handun going up
00:51:41
in the back I some help oh boy here we
00:51:45
go I feel I feel like I'm at the ball
00:51:48
game
00:51:49
again all
00:51:51
right uh thanks so very much for the
00:51:53
talk um it was interesting to you talk
00:51:57
about architecture decision records
00:51:59
because whether or not we take a drink I
00:52:01
feel like a lot of the time there's a
00:52:04
brief burst of enthusiasm but the result
00:52:06
is a lot of folders with exactly one
00:52:09
architecture decision record in them
00:52:12
because you don't get the Buy in and
00:52:15
therefore it doesn't people don't
00:52:16
realize the value so I wonder if you've
00:52:18
got any kind of pointers on how to make
00:52:21
it more of an ongoing process for
00:52:23
communication rather than like an
00:52:24
occasional we must do this and then it
00:52:26
gets forgotten after a week sure
00:52:28
absolutely because um I happen to be as
00:52:31
you probably guess a big fan of adrs I
00:52:34
find them extremely effective however uh
00:52:38
most companies don't embrace them uh two
00:52:42
reasons one a lot of times to your point
00:52:46
it is all or nothing you have adrs that
00:52:51
describe your architecture decisions and
00:52:53
reasons why you did something or you
00:52:55
have documents but but if you start
00:52:56
blending them now I've got two places to
00:52:59
go to figure out the architecture and so
00:53:01
it's that full immersion of them that
00:53:04
usually leads most companies to say yeah
00:53:06
not yet so what I like to do um to
00:53:11
really demonstrate the effectiveness and
00:53:14
power of architecture decision records
00:53:16
are the same kind of techniques I just
00:53:18
showed you here um use these as a
00:53:22
communication and collaboration vehicle
00:53:25
and Tool uh between Architects and
00:53:27
developers what we saw here but also
00:53:31
engagement models between Architects and
00:53:34
also the product
00:53:35
team product teams making certain
00:53:37
decisions we don't understand we make
00:53:40
decisions the product team doesn't
00:53:43
understand and using this as a vehicle
00:53:45
allows us both to come together in a
00:53:48
single document artifact to be able to
00:53:51
understand each other and to be able to
00:53:54
also validate those
00:53:57
decisions so by doing this temporal by
00:54:00
the way temporal meaning they're just
00:54:03
temporary trying this out creates an
00:54:06
awareness of the value of these
00:54:10
adrs and hopefully by demonstrating that
00:54:13
value again remember
00:54:15
DDD demonstration defeats discussion
00:54:18
Europe DDD Europe there we go um but by
00:54:21
demonstrating that value and other
00:54:24
people realizing it um might cause other
00:54:26
teams to say you know for this new
00:54:28
product why don't we try
00:54:30
adrs um maybe it's for major decisions
00:54:33
first not every decision um organizing
00:54:37
architecture decision records is a big
00:54:38
Challenge and usually the response is
00:54:41
well just store them in a get repo along
00:54:43
with the code but the problem is who has
00:54:47
access to your source code
00:54:49
repo the developers but hopefully no one
00:54:52
else so I do like storing them and get
00:54:56
but I usually have a separate repo for
00:54:59
these my preference is in a Wiki or some
00:55:02
kind of live document but um but it's
00:55:05
really practicing them um it is not easy
00:55:09
because you're not sure what scope you
00:55:11
should make an ADR I'm making a decision
00:55:13
does that really require an ADR this
00:55:15
morning NE Neil showed you a tool you
00:55:19
all have now for deciding whether
00:55:22
something's more
00:55:23
architecture or more design and he
00:55:26
showed showed you three criteria is it
00:55:28
strategic in nature or not what's the
00:55:31
level of effort uh what are the
00:55:33
significant
00:55:34
trade-offs things that are in that a
00:55:37
range that he showed you write an
00:55:39
architecture decision record for ignore
00:55:42
things and the C and D range of that
00:55:44
spectrum and these are some of the
00:55:46
guidelines and ways of trying it out
00:55:48
it's not for everybody but I find them
00:55:51
extremely effective
00:55:53
so all right fantastic one more hand up
00:55:57
and I think we have time did you have
00:55:59
your hand up yes can you pass the cube
00:56:02
to the front Okay one more question here
00:56:03
woo oh wow one true nice draft pick
00:56:08
right there draft pick number one yes
00:56:12
hey you're on my team yeah my my
00:56:14
question's not going to top that um so
00:56:17
yeah I wanted to ask um with introducing
00:56:19
adrs in this format and introducing them
00:56:21
as a as a dialogue um would you have any
00:56:26
suggestions of like would you follow the
00:56:27
same pattern which is demonstrated
00:56:30
before advocating for the like an ADR as
00:56:33
we're going to do the ADR pattern that
00:56:35
becomes like the pipeline dictatorial or
00:56:38
do you kind of use the same technique to
00:56:40
go hey let's let's talk about this and
00:56:42
then afterwards you tell them what that
00:56:44
was sure um well do you remember the two
00:56:48
things an architect always says it's an
00:56:51
implementation detail and it depends
00:56:53
there you go it depends um sure if I've
00:56:56
got a fairly significant decision to
00:56:58
make um I I likely would first of all
00:57:00
let me back up I would use the same
00:57:02
format it's a good format it's pretty
00:57:05
solid it has everything we need to
00:57:07
communicate and collaborate and use it
00:57:09
as a vehicle to go back and forth so in
00:57:12
fact I would use that kind of format um
00:57:14
however regarding the demonstration
00:57:16
piece if it's a significant architecture
00:57:19
decision that bears significant
00:57:21
tradeoffs then I would probably if
00:57:23
possible model it uh use qualitative
00:57:27
analysis to demonstrate where I came up
00:57:29
with something these are things we can
00:57:31
do within the decision section to
00:57:34
justify the answers um with diagrams
00:57:38
pull up the star rating chart say
00:57:40
because this has five stars and that has
00:57:41
one we chose this yeah okay I'm not
00:57:45
going to argue with that and thank you
00:57:46
for letting me know so yeah um uh the
00:57:49
more significant a decision uh the more
00:57:52
I would try to demonstrate that value
00:57:54
before uh approaching it yeah exactly so
00:57:57
wonderful hey thank you all so much this
00:58:00
fantastic crowd and uh thank you all all
00:58:03
right I'm happy you didn't actually burn
00:58:05
the stage
00:58:06
down that's true
00:58:09
[Music]