HomeVideos

Building resilient systems with Sam Newman

Now Playing

Building resilient systems with Sam Newman

Transcript

3779 segments

0:00

I describe microservices as being an

0:02

architecture of last resort.

0:03

>> Really?

0:03

>> Yeah. Yeah. Absolutely. What a lot of

0:05

people get wrong, I think, is they adopt

0:06

microservices and they think other magic

0:08

stuff's going to happen.

0:08

>> You talk about the three rules of

0:10

distributed systems. What are these

0:12

three rules? The first is that you can't

0:13

send information instantaneously from

0:15

point A to point B. Rule number two is

0:17

sometimes the thing you want to talk to

0:18

isn't there. And the third rule is that

0:20

resource pools are not infinite. The

0:22

vast majority of the time when you have

0:23

a system outage, just down to that, some

0:25

resource has been totally saturated

0:26

somewhere. What are the things that we

0:28

know that we do not know about AI?

0:31

>> I think the tech world in general is

0:34

quite naive about AI and fundamentally

0:37

misunderstand.

0:42

Sam Newman is the author who wrote

0:44

probably the most widely read book on

0:45

microservices. And yet, as you heard, he

0:48

said that microservices are an

0:50

architecture of the last resort. But

0:51

why? Sam was in the room when the term

0:54

microservices was coined. I find him to

0:57

be one of the most thoughtful engineers

0:58

on this topic as well as on resilient

1:00

systems and his latest book building

1:02

resilient distributed systems is out

1:04

now. Today we cover specs versus code as

1:07

a source of truth and why Sam says that

1:09

production is truth. Item potency keys

1:11

versus fingerprints and why you should

1:13

avoid item potency keys when possible.

1:15

the four dimensions of resilience,

1:17

robustness, rebound, graceful

1:19

extensibility, and sustained

1:21

adaptability, cognitive depth and

1:23

cognitive surrender, and Sam's advice on

1:25

how to better use AI to avoid these and

1:27

many more. If you want to understand

1:28

what it takes to build resilient systems

1:30

from an expert who has been needing this

1:32

topic for 10 plus years, this episode is

1:34

for you. This episode is presented by

1:36

Turbopuffer, the AI retrieval layer

1:38

built on object storage. It's fast,

1:40

cheap, and extremely scalable. Andropic,

1:43

Cognition, Notion, and many others are

1:44

happy customers. Before we start, let me

1:47

mention Tire, our season sponsor, and a

1:49

product and team I'm very bullish on.

1:50

You probably already know that Git

1:52

hosting has a problem. AI agents. Git is

1:55

increasingly becoming a bottleneck for

1:56

modern agent heavy software development.

1:58

Engines like you or me are creating more

2:00

code with agents. Those agents push more

2:01

code and most of us are running parallel

2:03

agents, which push way more code. GitHub

2:06

is clearly struggling to keep up and has

2:08

frequent outages. So, what's the

2:10

solution? Entire was founded by GitHub's

2:12

last CEO, Thomas Dumpka, who by the way

2:14

was a guest on a podcast when he was

2:15

still at GitHub. And Thomas revealed Git

2:17

hosting for the Agentic era from

2:19

scratch. Entire was built to be very

2:21

fast and to have your repos regionally

2:23

close to you to reduce latency. And this

2:25

allows for fleets of agents to push in

2:27

parallel. And Entire's performance is

2:29

next level. The repo can handle 418

2:31

pushes per second, which is up to 89

2:33

times faster than every competitor on

2:35

the market. When GitHub is down, you can

2:37

still keep working and you don't even

2:39

need to migrate away from GitHub. You

2:41

just sign up to Entire and the platform

2:43

mirrors your repo. And here's a neat

2:44

thing. Have you ever wondered what

2:46

prompt resulted in this specific code

2:48

being generated? I find that the prompt

2:50

and conversation with the agent carries

2:52

more information than the PR itself.

2:54

Often times, entire captures all the

2:56

prompt history with your agent right

2:58

inside of the repo easy to check back.

3:00

And it's got a pretty innovative UI to

3:02

show all of this. If you're looking for

3:03

Git hosting that works even when GitHub

3:05

is down, head to entire.io/pragmatic,

3:08

install the CLI and mirror your repo

3:10

with a click. I've already done it and I

3:12

love it. Oh, and did I mention that it

3:14

works with any agent and it's open

3:15

source? Sam, it's great to have you on

3:17

the podcast.

3:18

>> Thank you so much for having me. Happy

3:20

to be here. Really happy to be here. Big

3:21

fan of the show, as they say. I'm not

3:24

going to lie, I've become a bit of a a

3:26

millennial and I think I watch a lot of

3:27

shorts rather than watching the whole

3:28

things now and becoming my son. But

3:31

>> yeah, Millennial is a new boomer

3:32

apparently I've learned. So

3:33

>> God, I was I was happy enough being Gen

3:35

Y. Now I'm wherever I am now.

3:37

>> Well, so so let's go back to the the

3:39

beginning. You've been known for a lot

3:41

of your books, your takes on resilience

3:42

system, microservices. Before that, you

3:44

worked at Thought Works, but let's

3:46

rewind to the very beginning. How did

3:47

you get interested in tech and

3:49

computers? I'm quite fortunate living in

3:51

UK. We had at places an access to

3:55

computers quite early on. We had an

3:56

Acorn Electron at home, which was sort

3:58

of one of the generations of the BBC

4:00

computers that came after the BBCB. And

4:03

then I got a Spectrum 1283,

4:07

which is the Spectrum that had the

4:08

built-in tape drive.

4:09

>> This is way before the Commodores.

4:12

>> I think some of this was the B. I think

4:14

I'm pretty sure that the Acorn Electron

4:16

was pre-Comodore, but the Spectrum would

4:18

have been around the same as well. The

4:21

UK was a bit more of a Spectrum and BBC

4:24

market, whereas the US, the Commodores

4:26

and the Ataries and things were a bit

4:27

bigger. So that's that sort of got me a

4:29

bit interested and then I always stayed

4:31

interested in it. Dad had a computer. I

4:33

did the very boring thing. I went to

4:35

uni. I did a software engineering degree

4:38

at a place called Deontford University,

4:40

which the running joke in my family is

4:42

it's the in the top five universities in

4:45

the Leicester area. There are only two

4:47

universities in Leicester. It was a I

4:49

mean it was I loved it actually. It was

4:51

a great class. It's basically MIT

4:52

syllabus. And then I just did the work

4:54

after I got a great um back then we did

4:57

these things called uh sandwich courses.

5:00

>> Sandwich course.

5:00

>> Yeah. And so basically the idea was you

5:02

would do two years of study, you do a

5:04

year in industry that was paid but you

5:06

effectively going in as a student and

5:08

then you did your your final year.

5:10

>> Oh, nice.

5:10

>> Which is actually fantastic cuz I kind

5:13

of was drifting a bit and when I did my

5:15

year in industry

5:16

>> so many things clicked. It meant as much

5:18

focus going in and I got to do work for

5:21

a company called back then they were

5:23

called GC GC also now that was called

5:25

ALSTOM and we did software for the

5:27

European Space Agency and gas and steam

5:30

turbines. Yeah, it was really cool. I

5:31

joined about the first time at that

5:33

about and then I went back after and

5:37

when I went back it was just around the

5:38

time the first com boom and so everybody

5:41

left. So I went from being the person

5:43

that was doing like nothing to person

5:45

did everything. But I remember my first

5:47

week there I was given a 4R77 codebase.

5:52

So forran77 was released in the year I

5:54

was born and every single for loop had a

5:59

break condition because we were

6:01

basically doing analysis on these Unix

6:02

machines and this if the models and

6:05

these the time on the machines was

6:07

expensive and we were worried about

6:09

accidental infinite loops. This is I was

6:11

trying to solve the halting problem

6:12

basically. So every for loop across

6:14

these 8,000 files had a break condition

6:17

of I think it was 99,999

6:20

loops. And if you went over that, the

6:21

program basically broke and aborted. The

6:23

models had got bigger. The computer got

6:25

more powerful. Go through and change

6:27

them all by by hand back then.

6:30

>> By hand. Well, this is one of the nicest

6:32

things that anyone's ever done to me in

6:33

a professional career because for 77 is

6:36

based on the old um punch card

6:38

limitations to an extent. So your lines

6:40

can't go very long. So it's all a bit

6:43

fiddly. You can't go and put a nine. And

6:45

my boss said, I reckon I reckon it will

6:46

take you about two weeks if you do it by

6:48

hand or and he slid a book across to me.

6:50

You can read this. And he said he gave

6:52

me a copy of the O'Reilly said an orc

6:55

book. And so I spent two days learning

6:57

how to do regular expressions. And I

7:00

wrote a refactoring using regular

7:03

expressions, accounting for line lengths

7:05

and everything else. And it's I think

7:06

the closest I've ever come to feeling

7:08

like a god. I did it and I thought

7:10

that's the thrill. That's the absolute

7:13

I'm not sure if it's a joke or a story,

7:14

but you know, the two the two um

7:17

builders who need to build a wall and

7:19

and one of them starts to build the wall

7:21

one by one by one and the other one is

7:22

kind of drawing making plans and like I

7:24

don't know like it takes three days to

7:26

build the wall and first two days this

7:28

guy does nothing and the builder

7:29

building it feels really good and then

7:31

on day three this builder like builds a

7:33

machine that builds or or like puts

7:34

together a machine that builds the wall

7:36

for them and then

7:37

>> yeah but sometime and sometimes of

7:38

course the wall falls down the moment

7:39

you set the machine I thing is I love

7:41

that that story that story was all true

7:43

and it it's one of the earliest times I

7:45

can remember learning something and

7:47

having such a vis visceral reaction and

7:49

I remember this has been just towards

7:50

when the end of last thought works some

7:52

grads in and they asked to tell some

7:55

stories about like what had happened in

7:57

previous career and I told the story I

7:59

said I added the nine made the models

8:00

bigger and then one of the one of the

8:05

grads said why didn't you just replace

8:07

it all with a constant so you could just

8:09

change the number once anytime in the

8:11

future. And I was like,

8:15

I thought I'm learning once again. Yeah.

8:18

So that that's also why I love it. It's

8:19

like you you get humbled all the time as

8:22

industry. You get to learn stuff. Yes.

8:24

There's reinvention of the wheel going

8:25

on, but you we're inventing better

8:27

wheels the whole time. say and I think

8:28

it's just nice to remind us every now

8:30

and then I'm sure everyone who's built

8:33

code and programs like at some point you

8:35

have the realization that you do feel

8:36

like a god that you can do things with

8:38

these things which is just so difficult

8:40

to do by hand right like there's

8:42

>> I think we forget about that when it's

8:44

kind of dayto-day and we're just like

8:45

doing our stuff or even like right now

8:47

we're using LMS which also do incredible

8:49

magical stuff that would have been

8:50

impossible but like it's kind of cool

8:52

that and and we are in charge we can do

8:54

amazing stuff you get that little fizzy

8:57

dopamine hit. And I think that's

8:58

something we're struggling with a bit

8:59

now is as people are getting further

9:01

away from the code, they're trying to

9:02

work out like how do I still get that

9:04

kind of dopamine hit in the same way.

9:07

>> Um it's not as much an issue for me

9:09

because I' later on, you know, I've been

9:11

doing this for almost 30 years now and

9:14

I've already been mostly working at the

9:16

area of architecture for and sort of

9:18

architecture and infrastructure for a

9:19

while. So I feel a little bit more

9:21

removed but it's uh yeah talking to my

9:24

son who's a programmer. He's got into it

9:25

around an interesting time right now.

9:28

>> And then you eventually made your way to

9:30

Thought Works where you spent a bunch of

9:32

time. What kinds of things did you do at

9:35

Thought Works? And what are what are

9:36

things that you learned there?

9:37

>> I did anything. I mean it was I joined

9:40

when there were probably just under 400

9:42

people left with about 4,000 and I

9:44

worked in you know got to go all over

9:46

the place. I joined at a good time

9:47

because a lot of the I mean we're very

9:50

much an XP shop and I think that the

9:52

core extreme programming. Yeah. I think

9:54

the core of the business still kind of

9:55

primarily is and I speak to people there

9:56

as well.

9:57

>> By the way, XP like was that influenced

9:59

by by Ken Ken Beck's XP?

10:01

>> Yeah. Know that the extreme programming

10:02

is very much it's it's it's Kent's

10:04

extreme programming. There was a bit of

10:06

a London flavor. Um so the kind of

10:09

London school of test development and

10:12

extreme the extreme Tuesday club XDC

10:14

around here. So what what's what's the

10:15

London flavor of XP and TV? It's sort of

10:17

like if you want to know you probably

10:19

need to read Growing Object-oriented

10:20

software guided by tests one of the

10:22

worst titled books in existence written

10:24

by a couple of friends of mine um Steve

10:27

Freeman and Matt Price and I think that

10:29

was a lot there's a lot of people in the

10:30

community around here that knew that

10:32

there's a rich meetup scene and so I

10:34

kind of got introduced some people

10:36

through there and came in and I jo I was

10:40

same time I was offered a job by

10:41

somebody else was a bank the bank could

10:43

tell me exactly what I was going to be

10:45

doing and thought works basically

10:47

the recruiter at the time, he's now one

10:49

of my very good friends, one of my

10:50

oldest friends now, she said to me, I

10:53

don't really know what you'll be doing.

10:54

And I'm like, that sounds like a job for

10:55

me.

10:56

>> I went for that one. And this is at a

10:58

time when like it, you know, we talk

11:00

about continuous integration, but the

11:02

tooling wasn't there and talked about

11:04

TDD and the tooling wasn't there. So, it

11:07

was in, you know, it was around that

11:08

sort of time that we started I started

11:10

building the build pipeline stuff in

11:11

about 2004. And then I worked Dave Dave

11:14

Farley was my first tech lead. Uh worked

11:18

alongside Dave Farley.

11:20

>> Yeah. Yeah. He was my first tech lead at

11:21

Thoughtworks. I I was one of the people

11:23

that interviewed Jez Humble to backfill

11:26

for me on a project at No way. So your

11:29

project at AOL of all places and I we

11:31

needed a backfield because I was like a

11:32

I'm sort of half admin halfdev really is

11:35

how I see myself. So we we needed

11:36

someone to take over my job and so I I

11:39

interviewed Jez. Um, and so I was around

11:42

when a lot of interesting things were

11:43

happening. So I was fortunate enough to

11:45

be there while we were sort of kicking

11:47

those ideas around. And obviously people

11:49

like Dave and and Jez put those ideas

11:52

together really really well. You're sort

11:54

of surrounded by everyone talking and

11:56

thinking about these ideas. I think you

11:58

got that I got the idea very early on

12:00

that this stuff's all up for grabs.

12:02

These things aren't set in stone that we

12:04

can push. And when you're saying these

12:06

things like you mentioned continuous

12:08

delivery, you mentioned what what other

12:10

>> um test automation.

12:12

>> Yeah.

12:12

>> Um build pipeline optimization, uh

12:14

infrastructure automation. I went over

12:16

to the US in 2007 actually to work in a

12:20

big I actually worked at Google for like

12:22

a year and a half for as the

12:24

thoughtworks employee.

12:25

>> Wow. In Google is we were doing we were

12:28

there doing a project um this all been

12:30

talked about publicly. It's a great

12:31

write up by Mike Bland all about our

12:33

experiences. It was me, a few of me, a

12:35

few of my Thor colleagues, some people

12:37

from Industrial Logic and some people

12:38

from Pivotal, the old Pivotal pre, you

12:41

know, pre-acquisition.

12:43

>> They were known for their really

12:44

excellent engineering culture

12:45

>> back when it was just Robbie's company.

12:47

And we were there to teach Googlers

12:50

primarily how to write automated tests

12:52

and how to write code that was testable.

12:54

And so I got out there and I was talking

12:56

to people out in the valley and stuff.

12:57

It's like we were going into these

12:58

enterprise companies doing test

12:59

automation using stuff like Selenium.

13:01

And you go around talking to people and

13:03

it's like people didn't I I remember

13:05

having conversations with people at like

13:06

Yahoo and even a big chunks of Google

13:09

who did not think you could do

13:10

functional automated testing of like

13:13

websites and stuff like

13:15

>> I guess cuz they just never did it

13:16

right.

13:17

>> Yeah. Absolutely. And for me like I hate

13:19

it whenever I haven't pushed myself or

13:24

like found a better way of doing

13:26

something. And I I was lucky enough that

13:28

early days in ThoughtWorks, that was

13:29

just a constant churn of ideas and

13:33

reinvention. I mean, goodness knows how

13:35

many mocking frameworks and inversion of

13:37

control things I was I I built two

13:39

different replacements for cruise

13:40

control myself, right? And so, but like

13:44

I you know, it was at that time I

13:47

created thing called DB deploy my

13:48

friends Nick Ashley and Graham Tapley,

13:50

which was like the first database

13:51

refactoring tool and all these sorts of

13:53

things because they didn't exist. needed

13:54

them and it was like if you if you want

13:56

to do it do it that was the mindset and

13:58

so I think there was always this idea

14:00

working at Thoughtworks was always like

14:02

what's next and I was quite fortunate

14:05

that cuz Thor works was growing so much

14:06

there was always things needed to be

14:08

done and my default was normally just to

14:10

say yes to everything so I got to travel

14:12

all over the world was fantastic met my

14:13

wife through works most of my best

14:15

friends have all come from Thor works

14:16

now still to this day so although it's

14:18

not been there for a long time it was

14:20

kind of really formative I think in

14:23

terms of that and it It's really

14:24

interesting because Thoughtworks has a

14:27

alumni pipeline people who used to work

14:29

there who are now really well known in

14:31

the industry for their ideas for for

14:34

think differently. Some some of them

14:35

educate people others uh have created

14:38

businesses to to build software

14:42

in better ways in certain dimensions.

14:44

And it's just interesting because like

14:46

usually I wouldn't think of I I'll just

14:49

like put it in a box like you know you

14:50

have product companies like like Google

14:52

like Meta like they have they build

14:53

their own products and and you have like

14:55

different tiers of these companies some

14:56

can afford the best people and they have

14:58

an external engineering culture again

14:59

Google was known for this Meta to some

15:01

extent and there's some companies maybe

15:02

who are like lower in the tier and then

15:04

you have the so-called consultancies who

15:06

are you know they don't build their own

15:08

stuff or they know do too much of it

15:09

they come in and they help companies

15:11

build or you have a problem and you hire

15:12

a group of experts Thoughtworks

15:14

technically is in this group and usually

15:17

you would not think that there's too

15:19

much innovation going on in these places

15:20

but with thought with thought works

15:22

proves to me yourself and other people

15:24

it's actually you can have like when you

15:26

are the best in what you do globally you

15:28

can actually have a lot of innovation

15:30

happening there as well right

15:31

>> yeah and it was innovation with a

15:33

different set of constraints I mean I

15:34

would say there aren't that many people

15:36

that have come from Thoughtworks that

15:37

were really great startup product people

15:39

I mean a lot of you know a lot of

15:40

thought workers make excellent scale up

15:42

people once you're all together actually

15:43

very few real entrepreneurs that came

15:45

out of the Thoughtworks machine. I I

15:46

know a few of them. There aren't many of

15:47

them. But I think there was always the

15:49

opportunity

15:51

to innovate even within a constrained

15:53

enterprise environment. So much of our

15:55

working conditions as a consultancy who

15:57

mostly did co-source delivery at that

15:59

time. We were doing kind of co-source

16:01

delivery, a bit of enablement through

16:02

delivery. Your working conditions are

16:04

often based on what the client does

16:07

>> and unless you're there explicitly to

16:09

change how the client builds software.

16:11

So what what you were what you got. But

16:13

that was self-perpetuating because we

16:15

were already used to sort of challenging

16:17

and pushing and trying to do new things.

16:19

That spirit carried on. And so I think

16:22

we grew quite aggressively but not that

16:24

aggressively rotating people through and

16:27

that spirit kind of carried on. I mean

16:28

look we had to start most engagements

16:30

with convincing people why testing was a

16:32

good why pairing was a good idea let

16:33

alone TDD.

16:35

>> Yeah. And I imagine how the conversation

16:36

went like a manager going like well what

16:38

would you pay then I have like you know

16:40

like eight engineers and now you're

16:41

making it four which sounds like a

16:42

terrible thing to do right

16:44

>> which and then this is I mean I had good

16:46

fortune because because of the people

16:47

because of work at thought as I got to

16:48

know Martin Fowler quite well and you

16:50

know he supported me a lot when I read

16:51

my first book I still remember when he

16:53

said well programming is not typing and

16:56

fundamentally it made it click for me

16:57

was having those conversations with

16:59

clients if the client thinks that

17:01

programming is typing

17:04

and That's why they don't want you to

17:06

pair program. Well, then you've got a

17:08

fundamental problem that needs to be

17:09

dealt with. And it's not a conversation

17:10

about pairing. The conversation is what

17:12

do you think programming actually is?

17:14

Well, but let's bring this a little bit

17:16

forward because right now we're having

17:17

the same conversation around right for a

17:19

long for a lot of CEOs, even founders

17:22

are thinking who have been building tech

17:24

companies, you know, they all look at

17:26

what what is the most timeconuming part

17:28

of what we do in building software. 50%

17:32

of the time has historically been

17:33

writing the code. So a lot of people

17:35

think you know like programming is code

17:37

and LMS are really good at turning out

17:39

code. So what is programming? Okay,

17:40

there's the there's programming I think

17:43

it's Peter no's article the guy who came

17:45

up with barkers nor form well he's no in

17:48

barkers norm he wrote his paper years

17:50

ago which you won the chewing award for

17:52

and he sort of describes

17:54

like the the program as being a theory

17:57

that lives in the mind of the developers

18:00

that it's actually us together working

18:02

together collectively who builds a

18:04

program

18:05

>> the fact that we happen to make that

18:08

program work through code the code is

18:11

really a side effect of how we work

18:14

together and I think product development

18:16

is just that extended right what we're

18:19

building is collectively we are building

18:21

a system together and the code is one of

18:24

the mechanisms we use to deliver the

18:26

system it's not the only thing so I

18:29

think holistically that's what it's all

18:30

about it's just that we focus on the

18:32

code because that's historically been

18:35

where we sort of spend the time but I

18:38

mean this is also classic theory of

18:39

constraint stuff though, right? If you

18:40

speed one bit up, you get constraints

18:42

elsewhere and it exposes friction points

18:45

elsewhere. I would also argue that a lot

18:47

of the time coding was not the problem

18:49

or not the bottleneck. It was how the

18:50

coding was done,

18:51

>> delayed feedback cycles and things. But

18:53

I do come back to that Peter piece again

18:55

because it's like Margaret an story

18:57

referenced it recently in her term pay

18:59

debt. But it's like building of software

19:01

is a collective ex it's a collective

19:03

endeavor. It's people working together

19:06

who build software. uh Kent put it in

19:09

his 21st book that software design isn't

19:12

exercising human relationships, right?

19:14

AI doesn't change that. And I think all

19:17

that's really happened over say the last

19:19

15 years in my experience is that we've

19:22

got a bit better at understanding that

19:23

we need better working relationships

19:25

like people like product owners for

19:26

example. But so that's what the pro the

19:28

programming is the art of creating. It's

19:30

the collective art of creating software

19:31

and it's not just developers that do

19:32

that. Never has been.

19:34

>> And so after thought works you've you've

19:36

gone independent, right? I did three

19:38

startups. None of them worked out for

19:39

different reasons. So don't ask me for

19:41

advice on how to make a successful

19:42

startup. Um and then I went independent.

19:45

Yeah. Moved back. I was living in

19:46

Australia at the time and moved back

19:48

from Australia and yeah, I've been

19:49

independent ever since. So doing kind of

19:51

a mix of stuff really ever since. I'd

19:53

written the first book of about

19:54

microservices. I thought my spare time

19:56

at Thoughtworks and then uh that book

19:59

came out and I'd been at Thoughtworks a

20:02

long time and I realized that there's

20:03

always a danger becoming

20:04

institutionalized.

20:06

You get to a point with a company, it's

20:08

like I think there's things as companies

20:10

do to change and I've tried changing

20:13

those things and they don't want me to

20:15

change them. So either I'm bad at

20:16

changing them, which is probably true,

20:18

or they don't think it needs to be

20:19

changed, which is also probably true.

20:20

And it's like I could hang around and

20:22

get bitter. I just go now. I go now. So

20:24

I went off and I thought I went

20:25

independent. It's been really

20:26

interesting ever since because it's sort

20:28

of on one level the shackles are off.

20:31

Um, the problem with working for

20:33

yourself though is that the boss is

20:34

frequently an

20:37

>> So,

20:38

current Sam frequently is cursing past

20:41

Sam for the commitments he's made.

20:44

>> Um,

20:45

>> that's one lesson, I guess.

20:46

>> Yeah. Oh, yeah. Yeah. Yeah. Yeah. I

20:47

mean, as I say, I'm I'm almost 15. I'm

20:49

still not learning the lessons of that,

20:50

right? And I've you've made those

20:52

mistakes for enough years now.

20:53

>> So, I wanted to talk about

20:54

microservices. Uh, you you have written

20:57

the book building microservices uh in in

20:59

2015. And you started to write it in

21:01

2014 and as reference Uber started to

21:03

talk about how they have thousands of

21:05

microservices in 2015. So you were kind

21:07

of writing this book right as yes

21:09

>> the concept of microservices which was

21:10

starting to go mainstream across

21:12

startups. Do you remember how and when

21:15

microservices took off and where was it

21:17

even coined? Was was it Martin Fowler?

21:20

>> No, it was James Lewis. So going back in

21:22

the day so you got to remember again

21:24

it's like something in the water. It's

21:25

like we have a bushfire. there was a lot

21:27

of buildup before the bushfire kicked

21:28

off and uh so this would have been 2011

21:32

to 2012 James was sort of talking to a

21:35

bunch of uh different companies who were

21:39

building what would have classed back

21:40

then as serviceoriented architectures

21:42

and early there'd been this kind of what

21:44

we refer to as the gorilla sa movement

21:46

which is an aim to simplify

21:48

serviceoriented architecture you know

21:50

shift over to rest work done by people

21:52

like yeah the original serviceoriented

21:54

architecture had like this this XML

21:57

format. What was the name?

21:58

>> Oh, wisdom and simple object access

22:00

protocol. Never has the word simple been

22:02

less well used.

22:03

>> Samap soap.

22:05

>> You had soap.

22:05

>> Soap. Yeah.

22:06

>> Yeah. Start with simple and the most

22:07

complex thing ever.

22:08

>> Exactly. So you had this whole heavy

22:10

weight and then people like Ian Weber

22:12

and and Ian Robinson and Jim Weber had

22:15

like been pushing centralized had

22:16

managers like make the endpoints smart

22:18

and the pipes dumb to keep things

22:20

simple. Put all the smarts in. So this

22:21

is all background. We were also at this

22:24

time doing a lot of work around like I

22:26

was running the cont practice for Europe

22:28

at the time and so a lot of my

22:30

engagements were like optimizing the

22:32

final mile. So you've written the code

22:35

and it's like how do I get it here into

22:37

production as quickly and effectively as

22:39

possible. So basically taking the ideas

22:41

of continuous delivery. So I was around

22:43

when JZ and Dave started working on

22:44

those in 2006. I' I'd had the

22:47

conversations with them. So that was all

22:48

happening. James was talking to

22:50

companies that were creating service

22:53

oriented architectures where they could

22:54

replace the services quite quickly. And

22:56

so basically you'd look at it and say

22:58

it's a finer grained form of S SOA. So

23:00

that was all happening. So James went we

23:02

had this architectural symposium up in

23:04

the Lake District and James pitched this

23:07

idea. He was called the micro apps at

23:08

the time in this room and somebody else

23:11

in the room said they're more like

23:13

services. Don't remember who said it

23:14

there about 10 of us in the room. most

23:16

of us were hung over and then James and

23:19

Ian so James and Martin wrote the first

23:21

post. So the first paper on Martin's

23:24

website was written by it was sort of

23:26

James' original kind of discovery of

23:28

this pattern that he called

23:29

microservices. At the same time I was

23:31

doing a lot of stuff around

23:32

infrastructure automation and so I was

23:34

coming in it from a different lens. So I

23:36

think James was coming at it more from

23:37

an architectural lens and I was coming

23:39

into it from a continuous delivery lens.

23:41

I spent at this point almost 10 years

23:44

with that being my focus. Yeah.

23:46

>> And so I was starting to see the

23:49

architectural impediment.

23:52

So if I want to change things

23:53

frequently, but the things I want to

23:54

change are integrated with other things.

23:56

>> Yeah. Like like like a monolith now. Now

23:59

that's how we would describe it.

24:00

>> Exactly. Right. I mean I I did a talk

24:02

called designing for rapid release in

24:03

2012 which is sort of touching this. So

24:05

basically James had this sort of had put

24:07

a name to this stuff and put some

24:09

patterns on it and I sort of thought

24:10

hang on a minute that stuff I was

24:12

talking about over here seems these

24:13

things seem quite sensible and I'd

24:15

always wanted to write a book. I mean

24:17

honestly I wanted to write an animal

24:18

book. I wanted to write an O'Reilly book

24:19

because that Zenor book I was given book

24:21

y

24:22

>> and so I just started writing and I I've

24:24

always found writing quite I'm quite

24:26

lucky that I find writing enjoyable and

24:28

quite easy. So I just yeah sat down and

24:31

wrote the book and that's it. But for me

24:33

it was an extension of continuous

24:36

delivery and it was a a style of

24:38

architecture that was only possible

24:41

because of continuous deliver because of

24:42

DevOps. We'd had these ideas before. I

24:45

mean Erlang has is is an representation

24:48

of these ideas but making it real and

24:51

practical and attractable thing. But I

24:54

mean really fundamentally it's just a

24:56

the whole thing has been an exercise in

24:57

smuggling through um concepts from the

25:00

1970s which is it's fine by me right if

25:03

I get people to pay attention to

25:04

information hiding and uh coupling and

25:07

cohesion that's all right but then as as

25:09

you said like this was there was a spark

25:10

before the bushfire and then the

25:12

bushfire did start like suddenly again I

25:14

think Uber was a very notable company

25:16

starting to talk in public about having

25:18

thousands of microservices on on

25:20

conferences like infoq and it got

25:21

people's attention and then it kind of

25:23

seemed that overnight a lot of stars

25:25

started to say like you know what let's

25:26

just do microservices

25:28

>> there was a bit of rebadging going on I

25:30

mean I was lucky when I wrote the first

25:31

book that I met uh Ben Christensen

25:33

fairly early on through the Yao

25:35

conference Ben was and Ben was looking

25:37

at um looking after performance and sort

25:39

of reliability at Netflix and I also

25:42

knew people at REA and these were two

25:44

early rea.com.au EU in Australia and

25:48

these were companies that were very much

25:50

pushing the envelope in different ways

25:52

and so I had two very good real world

25:53

case studies to draw upon for my book

25:56

>> but most other people weren't talking as

25:58

publicly around that and also before

26:01

Netflix referred to their architecture

26:02

as microservices they just referred to

26:04

it as fine grained SOA and to an extent

26:06

you know my understandings that's what

26:08

happened at Uber and elsewhere we didn't

26:09

have a different word for it then of

26:11

course what happened was that everyone

26:13

just called their S so SOA architectures

26:14

microservices which is sort of to be you

26:18

know semantic diffusion is a thing I is

26:21

to be expected so I just kept fighting

26:23

the good fight for like it's just

26:26

independent deployability and you know

26:27

it's an I've always positioned it as

26:30

it's an opinionated style of S so SOA

26:33

>> you may not agree with the opinions

26:34

that's fine do something else then but

26:36

there are some opinions

26:37

>> so then what is the difference between

26:38

microservices and what was it or service

26:40

>> serviceoriented architecture

26:41

>> service oriented arch what are the

26:43

differences

26:45

in in in your very

26:47

>> now to be clear right I have my

26:48

definition you might have your own

26:50

definition but I'm the one that wrote

26:51

the books on it so my definition wins

26:52

that's how that's always be my argument

26:54

right your own damn book um I've always

26:56

presented it as it's there are two kind

26:58

of very strong opinions I think we hold

27:00

with microservices the first and it's

27:02

most important is that your

27:04

microservices need to be independently

27:05

deployable

27:06

>> so your unit of deployment unit of

27:08

change needs to be a single microser

27:10

boundary a single service boundary

27:13

>> um and you know rather than undeploy

27:15

deploying everything together that's

27:17

three services at the same time etc.

27:18

even mini or less right and it's a

27:20

single service of time that's clear

27:22

>> that's it and the second one which is

27:24

which I think there are can be

27:25

exceptions to is that your kind of

27:26

default way for defining your service

27:28

boundaries is around your business

27:29

domain this is taking the concepts of

27:33

you can use domain you don't have to but

27:35

rather than a lot of sa architectures

27:38

were dominated to an extent by technical

27:40

decomposition the classical ender

27:42

architectures

27:44

layered architectures where you've

27:45

picked your service decomposition based

27:47

on the nature of

27:48

rather than thinking about the business

27:49

functionality. That's a bit softer.

27:52

Independent deployability is the main

27:53

thing though.

27:54

>> Okay. Well, because I'm now thinking

27:55

back at Uber. I was at Uber at the time

27:57

when your book was starting to become

27:59

really popular. I was there from 2016

28:01

and we had independently deployable

28:04

services. We didn't really think too

28:06

much about the businesses or or domain.

28:08

They they they had obviously their their

28:10

interfaces. They had contracts that they

28:12

offered uh increasingly strongly typed

28:14

and we we used

28:16

their voice to do it. But it was just

28:18

more like I mean as you can imagine

28:19

there was just devs often times not very

28:21

experienced devs who were like all right

28:22

like let's build a new service here's

28:24

the interface here's and then anyone can

28:26

use it uh which actually like there was

28:29

these things where a dev or even a not

28:32

very experienced dev deploy the microser

28:34

and then others start to use it and

28:36

suddenly it became you know years later

28:38

there would be these exercises to figure

28:39

out the hot path and and label the

28:41

services and then this like lone service

28:43

was on the path of like some really it

28:45

needed to be really accessible as a

28:46

really high tier service cuz a lot of

28:48

others were using it. I mean there was

28:50

always I mean also those sorts of

28:51

environments when I was chatting to

28:52

people at SoundCloud similar about that

28:53

it's something I mean and this is also

28:55

like about a corporate culture and like

28:57

what was acceptable like in that kind of

28:59

environment just go and do stuff it's

29:01

absolutely fine and that I think that's

29:03

that's why Uber for example went to I

29:06

just talked with Tuan Palm the C2 at the

29:08

time about like what was the real deal

29:09

about microservices and he said Uber

29:11

like he never really wanted that many

29:13

services but it was just more of a

29:14

constraint because Uber had a monolith

29:17

the story was like which he told on a

29:19

podcast, we'll link it in the show notes

29:20

below, that Uber had this this big

29:21

monolith and it was really slow. It was

29:24

slowing delivery down and they needed

29:26

they needed to move fast because all the

29:28

other competitors were out there. So

29:29

they said, "All right, like they wanted

29:31

to get rid of the models and put

29:32

together smaller services, but they knew

29:34

unless they had a strong mandate that

29:36

you cannot add new stuff to it. This

29:37

will never happen." So they said the

29:39

mandate was everything new needs to be

29:41

your own service. You take care of it.

29:42

We don't care. And suddenly so many

29:45

independent services were born, which

29:46

was not the goal. and years after the

29:48

fact that when Uber decomposed the

29:50

monolith, they're now looking at maybe

29:52

sensibly merging based on business

29:54

domain etc. But this story wasn't really

29:56

told at the time. It was just oh look

29:58

like Uber has thousands of microservices

29:59

almost one or two per engineer right and

30:01

this is what the world saw.

30:03

>> I mean it's also though but this is the

30:05

reality of microser adoption is like

30:07

it's just a tool toolbox. I mean I

30:10

describe microservices as being an

30:11

architecture of last resort.

30:13

>> Really?

30:13

>> Yeah. Yeah. Absolutely. because it

30:15

pushes you quite naturally to a more

30:17

aggressive distribution of your of your

30:20

state and everything else. And so you

30:22

have to have a good reason. One of the

30:24

best reasons to use microservices is if

30:26

what you actually want is an

30:28

organization with a high degree of

30:30

autonomy. If what you want is teams who

30:33

are able to act independently from each

30:37

other, the microser architecture is a

30:39

fantastically good fit. But then really

30:41

it's a means to an end, right? So that's

30:43

often what a lot of people get wrong, I

30:45

think, is they adopt microservices and

30:46

they think this other magic stuff's

30:47

going to happen. No, if you want

30:49

organizational autonomy, that's what

30:51

you're working towards. And this is just

30:53

one of the mechanisms to get you there.

30:55

And most of the enterprise

30:57

organizations, the vast majority of ones

30:59

I've worked with in this space, that's

31:00

what they're after. They've got huge

31:03

numbers of developers, lots of middle

31:05

management, they're not getting much

31:06

work done. They're thinking, what do we

31:08

do? organizational autonomy becomes, you

31:10

know, the solution to all problems.

31:12

Again, I don't always get to have a say

31:14

whether or not it's a good idea and I

31:16

think that's where microservices can be

31:17

especially useful. I mean, there are

31:19

other exceptions as well. And so, an

31:20

organization like you know Uber uh I I

31:23

mean I say I know at Netflix as well

31:26

things like domain design weren't talked

31:27

about Netflix but the teams were already

31:29

fairly well scoped around areas of

31:31

product already. Yeah.

31:32

>> And so you had those natural high level

31:34

boundaries around the business domain.

31:36

those things flowed naturally and so

31:38

that for me was a logical kind of

31:40

stepping stone. You also have the

31:42

difference and this is something I found

31:43

realized quite early on when you go and

31:45

do the work in the dotcoms versus the

31:47

enterprise organizations. When you say

31:49

dotcoms, you mean the digital companies,

31:51

tech companies,

31:52

>> tech companies. I'm old enough that I

31:54

still talk about docoms. Um, but the

31:55

tech companies, I mean, fundamentally

31:57

algorithm, you know, domain from a

31:59

domain concept are incredibly simple.

32:00

The domains are very, very simple

32:02

compared to enterprise organizations by

32:04

and large. Domains in there are much

32:05

much more complicated because they're

32:06

based on business processes that have

32:08

existed for 10, 20, 30, 40, 50 years.

32:10

>> Oh yeah. So, so what you mean in a lot

32:11

of tech companies, a product is pretty

32:13

much like here's our product, here's how

32:14

it makes money and that's kind of it.

32:16

And we have another product in Uber.

32:17

inside Uber like a simple thing is

32:18

there's rides which it makes money like

32:20

this and then there's Uber Eats which is

32:22

a separate business over time by the way

32:24

it does get more complex but but when

32:26

you start it's like really really simple

32:28

and it's really separate and it's clear

32:30

like where one ends versus where the

32:33

other begins and then you do some hacks

32:35

when you need to launch Uber Eats really

32:36

quickly and you build it on the right

32:38

infrastructure and then Uber Eats order

32:39

has like two trips attached to it

32:41

because anyway but but but but as as you

32:44

say like early on it it starts very

32:46

simple

32:46

>> but then also So in those environments

32:48

your business processes and the digital

32:50

implementation of those business

32:51

processes is evolving together. A lot of

32:53

enterprise organizations didn't have

32:55

that. I mean their first generation of

32:56

digital products were codifications of

32:59

paperbased processes.

33:00

>> Oh so so you're talking to these

33:01

companies as said before digital let's

33:03

say an Adidas or let's say a shoe

33:06

company virtually all banks.

33:08

>> Virtually all banks and and now they're

33:10

like we have all these processes and now

33:11

we need to build a software that mimics

33:13

what we do which of course is

33:14

>> that's how you start off. I mean that's

33:16

what the whole domain design book came

33:18

out 200 Eric it was danger design came

33:20

out in 2004 and it was a reflection of

33:22

the fact the vast majority of software

33:24

development was the process of us trying

33:26

to model existing non-digital processes

33:30

and how you do that I wonder if we will

33:33

have a different or but similar problem

33:35

of the same thing now that you know we

33:38

know AI tools are here we know that for

33:40

example they're great at generating code

33:42

and we have two types of companies we

33:44

have a company a digital company that

33:45

has existed preAI they're used to you

33:48

know writing product requirement

33:49

document deploying developers product

33:51

managers designers QA they all have

33:54

their roles and it it works like a

33:55

really welloiled machine and now you

33:57

have these so-called AI native startups

33:59

who just again they have a few people

34:00

they're just I from the start they're

34:02

using agents for everything they have a

34:04

very different process and at some point

34:05

when this whole thing will mature and we

34:07

will have best practices we'll have the

34:09

existing companies who like the previous

34:11

one they will try to retrofit you know

34:12

this this tooling to how they're working

34:15

today.

34:16

>> It's already happening. I mean, and the

34:18

thing is enterprise companies will

34:19

rarely be successful at doing those

34:21

first gen things because ultimately the

34:23

corporate DNA will just crush that stuff

34:25

from within, right? And it will take a

34:27

while, but I think the whole industry is

34:29

getting is grappling with the idea of

34:31

like are we now moving to a new level of

34:33

abstraction, right? So software is all

34:36

about abstractions, right? But you know,

34:38

we went from doing machine code to doing

34:41

assembly, went from assembly to general

34:42

purpose programming languages. And

34:44

you're coming back to the idea of the

34:46

program being the mental model. We would

34:48

evolve that mental model at the code

34:50

point of view. That was the most

34:52

effective place was us working at Java,

34:54

you know, Java, you know, C, whatever it

34:57

is, rather than working at assembly

34:59

level, right? And it's like, okay, well,

35:02

is actually what we're talking about

35:03

really. We're stepping that level up.

35:05

We're still actually building a product

35:07

together. We're still thinking about

35:08

what the software is. we're still

35:10

building that mental model maybe now

35:12

more collaboratively involving you know

35:15

more product people for example in that

35:17

conversation when we're writing our

35:19

specs and so the question for me is are

35:21

we ready to make that step and the

35:23

answer is no not everywhere and this is

35:25

a really good point because if if you

35:26

think about it like uh you know like one

35:28

of the the mantras inside of Facebook

35:30

used to be that I think some something

35:32

along the line that code is code is

35:34

truth or something like that but in

35:36

general in a lot of tech companies if

35:38

you want to know like how things work

35:41

like where the truth lives is it in

35:43

documents or is it in the coded business

35:44

logic it's in the code in the business

35:46

logic and if if it's well-maintained

35:48

code often well commented or structured

35:51

you can actually see the business logic

35:52

and the rules for I don't know for

35:54

example see I I feel like I've got to

35:56

channel my friend charity at this point

35:58

and say the truth is production

36:00

>> that that's everything else is is is the

36:02

lies we tell ourselves production is

36:04

truth

36:05

>> um but I think in terms of like a

36:07

definition of what the system should be

36:09

doing. There is this ongoing debate

36:12

about where is that definition? Is it

36:14

the code or is it the spec? Brigitta

36:16

broccoli did a nice article on Martin

36:18

Fowler's website recently about spectrum

36:20

development and she talks about the idea

36:22

of some companies using uh being spec

36:25

first or spec anchored and a lot of it

36:27

comes down to where they see the source

36:29

of truth being. So a lot of companies

36:31

are using things like Kirro or Spec Kit

36:33

to define a feature and then the LLM

36:40

executes that spec and you can iterate

36:42

on that process, right? And so a lot of

36:45

people they start off they use the spec

36:47

to write the code and then they throw

36:48

the spec away and then you get other

36:50

companies that keep the spec and then

36:52

when the feature changes they just

36:53

update the spec. And so they're sort of

36:55

seeing a bit the code and a bit the spec

36:57

as a source of truth in terms of what

36:58

the system should do. And then you're

37:00

start now starting to get companies

37:02

where they don't even ever look at the

37:03

code and they just look at the spec.

37:05

>> Yeah.

37:05

>> And so we're kind of going on this

37:07

spectrum. She had some great terms for

37:08

these. And I think for me it's like is

37:10

that the right path? I don't know. I

37:12

think there's a lot of questions about

37:15

what we would need to do to to get that.

37:17

we have a degree of confidence about

37:20

what happens when I execute a line of

37:22

Java code beyond the safety of the

37:24

compiler and the runtime and you know

37:26

all that stuff. There's a lot more

37:28

questions to answer I think before the

37:30

whole world is ready to say the spec is

37:32

the source of truth of what our system

37:34

is supposed to do. Production is always

37:35

going to be the real truth though just

37:36

to be clear.

37:37

>> But but I think it's a good question to

37:38

just ask yourself what however you're

37:40

building and however you're using agents

37:41

of where is the truth of your system

37:44

right now. Is it more in the code? Do

37:46

you have a spec? Is it scattered between

37:49

the minds of people? Uh- which goes back

37:52

to the the collaboration? Because again,

37:54

a lot of the reality of a lot of

37:55

startups are is a few people hold these

37:58

things in their head, right? Which is

37:59

okay in in the beginning. But of course

38:00

as you scale one of the reasons we used

38:02

to love code review which is now going

38:04

out of fashion but we used to share

38:06

information and when someone left the

38:08

company or or got ill or you know the

38:11

the famous bus factor it was okay cuz

38:13

other people understood because they

38:15

reviewed they were taking part in that

38:17

part of it but now we're with with AI

38:19

code review is some some some companies

38:21

are like well we're not going to do it

38:22

because of it's it's with too much code.

38:24

That was always one of the superpowers

38:25

of pairing, right? Pairing you if you do

38:27

if you do promiscuous pairing, you

38:28

rotate every day. When someone leaves,

38:30

everyone's got the same shared context.

38:32

That was always something people missed

38:33

around one of the benefits of pairing.

38:35

>> I think there's a lot to be said around

38:36

this. I was chatting to Chris Ford who's

38:38

sort of head of software head of

38:40

technology for Thoughtworks in in Spain

38:43

and he said the biggest problem we've

38:45

got around our around AIdriven software

38:48

delivery is tacid knowledge. There's a

38:52

lot of knowledge in our heads that we've

38:55

built up that we don't necessarily know

38:57

that we have. When you use something

39:00

like a code review, you've probably had

39:02

looked at that and that doesn't really

39:03

feel right. I wouldn't do it like that.

39:05

And sometimes it's subjectivity, but

39:07

sometimes there's something about that

39:08

that you can't quite pinpoint. Maybe you

39:10

can unpack it, maybe you can't. But

39:12

there's also like you have bunches of

39:14

things like that in your head about how

39:16

software delivery should be done, about

39:17

how the business works and everything

39:18

else. If we want to step up that level

39:20

of abstraction to work at the spec

39:23

level,

39:24

we actually need as human beings to be

39:27

able to unpack that tacet knowledge that

39:29

we have and make sure it's in the spec

39:31

if we really want to be be hands off. I

39:34

also think there's a fundamental problem

39:36

that we've got in the current way a lot

39:38

of people are doing software deliveries.

39:39

You've got I mean this comes back to the

39:40

cognitive debt stuff which is you've got

39:42

a lot of people running off in different

39:45

directions. I've seen a few people

39:46

talking about pairing with their AI

39:48

assistant. not a human. Stop pretending

39:50

it is. And so you're all going off.

39:52

You're doing more in a different

39:53

direction. That shared mental model of

39:55

the program is breaking down and there's

39:57

gaps in between. AI was supposed to free

40:00

us from drudgery, right? It it isn't for

40:03

most software developers because we're

40:04

doing more work, we've got more context

40:06

switching, we're losing that big

40:07

picture. So I think if we can work

40:09

collectively on the specs, we can

40:11

rebuild that model, then that absolutely

40:13

could be the sh source of truth. I still

40:15

think it's going to be parts our brains

40:18

and part the spec, right? But for that

40:20

to work with there does have to be the

40:22

collaboration piece. Whether or not

40:25

that's our dev teams go from being 15

40:27

people all in to about five people or

40:29

six people all in, don't know. But

40:32

collaboration is really important. You

40:34

know, Chang proper company, right? They

40:36

do proper stuff. They're excellent firm.

40:38

They recently announced they were

40:39

getting rid of any human-based code

40:40

reviews and they said we're going to

40:42

spend more time working on things like

40:44

effects working at design doc level and

40:46

actually I'm okay with that because

40:47

firstly I trust that they know what

40:48

they're doing but also there's something

40:50

about I mean I think a lot of companies

40:53

are making a mistake of not doing the

40:55

thinking whereas Shanggard is saying

40:56

we're going to spend that time doing

40:58

more important thinking right and I

41:01

think that's sort of how we should view

41:02

this I'm okay you know not looking at

41:04

the code as long as you're doing other

41:06

things to make sure the

41:07

is operating correctly and that you're

41:10

thinking critically about how the system

41:13

needs to change and evolve. If you're

41:15

just not looking at the code and you're

41:17

not caring about those other things,

41:18

well then you deserve everything that's

41:20

going to happen to you.

41:20

>> Which also goes back a little bit to

41:21

what Charity was talking about on how

41:23

you want to have systems that that value

41:25

that works about having empathy for

41:28

example for for the work that QAS and

41:30

and uh SR folks have had to own code in

41:34

production that they did not they did

41:36

not write. they don't necessarily read

41:38

or even understand, but they know how to

41:41

operate. They know what good looks like

41:42

in production. They they know what what

41:44

it looks like when it goes goes poorly.

41:46

>> I mean, that's also a bigger thing that

41:48

now more developers are having to

41:49

struggle with because if you want to do

41:51

spectriven development, you have to know

41:52

what good looks like. I did a I I run

41:55

these like sort of half day conferences

41:56

for O'Reilly online. And we did one

41:58

recently on software delivery and a load

42:01

of speakers at um and about six speakers

42:05

and four of them were talking

42:06

specifically around different different

42:08

varieties of of spectrum development

42:10

effectively and all of them came back

42:12

says you can't do this unless you can

42:14

define what good looks like and if you

42:16

can't don't bother and you know some of

42:18

those people were much more bullish like

42:20

Addie is very bullish on all of this

42:22

stuff but one of the presenters who was

42:23

doing they did they've got like a small

42:24

software fracture only 15 or three

42:26

people but like they're active ly

42:28

pulling in their observability data

42:30

their hotel stuff right into uh into

42:33

their their agent to understand how it's

42:36

changing and I think that's exposing I

42:38

think more developers into understanding

42:41

I mean this comes back to the acceptance

42:43

criteria stuff people do on stories they

42:45

always narrow around functional

42:46

requirement stuff so now it's like I

42:48

think we have to be more grown up about

42:50

those things the discipline is

42:51

absolutely important and the expertise

42:53

is still needed it's just needed at a

42:54

different place

42:55

>> Sam made a really good point that you

42:57

cannot hand your work over to agents

42:59

unless it does these two things. One,

43:01

define what good looks like. Two, prove

43:04

that your system does what this good a

43:06

definition looks like. You already know

43:08

who I need to mention when it comes to

43:09

proving that your system works as

43:11

expected. Antithesis, our season

43:13

sponsor. Agents are writing more of the

43:15

code. So, how can we trust that our

43:17

system works correctly without bugs?

43:18

Code review is increasingly naive and

43:21

ineffective approach to do so, which is

43:23

why antithesis goes well beyond this

43:24

practice. Antithesis runs your whole

43:27

system in a hostile simulation. This

43:28

simulation includes both targeted

43:30

testing and fuss testing. By running the

43:32

simulation, it finds every bug before

43:34

your users do. And because the

43:36

simulation is fully deterministic, it

43:38

doesn't only find bugs, it gives you a

43:40

perfect reproduction of every issue,

43:42

which makes it a lot easier to fix

43:43

issues. The first thing I thought when I

43:45

heard about antithesis and that it's

43:47

automated bug discovery and fully

43:49

deterministic testing that it sounds

43:50

like science fiction, but actually it's

43:53

hardcore engineering when you look under

43:54

the hood. Jane Streetfly.io and the CD

43:57

community ship agent written code with

43:59

full confidence because they know it's

44:01

been verified by antithesis. To see more

44:03

case studies and details, head to

44:04

antithesis.com/pragmatic.

44:07

I'd also like to mention our presenting

44:08

sponsor, Turbopuffer. We know it's a

44:10

database that's ridiculously fast and

44:12

extremely cheap and they are doing

44:14

something amazing. They are completely

44:16

redesigning their storage architecture

44:18

from first principles to make search

44:19

faster, cheaper, and more reliable at

44:22

scale. If you follow Turbuffer, you know

44:24

that their storage architecture was a

44:25

massive part of their early success.

44:27

Redesigning a winning architecture is a

44:29

big deal. It's one thing for query plans

44:32

to pass unit tests, which is already

44:34

happening. It's another to bring each

44:36

query plan to performance par or better

44:38

while maintaining correctness and

44:40

reliability in production. And the team

44:42

is sharing the messy reality of the

44:43

rewrite and how the v3 version is

44:45

currently a lot slower than the current

44:47

production one. For example, we can see

44:48

how coldtech search is 11 times slower

44:51

than prod and hot full text search is

44:54

126 times slower. But we can already see

44:56

some wins like hot and cold vector

44:58

search is at par or better. I really

45:00

appreciate this work in progress view

45:03

and the real-time logs and what it takes

45:04

to do a successful storage architecture

45:06

rewrite. The Turbopuffer team is keeping

45:08

on the worklog of their journey and you

45:10

can follow along at turbopuffer.com/v3.

45:13

I definitely will do. And with this,

45:14

let's get back to Sam and what QA and S3

45:16

folks already know about running code

45:18

that they didn't write. So, I I I want

45:21

to talk to you about your latest book

45:23

that is just coming out, building

45:25

resilient distributed systems.

45:27

>> Yeah. What is the book about? And why

45:29

did you feel this is a good time to

45:30

write it?

45:31

>> Years and years and years ago, I went to

45:34

Velocity which was quite a well-known

45:36

conference.

45:37

>> It's a conference. Is is it still on?

45:38

>> No. No. It was the O'Reilly conference

45:40

and it was like the conference where a

45:42

lot of the early people went to talk

45:43

about how they made their system

45:44

scalable and stuff. I got to go. It was

45:47

been like one of those career ambitions

45:49

to go to. I got to go after I' written

45:51

the first book and I got chatting to

45:53

John there who I still chat to every now

45:54

and then. he now works in this

45:56

resilience engineering space. pointed me

45:58

I don't know if it was him or one of

45:59

someone else but it pointed me at this

46:00

paper by David Woods that was all about

46:02

resilience engineering and the paper was

46:05

utterly baffling to me in absolutely no

46:07

sense to me but it was all because it's

46:08

not yeah cuz it's just it's not written

46:10

for computer scientists to read and I'm

46:12

not even a computer scientist so I was

46:13

really in trouble

46:14

>> but it was really fascinating seeing

46:17

this whole other world about how we make

46:19

how how people viewed resiliency and

46:22

then what we do in software world and

46:23

people like John were trying to take

46:24

some of those ideas in a little bit but

46:26

I found it very difficult to take some

46:27

of those ideas from sort of safety

46:30

critical systems and that type of

46:31

thinking and make it in any way, shape

46:34

or form palatable for normal people like

46:37

me. And so I kind of this was being back

46:40

what 20 2016 maybe 2015 and so I'd go

46:44

back and try and reread that paper every

46:45

six months or so and I'd read bits

46:47

around the edges and see other smarter

46:49

people than me that summarized it data

46:51

better. And then I was thinking okay

46:52

these ideas now are starting to make

46:54

sense. And then also I kind of realized

46:56

that despite my best efforts, lots of

46:58

people seem to be building microser

47:00

architectures. Even though if you've

47:01

read my books, most of my book is about

47:03

telling you not to do it.

47:04

>> But you have to read the book, which

47:06

which is called microservices.

47:07

>> I mean, let's be clear, as long as they

47:09

buy the book, that's the most important

47:10

thing, whether they read it or not.

47:11

That's just, you know, but and so then I

47:13

realized that there are more people

47:15

exposed to the the the horror, pain, and

47:18

suffering of a distributed system. And

47:20

so it was like, okay, so I've got this

47:22

stuff happening. I've got this like my

47:23

you know my my son's a developer now and

47:26

I always thought that if somebody found

47:28

themselves building a distributed system

47:31

working as part of building a

47:32

distributed system what was like the the

47:34

kind of equivalent of a rubber ring I

47:36

could give them say stay a flow and

47:37

don't drown and so the goal of the book

47:39

is to start you off with really easy

47:42

foundational simple kind of engineering

47:44

concepts about how you can start making

47:47

dealing with the problems of distributed

47:48

system but to also take you on a journey

47:51

into kind of the whole concept of

47:52

resilience engineering and so it starts

47:54

off with like really easy ideas and then

47:56

you study it gets more and more

47:57

complicated and you know so I introduce

47:59

kind of concepts like what a

48:01

sociotechnical system is the difference

48:03

between safety management and resilience

48:04

engineering these are all like big

48:06

concepts but the second chapter after

48:10

the introduction is what's observability

48:11

let's talk about hotel the sec the third

48:13

chapter is what's a timeout right and

48:15

these are all I think quite tractable

48:17

things talked

48:18

>> but they're building blocks right the

48:20

primitives for Yes.

48:22

>> For these systems and the vocabulary as

48:23

well.

48:24

>> Yeah. Absolutely. And to give, you know,

48:25

to go through and sort of distill some

48:27

of that knowledge down

48:29

>> and also to be a bit of I'm quite happy

48:31

being a bit opinionated on these things,

48:33

but I'm also lucky now because partly

48:35

because my early work, I get to chat to

48:37

more people. So, I can actually talk to

48:38

people who this is their full-time job

48:40

and try and distill down some of that

48:42

knowledge a bit. And so, I wanted that

48:44

book. Partly, it's about being

48:45

evergreen, but it was also about saying

48:48

there are lots of people building a

48:49

distributed system. Let's put what type

48:50

of systems you've got off to one side

48:52

for a moment. There are lots of people

48:53

building them whether they should or not

48:55

and they're really important to us now.

48:58

So, how do I how do I help people start

49:01

and grow? And that's that's what I

49:03

wanted to do. I mean, I enjoy the

49:04

process of writing anyway, but this is a

49:07

book I wanted to be able to give to

49:08

people. That's always been why I wrote a

49:09

book. I want the book that book every

49:11

now and I've gone and sat down to read a

49:12

book to write a book and I found someone

49:14

else has done done it already. It's like

49:15

well that exists now. So this for me was

49:18

the book that I wanted to exist but

49:19

didn't. That's kind of why I wrote it.

49:21

>> Yeah. And I I think it's a book I I I

49:23

certainly could have used like it got

49:25

dropped into a place like Uber where we

49:27

did have what I realized were

49:29

distributed systems. You don't just

49:31

large systems handling a bunch of stuff

49:33

lots of services dependent on on one

49:35

another cuz even a simple thing of like

49:37

knowing like oh you should pay attention

49:38

to observability that I mean you figure

49:40

it out after a while.

49:41

>> Yeah. Yeah.

49:42

>> But it takes a while.

49:43

>> Yeah. And I think that's I mean again I

49:45

mean maybe this is this is my attempt to

49:46

unpack some of that tacet knowledge to

49:48

an extent. I've made so many mistakes

49:49

and I keep making mistakes. I think

49:51

making mistakes is useful but I think

49:53

also creating opportunity where people

49:55

can learn from other people's mistakes

49:56

first is a good idea too. And so in the

49:58

book I also try and pull in like real

50:01

world examples and sometimes from big

50:03

companies sometimes from my mistakes to

50:06

kind of make this stuff seem real. And I

50:08

think the the other thing I think I

50:09

really try and get across is that things

50:11

go wrong. Right. I mean, resilience

50:14

engineering is all about making sure as

50:15

many things go right as possible. It's

50:17

not about making sure everything goes

50:18

right.

50:19

>> Yeah.

50:20

>> And there's also the only way you can

50:21

build resilient systems in general is

50:24

also by being honest about mistakes that

50:26

have been made and talking about them

50:29

and sharing them because that's how

50:31

everyone gets better. And if you don't

50:33

do that, you can't build a resilient

50:34

system in your company. And so this

50:37

again is my attempt to sort of highlight

50:39

all the awesome work that's gone before

50:41

the fantastic post instant reports of

50:43

people that some companies share like

50:45

when there's a system that we all use or

50:48

many of us use has an outage. I mean,

50:50

it's it's annoying, especially when

50:51

you're using it. But I always greatly

50:53

appreciate when the companies because

50:55

they don't have to do this, but when

50:56

they share a public postmortem or

50:58

incident recap or whatever that is, they

51:00

go through what happened. For example,

51:02

GitHub had an outage and they shared a

51:03

really interesting one on what all the

51:06

things that went wrong and and in what

51:08

order. And then you also have companies

51:09

where something like this happens and

51:11

they don't do anything. So, of course,

51:13

you're not obliged to in any way, but I

51:17

always have a bit of a lesson. they are

51:19

obliged to now a lot of them regulations

51:22

are now making them that they have

51:23

>> which I which I I think is great

51:24

>> yeah things like Dora and stuff in the

51:26

UK in Europe rather and I think there's

51:28

also we should also separate around that

51:29

post instant report stuff that there's

51:31

marketing and PR versus have you done a

51:33

proper post instant review now I do

51:36

think you've got duty of care really to

51:37

let users know as part of a proper post

51:39

instant review but those companies maybe

51:41

say nothing they might do a fantastic

51:42

process internally there's also the fact

51:44

that some companies that put those

51:46

things out you read them and you're like

51:47

this does feel more marketing.

51:49

>> Yeah,

51:49

>> I think a great if you want a good a

51:51

company that puts out some of the best

51:54

self- flagagillating post instant review

51:57

writeups, go for Cloudflare stuff. They

51:59

absolutely go for themselves in those.

52:01

It's like I feel like guys go easy on

52:04

yourselves, right? Everyone makes some

52:05

mistakes, but I quite like

52:07

>> and and do it they do it rapidly within

52:09

24 hours and they're a publicly traded

52:11

company. Yeah. which which I think just

52:13

goes back to the myth like some of them

52:14

are like we're publicly traded we don't

52:15

want to do it because it would give away

52:17

information for shareholders yet no like

52:19

cloud for does it and and they're fine

52:21

>> exact exactly and and and also it's

52:23

>> and it builds of trust

52:24

>> it is I mean a lot of a lot of how an

52:27

organization is perceived is is down to

52:29

how you deal with mistakes when they

52:31

occur right I mean you know nothing ever

52:33

goes perfectly for every company

52:34

>> so in in your book you talk about the

52:36

three rules of distributed systems what

52:38

are these three rules

52:40

>> so I really tried to distill this down

52:41

because I could never remember the the

52:44

eight the rule of eight that came out of

52:46

sun the fallacies of distributed

52:48

computing I always forget what those

52:49

eight were there's loads of complicated

52:50

stuff but I realized when you strip it

52:52

all down there's really only three

52:54

things that really cause all the other

52:55

problems right the first is that you

52:57

can't send information instantaneously

52:59

from point A to point B

53:01

>> it's physics I mean now it turns out

53:03

when you get into it and start talking

53:04

to people about quantum physics they say

53:06

aha

53:07

>> and they go there's a thing called

53:08

quantum entanglement which does allow

53:10

for theoretical instantaneous read of

53:13

electron spin states across arbitrary

53:15

distances at which point I point out

53:17

that a that only works for reads as far

53:20

as I'm aware and b not a networking

53:22

protocol. So like but it takes time,

53:24

right? So I want to get from A to B and

53:27

I that I can't control all of that. I

53:29

can control bits of that as a developer.

53:31

>> Y

53:32

>> I could control how much data I send. I

53:34

could control the the the payload size

53:36

technology I use to serialize and

53:37

deserialize.

53:38

>> I'm unlikely to be specifying the

53:40

network cabling or the equipment we use

53:42

or the distances between them. So not

53:44

really under my control. And the moment

53:46

you go over the public internet,

53:48

>> BGP has a bad day and your packet has

53:50

gone down the wrong trail leg of the

53:51

internet. Right. Yep.

53:52

>> So that's the rule one. It takes time.

53:54

Um and that's important to recognize

53:57

because sometimes it looks

53:58

instantaneous. It's not. Second thing,

54:00

sometimes the thing you want to talk to

54:01

isn't there. Sometimes that's under and

54:03

we do things to make it under our

54:04

control, right? Like we would run say

54:07

multiple copies of a service instance

54:08

behind a load balancer. What happens?

54:11

The load balancer fails. But I mean like

54:14

you can't control for everything, right?

54:15

I've had services taken out by a fire in

54:18

a data center. a sand caught fire and

54:21

specifically one bit of a sand. The sand

54:23

had a caching storage layer with SSDs.

54:26

These two pairs of SSDs, one of the

54:29

pairs of SSDs caught fire. The other

54:31

pair the SSDs were working fine. And so

54:33

we had these weird latency graphs coming

54:35

out of the sand like perfectly fine if

54:37

your load went through the ones that

54:39

weren't on fire, but the failovers in

54:41

the other one were rooting to be fair.

54:42

It was rooting around the bits were on

54:44

fire. I had a system uh where we had

54:47

ducting between the office buildings and

54:49

rabbits moved into the ducks and ate a

54:50

networking cable. I can't control for

54:53

rabbits, right? And sure, these things

54:56

are like they're real. Those are two

54:57

things, right? Yes, you can control for

54:59

that and you can reduce the chances, but

55:01

you can't limit those chances, right? So

55:02

sometimes, so rule number two is

55:04

sometimes the thing you want to talk to

55:05

isn't there.

55:06

>> And the third rule, I'm very grateful to

55:08

an old colleague of mine, Ben Cole, for

55:09

telling for for saying I've missing is

55:11

that resource calls are not infinite.

55:14

meaning

55:14

>> you can run out of computing resources,

55:16

CPU, memory, IO, whatever.

55:19

>> And basically your load balancer could

55:21

be overloaded and then just not respond

55:24

even though it's there and we know the

55:25

latency, but it maybe a skew fills up.

55:28

>> And the vast majority of the time when

55:30

you have a system outage, it's down to

55:32

that

55:32

>> some resource has been totally saturated

55:34

somewhere. And it might have been that

55:36

saturation might in turn have been

55:38

caused by the fact that something is

55:39

down and you're in a retry storm which

55:42

is in turn causing you know connection

55:45

starvation which is of course resource

55:47

saturation which is in turn yada yada

55:48

yada y

55:49

>> but that that's the killer and and again

55:52

I think we understand that you know sort

55:54

of intellectually all of these things

55:56

but you can go to all the concept

55:58

complicated concepts and distribute

56:00

systems and sort why is bisonantine

56:01

consensus protocol a thing well let's

56:03

just go all the way down to this bit

56:05

what about cap and packel and I just

56:08

yeah let's put that on one side remember

56:10

these three rules first and then most

56:12

problems end up becoming a little bit a

56:14

little bit easier to deal with

56:16

>> and and in the book after you introduce

56:18

these rules you start as as we mentioned

56:20

the second chapter is observability to

56:22

me that kind of suggests that this is a

56:24

really really important part for

56:25

distributed systems why is observability

56:28

so important

56:28

>> I mean the way to think about

56:29

observability is it's a property of a

56:31

system right so the more observable

56:33

something is the easier is for me to

56:35

understand how that thing is behaving

56:37

based on the external signals. When you

56:39

run a pro a system which is a single

56:41

program, you actually get some pretty

56:44

high quality signals coming out of that

56:46

program. Therefore, give you a high

56:48

degree of observability.

56:50

I can get a lot of information out of

56:52

that. I can attach a debugger to a

56:53

process. I could generate a core dump

56:55

>> and run that in. I could do a thread

56:57

dump on J on the JVM and work out where

56:59

my semifalls are blocked. If this is my

57:01

whole system, like knowing the CPU is

57:03

stuck at 100% is actually really useful

57:05

information because that's probably a

57:06

bad that's a problem. Right. So this

57:09

basic information that we pretty much

57:10

get for free with a single program gives

57:13

us a high degree of observing program

57:15

running on your machine that you have

57:16

access to.

57:17

>> Exactly. Right. Yeah. But but now when

57:18

we go to a digital system, you don't

57:20

have access to the computer in the same

57:21

way. You've got multiple computers. And

57:24

so those basic signals are harder to

57:26

get. You can't correlate them unless you

57:28

do extra work. And those individual

57:31

signals by themselves don't really give

57:33

you a proper sense of how the system is

57:35

behaving. So, so you have to do more

57:37

work to make the system observable and

57:41

as as annoying with these sorts of

57:43

things, it's much easier to do that from

57:44

the beginning than it is to retrofit it.

57:46

And then, you know, luckily we've got

57:47

things like hotel now, the open

57:49

telemetry um protocol and specification

57:51

because that at least gives us an open

57:53

framework that we a vendor agnostic. Oh,

57:56

honeycomb are the best. Charity pays me

57:58

in stickers. Just to be really clear, I

58:00

have to be I always think I work

58:01

independently. I have to be very clear.

58:03

Charity pays me in stickers. But like we

58:05

get a vendor agnostic open standard for

58:07

this now. It makes it so much easier for

58:08

me to have the conversations about this.

58:10

But if I don't get the signals coming

58:12

out of the system, if I don't get the

58:14

that stream of structured events telling

58:15

me what the hell's going on with my

58:17

system, I'm flying blind. Like how do I

58:19

know what appropriate timeout is for

58:21

from a client point of view talking to a

58:23

service? Well, I'm only going to know

58:24

that if I have a sense of well, what is

58:27

its normal uh response time um

58:29

distribution? So, I'm going to need

58:31

latencies, know the success or failure

58:33

of those latency. It's probably going to

58:35

be a plot on a histogram maybe to take a

58:37

look at it. If I don't have that

58:38

information coming out, I'm not going to

58:40

specify a timeout correctly.

58:41

>> And then we're talking about a low-level

58:43

thing like latency and and things that

58:44

we can measure at the machine level.

58:46

But, of course, is is this observability

58:47

when I'm talking about like does it work

58:49

for the user or the customer? Does it do

58:51

what they do when it they click click

58:52

the button to submit? Does it submit? Do

58:55

you look at that because we know

58:56

observability is usually we talk about

58:58

these kind of latencies the the statuses

59:00

the 500 responses that's kind of bad

59:02

that's means it's down but there's

59:04

always a layer that I always wondered

59:06

and I found it hard even when we're

59:08

working in teams to okay like we have

59:10

the the easy observability like this is

59:13

kind of text not textbook

59:14

>> it's the metrics it's the metrics but it

59:17

looks but then there's the stuff of does

59:19

it work does it do what people care

59:22

about like again in the case of like an

59:24

Uber Like when people hit a button to

59:26

request a ride, like does it actually

59:28

request within within usually 5 seconds

59:30

or something like that or is it stuck in

59:31

an infinite spinner which is which is

59:33

bad. Even your locks can be as healthy

59:34

as can be but people are upset, right?

59:37

>> You know, you you treat the raw data of

59:40

making the system observable as as a as

59:42

a stream of structured events and then

59:44

from that you build up the higher level

59:46

abstractions and the views, right?

59:47

>> So use as primitives.

59:48

>> Use them as primitives. So a trace,

59:50

right? where we get a sense of for a

59:51

given click of a button what happened in

59:54

the production system and this is a big

59:56

blind spot right most organizations had

59:58

to build their own tracing systems. So

59:59

this is where things like the open

60:01

tracing stuff came from and things like

60:03

zip kit and things like that were built

60:04

as an attempt to recreate like I mean

60:07

most people were just trying to recreate

60:08

what Google had already built there and

60:10

this is an attempt to say okay can we at

60:12

least look at a flow of calls what

60:13

happened during that flow of calls where

60:15

did these things go

60:16

>> well that requires me to get a bunch of

60:18

spans

60:20

ac

60:22

>> and a span meaning

60:23

>> a span meaning an activity basically

60:25

something I did

60:26

>> um and then a span can be gapat more

60:28

spans So I can say my first span might

60:31

be a call has hit my my server, right?

60:33

So I've now got a span that starts

60:35

within that span I might talk to my

60:37

database and then do other operations

60:38

and I can put additional information on

60:40

those spans and then I call to another

60:41

service and then you a trace ID that's

60:43

shared across those spans and you've got

60:45

timing. So now you get effectively a

60:47

view of what's happened across those

60:49

courts but that's all just based on

60:50

individual events been stitched together

60:52

and then you also though start getting

60:54

into system situation which is is my

60:56

system behaving correctly and you know

60:58

this is going away from again as I think

61:02

half of just saying what charity would

61:03

say um you know again going away from

61:05

the vanity dashboards this is moving

61:07

into sort of the world we call the

61:08

SLOs's right the service level

61:09

objectives

61:10

>> and SLI

61:11

>> and SLI so an SLI service level

61:13

indicator that's our way of saying at

61:15

this given point in time for this thing

61:18

is this thing good or is this thing bad?

61:20

And we use a collection of those S. So

61:22

one example of that might be a

61:23

successful percentile response time.

61:25

Right? So that would be is it a good one

61:27

or a bad one? It could be a bad one

61:29

because it's an error. It could be a bad

61:31

one because it's slow, good or bad. And

61:33

I collect those together and that helps

61:35

me know if I'm meeting my SLO. So I

61:37

might have an overarching SLO which is

61:39

uh I should be able to uh request a ride

61:43

with 99 percentile successful ride

61:45

request within uh 300 minutes.

61:48

>> Yeah. And that would be your statement

61:50

and that would be a commitment. The SLO

61:52

is supposed to be a commitment. That's

61:53

something our team is is working

61:54

towards. You then get this raw data. You

61:58

calculate your SLI on the individual

62:00

things and then you use that to work out

62:01

what your SLO is looking like. If it's

62:04

green, everything good time. If it's

62:05

red, people are unhappy. I mean, you get

62:07

a bit of red. There's there's way more

62:08

nuance to it than that. I'm to give a

62:10

very bad introduction to this stuff, I

62:11

think. But without those building blocks

62:13

cuz I I talk about in the first chapter

62:14

of the book, nobody says I don't want my

62:18

system to be resilient.

62:19

>> Yeah. No, no one.

62:20

>> But at the same time, resiliency is not

62:22

a binary property. It's not like off or

62:24

on. It is a bit like observability. It's

62:25

a degree. So then the question is how

62:27

much do you need? Because am I having a

62:30

conversation with you about multicloud

62:32

and you know doing complete rewrites of

62:34

systems for critical standings like

62:36

Monzo do for example?

62:38

>> Yeah they have a they have a standing

62:39

bank when they go down so it's it's

62:42

sitting there it's costing them money

62:43

for the most part but then just a few

62:46

weeks ago their main application went

62:48

down for a short period of time and they

62:50

activated that bank which I'm assuming

62:52

it cost them millions of pounds or

62:53

dollars per year just to keep it there.

62:55

It's not even that slight sidebar, but

62:58

so firstly there's their standby bank

62:59

has a real stripped down list of

63:01

features. It's much more bare bones, but

63:02

it's all the the core ones like you can

63:04

freeze cards, you can take money out,

63:06

you can check your balance. It's a

63:07

complete rewrite, so it's no shared code

63:10

because they're worried about a bug.

63:11

Different cloud vendor. It's also by

63:14

design significantly more cheap to run.

63:16

So they've got thousands of

63:17

microservices on the full stack. This is

63:19

about a tenth the cost of the cloud

63:21

costs.

63:22

>> They also run it constantly.

63:23

>> Yeah. So it's always there. Um but like

63:26

Monzo know they're monzo right? That's

63:27

how that works. But like there's no

63:29

point you starting there. So actually

63:30

the reason I put the observatively stuff

63:31

in is like you need the raw data but

63:33

also you need to make decisions about

63:36

comes back to what good looks like.

63:38

>> Mhm.

63:38

>> Then you need to know okay do I need to

63:40

worry about multicloud vendor DR

63:45

strategies because that's where I need

63:47

to be going or am I somewhere else? And

63:50

so I think without that kind of sense of

63:52

your north star, how resilient do we

63:54

need to be? Without that defined, you

63:57

don't know how deep you need to get.

63:58

This is more like trying to say how what

63:59

what how secure does my system need to

64:01

be? Have you done the threat model? If I

64:03

know the threat model, I don't know. And

64:05

I guess to answer this question of how

64:06

resilient do I need to be it greatly

64:09

helps and and maybe it's actually a

64:10

requirement to do an informed decision

64:12

is how much will it cost me in terms of

64:14

operating cost, in terms of time to

64:16

build it, in terms of for example

64:17

latency. Just simple example as is if

64:20

you say like okay you know the the

64:22

business is like oh would you like

64:23

multiloud and business like yeah we'd

64:24

love multiloud like if Amazon goes down

64:26

because we heard they had an outage last

64:28

week or a few months ago I actually want

64:30

to be able to run on Google cloud but

64:31

then you'll be like okay well first of

64:32

all this will mean we're paying two

64:34

cloud bills and if we want full

64:36

replication it might increase our

64:38

latency because we need to wait for to

64:40

write for both of them which might mean

64:42

slower you know customers might see

64:45

things slower anyway there's all of

64:46

these trade-offs And in my experience

64:49

like often times like you might retrofit

64:52

that but if you can have a discussion up

64:53

front that's great but to have the

64:55

discussion you go back to the basics you

64:57

need to know what the trade-offs are.

64:59

You need to know what's happening in in

65:00

all these dimensions that you know you

65:02

care about like how long will it take to

65:04

build how complex will it be? How much

65:06

money will it cost to operate? But also

65:09

as technologists

65:11

we can't just say oh our you we have

65:14

also got to get good at communicating

65:15

with our business stakeholders with our

65:17

end users.

65:18

>> Oh yeah.

65:18

>> What percentile latency do you want?

65:21

Like some developers know what I say

65:23

when I say that. Not all but some. How

65:25

many you know experts in their field who

65:29

are great product owners or subject

65:30

matter experts but are not software

65:32

developers would know what I meant by

65:34

that. And so we also have to understand

65:36

the business domain, the product domain

65:39

well enough to do the interpretation and

65:41

help and to bridge that gap. And it is a

65:44

a dynamic thing as well. I mean this is

65:46

the whole thing about resiliency in

65:48

general, right? A resilient system is

65:49

one that changes. It changes and it

65:51

evolves. If you don't change and evolve,

65:53

you're a brittle system. You're not a

65:54

resilient system. And so even those

65:57

targets we set that conversation we have

65:59

to have about what is good enough does

66:01

change. But like think about something

66:02

like in the case of say the US East1

66:04

outage towards the end of last year. Um

66:07

there were lots of AWS

66:08

>> on AS AWS US East1 region went down. It

66:11

was the oldest region big region. Lots

66:14

of people were there first because

66:15

that's often where new services got

66:17

launched historically.

66:18

>> When that went down it caused a lot of

66:20

people to say do we need to be

66:23

multi-reion? And some of those companies

66:25

would have had the conversation before

66:26

and decided no we don't. And then they'd

66:28

seen the fallout and they may have

66:30

changed their minds. And that is fine.

66:32

>> This this is what you mean by resilient

66:34

system evolves.

66:35

>> Yeah. You

66:37

>> the real world,

66:37

>> but also like it is about what problems

66:40

you're not going to try and solve. There

66:41

were some bigname companies that got

66:43

taken out when US East one went down and

66:46

and and got severely had severe

66:48

degradation in terms of what they could

66:50

offer.

66:50

>> Yeah. Companies like Zoom, for example,

66:52

they weren't taken off entirely, but

66:53

they were severely affected. Do we think

66:55

that people working at Zoom are idiots?

66:56

No. Do we think they knew that if a

66:58

cloud region went down there, they'd be

66:59

impacted? Yes. They probably looked at

67:02

that and said, "Well, for us to come out

67:03

with a multi-reion approach, it's going

67:06

to have this impact. It's going to cost

67:08

us this much money. It's not worth it."

67:11

Let alone talking multicloud because

67:13

multicloud versus multi-reion is a whole

67:16

different conversation. And that's okay.

67:17

And I think as long as you've had the

67:19

conversation and as long as this is the

67:21

other secret bit of it, of course, is as

67:23

long as what you think you need to do is

67:25

in tune with what your users think you

67:28

need to be doing.

67:29

>> Yeah.

67:29

>> This is why I make the point in the book

67:30

when talking about like the difference

67:31

between SLAs and SLOs's. The SLA is what

67:33

you're going to get sued for if you

67:35

breach. If you only ever deliver to the

67:37

SLA, your customers are really ever

67:38

happy. You've got to do more than that,

67:40

right? So there is the social contract

67:41

there as well.

67:42

>> Yeah. Now with building distributed

67:45

system, building resilient systems, it

67:47

really helps to understand concepts that

67:50

are not as straightforward and I'm I'm

67:51

not going to go through all the things

67:52

you explain a lot of things in the book,

67:54

but I do want to touch on a concept that

67:56

I found bit tricky to understand and

67:58

then appreciate and you really

68:00

appreciate in distributed system which

68:01

is item potency.

68:02

>> Yeah. What is item potency? So there's a

68:05

mathematical concept behind item potency

68:07

that I don't understand. But basically

68:09

an item potent operation is one that you

68:11

can uh you know you can apply that

68:13

operation multiple times without it

68:16

actually having an effect multiple

68:17

times.

68:17

>> So it has an effect once first time.

68:20

>> A really good example of an item pone

68:23

operation would be pressing a lift

68:25

button. So you want to go down in the

68:27

lift. You press the down button. It

68:30

lights up. If I press that down button

68:32

again, nothing's changed. The lift is

68:34

still coming. Well, we hope the lift is

68:35

still coming, right?

68:36

>> Yeah.

68:37

>> Like that's an item potent operation.

68:39

Some light switches are actually

68:40

toggles. I toggle it light goes on.

68:42

Toggle it light goes off. Right. That's

68:44

not an item potent operation. In

68:46

computing, we have some operations which

68:48

are item potent reads are a delete is

68:51

typically item potent. Right. But the

68:53

example I think I use in I introduce

68:55

this concept is a one of payment.

68:58

>> I was about to say that I have a lot

69:00

better item potent example for you.

69:02

>> Yeah. Yeah. payment is a good one,

69:03

right? So, I'm going to pay you money.

69:04

So, I I'm a service that wants to can

69:06

issue a payment and I send you please

69:09

pay Sam £100. Yeah, this is I'm NLPing

69:13

people back at home, right? Please say

69:15

pay Sam £100 and I don't get a

69:17

confirmation back. I don't get back a

69:19

response. The problem is from my point

69:21

of view there are two possibilities. The

69:23

first possibility is that you received

69:26

that payment request and you've done the

69:28

payment and it's been completed and

69:29

there and the result has got lost to me.

69:32

for some reason I didn't get the

69:33

response. That's one possibility.

69:35

>> The other possibility is that you never

69:37

got that. You never carried out the

69:38

operation.

69:39

>> Maybe it didn't get to you. Maybe you

69:40

crashed halfway.

69:42

>> I think like a good example that I

69:43

always I I've seen it in in the past and

69:47

maybe it's over. But airlines, you're

69:48

about to buy this airline ticket for

69:50

$1,000, $2,000. You've checked all of

69:52

your details and and it says like play

69:54

or reserve. And then often some airlines

69:57

would take you to an intermediate page

69:59

which says like please do not refresh

70:01

this page or submit it again because you

70:04

might be double charged and what you

70:05

really want is you pay you know like pay

70:08

and if you you get the spinner and it's

70:11

not item potent if you do it again and

70:13

you get charged twice.

70:14

>> Yeah. Uh but it is it potent if you just

70:17

refresh you you copy the same thing you

70:19

submit the exact same form.

70:21

>> Although that's interesting. So then the

70:23

question then becomes, right, so I sent

70:25

you that payment, book my airline

70:26

ticket, whatever it is, and I haven't

70:27

had that response back, but I really

70:29

want to make sure that the airline

70:31

ticket booking goes through. This is you

70:33

with the browser or the people at home

70:35

sending Sam £100, right? You really want

70:37

to make sure Sam gets his £100. Right

70:39

now, when something doesn't work in the

70:42

distributed system because of rule

70:44

number two,

70:44

>> rule number two mean the thing

70:45

>> sometimes might not be there. Rule

70:47

number one, sometimes it can take ages.

70:48

Yeah.

70:48

>> Um, and accepting this thing, right, you

70:50

just try it again. and you retry because

70:52

you really want it to happen.

70:53

>> And in retrying,

70:55

>> there's the danger that

70:57

>> if the first operation had been

70:59

processed successfully and you didn't

71:00

know about it or the first operation had

71:02

been applied successfully and you do it

71:03

again, you're not getting paid twice and

71:05

two two tickets. So that's the problem

71:06

with item potency.

71:08

>> You want to make it safe to retry

71:12

important operations. So to do that, we

71:14

need to make them item potent. There's

71:15

two ways to do it really. one that's

71:17

good

71:18

>> and is the one you should do but you

71:20

kind of have to retro retrofitting is

71:22

pain and one which is the one you just

71:23

explained which is useful but has

71:25

problems right so the first one is item

71:27

potency keys

71:29

>> yep

71:29

>> so you generate you have a unique ID you

71:31

normally use a UU ID for this

71:33

>> y

71:34

>> and so when you the unique ID which you

71:36

generate and when you generate two of

71:38

them they should be different there's

71:40

like this tiny tiny tiny tiny tiny tiny

71:43

likelihood of of clash which again what

71:46

happened I think

71:46

>> I know but like I think with UU ID 7 I

71:49

think it's like a 50 ncond chance but

71:52

it's something you can generate locally

71:53

without any additional round trips

71:54

>> your collision chance is extremely low

71:56

and there there's ways to modify that

71:58

>> but you can work with that

71:59

>> and this is

72:00

>> unless you're Amazon probably

72:01

>> well this but this is I mean the AWS

72:04

APIs you see Stripe

72:08

PayPal they all use the same key scheme

72:10

>> so you send this to U ID so then if you

72:12

send that to me you say pay sam and

72:14

here's the item potency key. I don't

72:16

send you back a response for whatever

72:18

reason. You retry it. You pass it on a

72:21

potency key. If I had carried out the

72:22

processing, I could look at it and say,

72:23

"Oh, have I processed this?" Yes, I

72:25

have. Okay, great. But if I have

72:26

processed it, even if I get a second or

72:28

third or fourth, have you processed this

72:30

process? I just keep going. Yeah, it's

72:32

processed. It's processed. It's fine.

72:33

That's a nice simple thing to do. The

72:35

issue with making things item potent

72:37

with item potency key is it requires

72:39

both the client and server to support

72:40

it. So, it has to be a required field

72:43

that goes through and it has to be sent

72:45

to server support. So if you're trying

72:46

to retrofit this in, it's a pain.

72:48

>> But but if you're building it, use an

72:50

item key.

72:51

>> Use it. Exactly. If anything needs to be

72:52

item pony, do that from the beginning.

72:54

The one you sort of mentioned was I go

72:56

back, I hit refresh, I fill in all the

72:58

same fields again and I submit the

73:00

airline booking again. He should know

73:02

it's a duplicate. That's another thing

73:04

you can do. This was this is good if you

73:06

want to retrofit item potency in. So if

73:08

I've sent the same fields, so the same

73:11

person Sam, the same amount, £100

73:15

and I'm sending this through again. What

73:17

you can do on the server side is

73:18

generate was a fingerprint. So I take

73:20

these fields.

73:21

>> Yep.

73:21

>> I then generate a hash that represents

73:24

those fields.

73:25

>> So if you do a second booking, it looks

73:27

the same

73:28

>> and you're using that as item port as a

73:30

retrofitted item potency key.

73:31

>> Effectively, yeah, there's a couple of

73:33

downsides with that. Um, you do get

73:35

false negatives with that.

73:36

>> Yeah. the false negative meaning that

73:38

>> it gets it might get legitimate second

73:42

requests can get rejected.

73:43

>> Got it?

73:44

>> So real world example this happens in I

73:46

and know this happens in Denmark. It

73:48

might happen elsewhere. I was speaking

73:49

to people in Denmark who works on a

73:50

payment system. You go in you buy

73:52

something for 40 kroner particular

73:53

payment system and you given the car

73:55

scan the card 40 kon or whatever. If

73:57

within the next sort of five minutes you

73:58

buy something else for 40 crroner in the

74:00

same shop the till the handset rejects

74:02

it. If it was 41 crone, it'd be fine. 39

74:05

crone, it'd be fine. But that's because

74:07

the chances of you buying something for

74:09

the exact same money, yeah, is so

74:11

remote. They're doing some basic item

74:13

potency to top double taps.

74:15

>> And so when you get situations where

74:16

operations can legitimately look the

74:19

same, but actually be different and

74:21

carried out at the same time.

74:23

>> So a really good example would be the

74:24

AWS APIs. It is completely legitimate

74:28

for me to in a for loop to provision say

74:30

20 different EC2 in 20 EC2 instances.

74:33

Now there's better ways of doing it than

74:35

sticking in a for loop but I could. So I

74:36

could iterate through the for loop and

74:38

spin up 20 identical EC2 instances. If I

74:42

just relied on there being a

74:43

fingerprint, they'd all look the same.

74:45

So that's where this stuff breaks down.

74:48

Um, and so if you've got situations

74:50

where legitimately you have operations

74:52

that come that look the same but are

74:54

actually different that could be done

74:56

close to each other, you have an issue.

74:57

If you've got a bit of space around

74:59

them, what you can do is hold on to

75:00

those fingerprints for a period of time,

75:03

5 minutes, 10 minutes, an hour. So

75:04

there's still some potentials you can

75:06

still let duplicates stick through. So

75:07

it's not ideal. Item potency key is the

75:10

way to go. Fingerprints when you have to

75:11

retrofit. If you use them both together,

75:15

that's going to be really useful. So you

75:17

can pick up situations where people

75:19

change the parameters between the retry

75:21

attempts which leads systems into

75:23

confusing. It's a bit more of a complex

75:24

topic but a lot of public facing APIs

75:27

will still generate a fingerprint.

75:29

>> And so if you send carry out this

75:31

operation and you give the same item

75:33

potency key you gave before but you've

75:35

changed the parameters the server can

75:37

reject it as being effectively an

75:39

invalid request. So that's how those

75:40

things work together. They're actually

75:42

ideas are really simple I think but it's

75:43

it's and there's some nuances about

75:46

implementing them. There's some

75:47

interesting stuff that crops up in terms

75:48

of how you store them on the server side

75:51

and things but the fundamental ideas are

75:53

pretty straightforward I think.

75:54

>> Now another interesting topic that comes

75:56

up often time these days it feels more

75:58

often is thundering guards.

75:59

>> Yes.

76:00

>> Uh it's it's when a system restarts and

76:02

suddenly it faces this big load.

76:04

Specifically, GitHub had an outage now a

76:07

few weeks ago where it was networking

76:09

related and recovery took a lot longer

76:12

time because there were retries going on

76:14

and it created the thundering herd. What

76:16

is a thundering herd?

76:18

>> Uh, generically I talk about it in any

76:19

situation where you've got mismatched

76:20

capacities. You've got too much too many

76:22

requests for too few resources, right?

76:24

Resource pool's not infinite. Coming

76:26

back to rule number three.

76:27

>> Rule number three.

76:28

>> Yeah. So, in the in the chapter I talk

76:29

about a whole bunch of different ones

76:31

from different types of scenarios,

76:32

right? So you've got everything from the

76:34

malicious thundering heard like a denial

76:36

service attack, right? A dig denial

76:38

service attack, malicious attack often

76:41

short notice and there's not that much

76:43

you can do about them. The answer is you

76:45

use fast or cloud flare but I go into

76:46

details about how that happens. You get

76:48

things like a kind of internal

76:50

self-inflicted ones. So a good example

76:53

would be something like um a cache

76:56

collapse, right? The system relies on

76:58

the cache not only for speed of

77:00

operation but also for reducing load on

77:03

other components.

77:04

>> Yep.

77:04

>> Cache gets restarted. You then have a

77:07

lot of cache misses. You're hitting the

77:09

origin and the origin goes down.

77:11

>> Yeah. Origin was not expecting as much

77:12

load.

77:13

>> Yeah. So a common thing there would be

77:15

you first you you'd flush those cash

77:17

snapshots to disk. Reduces the chance of

77:19

you being out having high cash misses

77:21

and over restart. But also a lot of

77:23

companies I know will just turn their

77:24

services off until the cash refills. And

77:26

so that's that's kind of another example

77:27

of one. Um, retry storm is another one.

77:30

Back in 2017, Square had a big outage.

77:34

They'd restarted Multipass, which was

77:36

their multiffactor authentication

77:37

system. Multipass in turn pulled its

77:39

data from Reddus that they were using as

77:41

a database cuz you can do that

77:42

apparently. I don't think they're using

77:45

as a cache basically, right?

77:46

>> Well, no, I think they were using as a

77:48

data. There are some people that think

77:49

Redd is a database. This is a different

77:51

podcast. We need to have a I'm thinking

77:52

of starting a stupid technology podcast.

77:54

We talk about using technology in stupid

77:55

ways. That's a separate conversation.

77:56

Anyway, so they were putting this data

77:58

back from Reddus and they had a problem

78:00

that the clients in multipass were going

78:04

basically if the Reddus calls failed

78:06

they'd try again but without any delay

78:08

between the retries and they had a

78:09

hardcoded limit of 500 retries. So they

78:12

just basically smash Reddus and they

78:14

kept restarting Reddis and then they'd

78:15

restart multi pass and again this is a

78:18

long time ago and they fixed it, right?

78:19

They fixed it by having a more sensible

78:21

retry policy and externalizing those

78:22

values. That's another fun thundering

78:24

heard. The last kind of sections of ones

78:26

I talked about were ones caused by like

78:29

products being too successful

78:31

>> like Twitter or and healthcare.gov,

78:34

>> right? This is where you have an

78:36

external real legitimate load that takes

78:39

you out. And the thing is you look at

78:40

all of these as solutions although

78:42

what's happened is the same the kind of

78:44

solutions are a bit different. So like

78:46

when I've got a thundering herd that's

78:47

coming from externally that's legitimate

78:49

well I've got different things I'll look

78:50

at like I I will have more I'd have a

78:53

more constrained sign up I'll have fewer

78:54

invite codes.

78:55

>> Yeah.

78:56

>> So with healthcare gov one of the issues

78:58

there was many others but was that they

78:59

went live like 36 states at once and

79:03

they were massively overloaded. So in

79:05

hindsight maybe going live in one state

79:07

would have been a good idea first. For

79:08

example with Twitter they were going

79:10

down all the time. So they could have

79:12

constrained signups or put tweet limits

79:15

on you and things like that to constrain

79:17

those are things and they they did those

79:18

things as well, right? And so although

79:20

they look the same,

79:21

>> the mitigations for each is a little bit

79:24

different. So I I kind of quite like

79:26

talking about that because they were all

79:27

great stories I found and I wanted to

79:30

>> and of course like I think we're talking

79:31

about like solving it with when you have

79:34

same resources but then we get into

79:36

thing as scaling like can you scale

79:38

horizontally add more resources because

79:40

because there there's two sides of this

79:42

right like whenever you have it and and

79:44

so what point can you do it or or are

79:45

you going to face a bottleneck because

79:46

you still have a central whatever

79:48

>> but like that's a great example of where

79:50

sometimes mitigations work and sometimes

79:52

they don't. So an example of something

79:53

like your product is successful. If

79:55

you're a startup or whatever and you

79:57

suddenly got successful, that success

79:59

comes like a wave, right? The wave of

80:01

success hits you and then a lot of it

80:03

recedes. You'll get a thousand customers

80:06

in and maybe you'll keep a hundred

80:09

maybe, right? That's just how things

80:11

work. So you need to be up during the

80:13

peak, but then you probably can shrink

80:17

down again to keep the cost low. So if

80:18

you've built your application to have

80:20

some dynamic scalability in it and if

80:22

you're on the public cloud or similar

80:23

place where you can spin up and spin

80:25

down that's a viable mechanism right

80:27

okay we can scale up to handle this and

80:31

that's fine would I use that as defense

80:33

against a distributed denial of service

80:35

attack no because then your distributed

80:37

denial of service attack becomes a

80:38

distributed denial of cache attack right

80:41

you go from to not only having no

80:42

service but also now no money because

80:44

you hit spinning up you know nodes on

80:46

your Kubernetes cluster and Amazon just

80:49

keep taking the money. It's great.

80:51

>> Yeah.

80:51

>> And uh you still can't keep up. So

80:54

that's a perfectly valid mechanism for

80:57

some things, but you kind of have to

80:59

know the context of which to say you

81:01

can't just scale yourself out of

81:02

trouble. Like we're I think we're going

81:04

back to a lot of times is like as an

81:06

engineer, you want to know about the

81:08

business. You want to know what creates

81:10

a value, what creates revenue, what is

81:13

important for the company versus what is

81:15

not. and then where we want to maybe

81:17

invest to. Yeah. With our

81:20

infrastructure, with our reliability, or

81:22

is this where it doesn't matter and it's

81:25

not worth doing?

81:26

>> It's all about trade-offs. And I think

81:28

it's about you don't know unless you get

81:30

information out of your production

81:31

systems, you don't know how close you

81:32

are to the red line. So that's why the

81:34

observability is key. But it is all

81:35

about trade-offs. And and it and that's

81:37

I I do a whole chat on like formal

81:39

methods. So I talk about cap and packel

81:40

and I say look these things are

81:42

complicated but actually really it all

81:43

comes down to a conversation with

81:44

understanding the business context. So

81:46

the example I give there is like if an

81:49

e-commerce company if I want to buy an

81:52

item online right physical item online

81:54

and if at that moment I want to purchase

81:56

it if you're not sure if you've got it

81:57

or not most e-commerce companies will

82:00

say yeah sure you can have it because

82:03

they know there's a good chance they do

82:04

actually have it in stock and if they

82:06

don't have it in stock they can get it

82:07

in and back order it and the worst case

82:09

scenario they can email and say sorry

82:11

and refund you the money right so that's

82:13

not great it's not ideal now if they

82:15

said we don't know if we this item,

82:16

therefore we're not going to sell it to

82:17

you. They're missing out on a sale and I

82:20

could go buy that somewhere else

82:21

probably and they might have had it. So

82:24

e-commerce companies in that situation

82:26

because of that that sort of

82:28

understanding the relationship with the

82:29

customer, the impact if they get it

82:31

wrong, they're going to try selling the

82:32

item. Keep that problem exactly the

82:34

same, but now change the business

82:36

context. Now we're selling concert

82:37

tickets. So you're getting tickets to go

82:39

see Tay, right? You're going to go see

82:41

Taylor Swift and we're not sure if

82:44

you've got the Taylor Swift ticket or

82:45

not because our link to that system is

82:47

down, but those Taylor Swift tickets are

82:49

yours. You're taking your kids, taking

82:51

your wife. It's all going to be awesome.

82:52

We're going to Portugal. We're going to

82:53

see Taylor Swift. It's going to be

82:54

amazing. And then we go, "Sorry, we

82:57

don't actually have those tickets." Now,

82:59

the problem with that is firstly, the

83:01

devastation you're going to feel is a

83:03

bit different. They can't back order a

83:05

ticket.

83:05

>> Yep.

83:06

>> And and so in that situation, it's like

83:08

that the impact of customer is so much

83:10

greater. now booked the flight and well

83:12

you might have booked the flight. So

83:13

what they do is they make a different

83:14

decision. So in that situation if they

83:15

don't know if they got the ticket they

83:16

don't sell the ticket.

83:17

>> I'm not sure if you cover in the book

83:18

but this is the fail open versus fail

83:20

close right when when you have an error

83:22

or you're unsure are you going to go

83:24

through or or not. And and as you say

83:26

this can be a decision the same problem

83:28

two companies can take a decision. A

83:30

company years down the road could take a

83:32

decision. Uber had this classic example

83:34

of of when payment we weren't sure if

83:37

the payment went through. Do we allow

83:39

the right to continue or not? And early

83:42

in the company's years, we always failed

83:44

open.

83:44

>> Yeah, just have the right. We we might

83:47

have the money and if not, we'll deal

83:49

with it.

83:50

>> As a company start to go for

83:51

profitability, we fail closed. Like

83:53

we're not sure we have the money. If the

83:54

charge went through, you're not going to

83:56

get the right. And again, same company,

83:57

different different plan, different

83:59

focus. And if if you're a developer, you

84:01

needed to pay attention to like what is

84:03

important right now for the business. It

84:04

was growth initially. And it's okay if

84:06

we lose money. And then now it's I don't

84:07

know unit economics profitability.

84:09

>> But also that open close versus open clo

84:12

that's a failed close versus failed open

84:14

discussion isn't one size fits all for

84:17

the whole system.

84:18

>> Exactly.

84:18

>> It's it's on a feature by feature basis.

84:20

And even a I mean even then

84:22

you could say this taxi ride is €10 or

84:25

it's €1,000. You can make different

84:27

decisions. Now if you approach this from

84:29

a mathematical and from a computer

84:31

science viewpoint, we just talked about

84:33

cat theory. That was a conversation

84:35

about CAP theory, right? So in the

84:37

chapter I talk about here's CAP, here's

84:38

PCE elk, which is an extension of CAP, I

84:40

explain what those models are because

84:41

when you get deeper into systems, you'll

84:43

hear about them, but fundamentally

84:45

that's what this is about, right? When

84:47

you have a partition, that's what the P

84:48

and CAP really defines. I can't talk to

84:51

one part of my system. Remember, it's

84:53

rule number two, but I can't talk to

84:55

another part of my system. What do I do?

84:58

And all you need to know as a developer,

85:00

I can't talk to that. What do I do?

85:02

Sometimes we can do make technical

85:05

decisions. I I'll try again. I hope I

85:07

don't bring my systems down for the

85:08

retry storm, but I'll try again. If that

85:10

doesn't work, what do I do? Well,

85:12

actually often the answer is yeah, sure,

85:14

you can look at cap and pack or whatever

85:16

else, but go have a conversation with a

85:18

product owner.

85:19

>> What should we do?

85:20

>> Yeah,

85:20

>> the resolution of that often ends up

85:22

being a decision about are we trading

85:24

off consistency versus availability in

85:26

packel or harvest and yield if you're

85:27

going into that version of brewers

85:29

conjecture. But don't worry about that.

85:31

That's in the book. That's why it's a

85:32

later chapter. That's chapter like 12, I

85:34

think, or 11. Don't don't start there.

85:36

Start with having the conversation. Rule

85:38

number two. I can't talk this part of

85:40

the system right now. What should we do?

85:43

And that starts with having the chat.

85:45

That starts having the chat.

85:46

>> When we're talking about resilience, you

85:48

talk about the dimensions to think about

85:51

resilience. What what what are these

85:53

dimensions? I start in the first chapter

85:55

by coming back to that paper by David

85:57

Woods I mentioned that was impenetrable

85:58

to me at the start and he comes up with

86:01

four concepts for resilience engineering

86:04

and I like the four concepts he comes up

86:06

with helps us think broadly right so it

86:08

starts off with robustness this is where

86:10

we can basically I think in his words

86:12

absorb known pertubations so we model a

86:16

system and something goes wrong and we

86:18

can kind of just deal with it in a way

86:20

that no one cares about doesn't even

86:21

know so a very simple example would

86:24

uh in Kubernetes a pod fails and

86:27

Kubernetes means a replacement. Now the

86:29

pod failing that's a pertubation and

86:30

saying it's gone a bit wrong but we've

86:32

dealt with it. Great. So that's the

86:34

start and and the thing is most

86:35

engineers I speak to they focus entirely

86:37

on this. They don't look at the other

86:39

three focus entirely on this. One of the

86:41

really nasty things about robustness is

86:43

the things we often do to make our

86:45

systems more robust in turn increases

86:48

the complexity of our system which in

86:49

turn increases the surface area of new

86:52

types of failure.

86:52

>> Mhm.

86:53

>> I bring Kubernetes in to deal with the

86:55

failure of a of a container. Now I've

86:56

got Kubernetes and that becomes Yeah.

86:58

And that's not solvable by the way.

87:00

That's just something to be aware of.

87:01

Right. This is also why sometimes people

87:03

don't go multi- region or multi- cloud

87:06

because it's increasing the surface area

87:07

of other failure types.

87:08

>> Yeah.

87:08

>> So that's number one robustness, right?

87:10

can always deal with those things and

87:11

and and for things to be robust, we have

87:13

to know about them ahead of time. This

87:15

is predictable. We deal with it. Then

87:17

there's rebound, which is when something

87:19

does happen and goes wrong, how quickly

87:20

can we recover?

87:21

>> So this this is the this is typically

87:23

the time to recovery.

87:25

>> Well, time to detection and time to

87:27

recovery.

87:27

>> Yeah. Different ways of measuring that.

87:29

And I talk about in the DR chapter, I

87:31

talk about, you know,

87:32

>> the disaster recovery.

87:34

>> Exactly. Yeah. Yeah. But that's like how

87:35

quickly can we get back up and running.

87:36

So we've gone into a degraded

87:38

functionality. how quick you can get up

87:39

and running. So that's that's thinking

87:40

about the rebound and again for that you

87:43

have to be very humble as a developer

87:44

because the robustness is the system

87:46

will never fail and it's like but what

87:47

if we got it wrong? Okay well we have to

87:49

admit things go outside

87:50

>> and then I guess for recovery on on how

87:52

you can recover this is where I mean if

87:54

you want to do it well teams that are

87:56

serious about this they they do uh

87:59

simulations of the system going down.

88:00

This is where Netflix is very famous

88:02

chaos monkey comes in where it goes and

88:04

shuts off parts of the system to like

88:05

test this live and there's drills that

88:08

are that are being being done on how we

88:10

how our on call process works how our

88:12

decision making etc etc. This is

88:13

actually a hard problem and then you you

88:15

did it once that's not enough because

88:17

you need to do it regularly because

88:18

system keeps changing.

88:19

>> I'd like to give a shout out to Uptime

88:20

Labs who are based here partly here in

88:22

London. They do excellent instant

88:24

training that you can do online in a web

88:25

browser. It's fantastic. Really great.

88:27

>> We'll add them to show notes below.

88:29

They're they're nice people. So you've

88:30

got that recovery process like how do we

88:32

get up and running. Uh and I think kind

88:35

of techies are up with me and then we go

88:37

into the next two which the third one is

88:39

graceful extensibility. And so graceful

88:42

extensibility

88:44

again it's a slightly weird name but

88:45

it's basically dealing with surprise.

88:46

When we make our system robust we're

88:48

dealing with the known no the known

88:51

problems.

88:51

>> Yeah. We know what to expect.

88:52

>> What about things we don't expect?

88:54

>> Mhm.

88:54

>> Right. If we don't expect it this is now

88:56

not about computers it's about humans.

88:58

This is why distributed systems are

88:59

fundamentally a socio technical system

89:01

as people and technology working

89:02

together. We couldn't expect the

89:03

rabbits. How do we deal with the

89:05

rabbits? How do we deal with the far in

89:07

the data center? Turns out badly is the

89:09

answer. But if you're in a a corporate

89:11

environment which is very command and

89:13

control, quite hierarchical, but you've

89:15

got a very narrow job description.

89:17

You're often constrained in what you're

89:19

able to do. Those organizations tend to

89:21

deal with surprise badly because the

89:24

corporate structure is structured around

89:25

the known. And so often structurally

89:29

you'll find that difficult. You

89:31

mentioned drills earlier. Drills are a

89:32

great way of helping with surprise.

89:34

Coming in and having people often from

89:36

outside saying this has happened. How

89:37

will you deal with it? Google had a

89:38

thing. I don't know if they still do it.

89:40

SR pop around. They do a thing called

89:41

the wheel of misfortune. They had a

89:43

physical wheel. Today your system has

89:44

suffer they spin the wheel.

89:47

DNS poisoning attack by a state in name

89:49

insert name of rogue state here. Here

89:51

here's what's happening. How do you deal

89:52

with it? um that is all about like

89:56

people and experiences and trying new

89:59

things and constantly pushing

90:01

yourselves.

90:01

>> I guess learning also from others. I

90:03

remember this like very famous outage

90:05

happened a few years ago at Meta where

90:07

their DNS system through BGP it it just

90:10

all went down WhatsApp Meta everything

90:13

to fix this because they they pushed out

90:15

an update to their BGP table which is uh

90:18

in inside DNS to their servers. Now to

90:20

fix this they needed to get access to

90:23

the computer that physically to get

90:25

access for whatever reason because they

90:27

couldn't reach it remotely. So they need

90:28

to go into the building. Now in going to

90:30

the building they had to go to a door

90:32

that protected this

90:34

system which was running on their own

90:36

domain which was down. So they had to

90:38

break physically into but but again this

90:40

is the thing where they shared the

90:42

details which was great because now

90:44

everyone else could think about like do

90:45

we have any of our physical security for

90:48

example tied to our own domain

90:50

>> because if you have it you want to

90:52

change that learning from what meta have

90:54

learned about

90:55

>> and this learn takes us from like grace

90:57

extensibility which is dealing with

90:58

surprise that's like sort of almost in

91:00

the moment are we ready to deal with the

91:01

surprise into the fourth one which is

91:03

sustain adaptability which is how can we

91:06

learn from what's happened not just the

91:08

learning. Do we have the environment in

91:10

which we can learn and share and grow

91:12

but then also adapt the system based on

91:14

that learning and it's called sustained

91:16

adaptability because it is that is a

91:18

completely continual process that's not

91:21

just today that's not just when you have

91:22

an incident that's when you don't have

91:24

an incident what are we doing to learn

91:26

and I think your point you raised there

91:27

was excellent which is I like reading

91:29

other people's incident reports there's

91:31

a little bit shard and fud with

91:32

companies I don't like but there's also

91:34

a little bit of it is like they've

91:36

learned something can I learn from them

91:39

and do something that that resolves my

91:41

system. So when you don't have an

91:42

incident, read other people instant

91:43

reports. There's a place called the

91:44

void. Uh it hasn't been updated for a

91:47

bit. There's a like hundreds and

91:48

hundreds of instant reports there is

91:50

worth going through. So that idea of

91:51

sustained adaptability is all about us

91:53

adapting and changing over longer time

91:56

scales. For those last two things,

91:58

sustained adaptability and graceful

92:00

extensibility, this all comes down to

92:02

people and culture. Like having proper

92:04

environment psychological safety is just

92:07

absolutely required. If you can't raise

92:10

issues, if you can't challenge in a safe

92:14

way, you do you will deal with surprise

92:16

badly because things won't get raised

92:17

and you won't learn because things will

92:18

be hidden.

92:19

>> Yeah.

92:19

>> And so that all comes down to behavior

92:22

stuff. And so the last sort of three

92:23

chapters of the book where you focus on

92:24

that is looking at some of the people

92:26

and the social aspects of that. So I've

92:28

got like 14 13 chapters well 12 chapters

92:30

sorry about the other technical and then

92:32

the last three chapters are all around

92:33

that side of things. So like what can we

92:36

do to make sure that we have that

92:37

environment of psychological safety

92:39

because without it you can't actually be

92:41

resilient.

92:41

>> That's it's pretty amazing because so

92:43

far throughout this whole conversation

92:46

we we talked about building resilient

92:48

systems. We talked a lot about people

92:50

about about how to think about

92:51

resiliency. One thing that we didn't

92:53

really talk about just passively is AI.

92:55

Even even though like this book is

92:57

coming out now and I know it has a a

93:00

section on AI as well but it's just

93:02

interesting to reflect that even though

93:03

like AI is changing how we're building

93:06

software it seems like some of these

93:08

ground truths of how to operate reliable

93:09

software are a little bit just outside

93:12

of this realm right

93:13

>> well I mean or is it

93:14

>> no it's not I mean firstly there's some

93:16

stuff there's some AI stuff in there

93:17

that can help um I detail quite a few

93:20

examples where around sort of

93:22

correlation analysis and you help

93:25

support around post instant. There's

93:26

some instant.io doing some amazing stuff

93:28

in this area. Yeah, this

93:29

>> saying we can use tools to to do a lot

93:32

bits bits and

93:32

>> but really there's more fundamental kind

93:34

of things here and the first thing is

93:35

the macro and the micro at the micro

93:36

level there's some useful stuff we can

93:38

do here um and I talk about in the book

93:40

the macro level is that that none of it

93:42

stacks up financially right so if you're

93:44

taking a longer view about resilience if

93:46

I'm building my product based on a

93:49

market sector that is fundamentally

93:52

flawed these companies don't have a

93:53

viable path to sustainability

93:56

>> when you say which companies are we

93:57

talking about

93:58

>> u Open AI and anthropic and the

94:00

hypervisors right conservative analysis

94:02

by the economists are showing that they

94:05

need to be generating 2.6 trillion in

94:08

revenue to justify their capex

94:10

expenditure by 2030. The entire software

94:12

market is 1.4 trillion. So macro level I

94:15

don't know how that gets sorted. I'm not

94:17

smart enough. I also don't have any

94:19

shares in those companies but you know

94:21

that's a separate conversation. I can't

94:22

solve that. What I can start thinking

94:24

about is okay if that's the world I'm

94:25

operating in. How do I deal with that? I

94:27

can't deal with all that. What I can do

94:29

if I'm taking a view to resiliency is

94:30

being very careful about how I use AI.

94:33

For example, you know, if I'm thinking

94:35

taking a longer view, being more

94:37

flexible about model choices, that's

94:40

going to help me because I've got the

94:41

opportunity to use openw weight models

94:42

from different vendors. even just basic

94:44

things like open AI and anthropic are

94:47

pretty terrible when it comes to

94:48

availability of their core models from

94:49

their services which is why everyone I

94:51

know also will use like they'll use

94:53

Google or Amazon or or Microsoft as

94:56

either their primary place they go to

94:58

those models their fallback so they have

94:59

better up times and things so there's

95:01

all that stuff we've got to deal with at

95:03

that level there's also the conversation

95:05

about nondeterminism and charity caught

95:08

me up on this a bit and I said the thing

95:09

is that you know we're going from

95:11

deterministic software to nondeterminism

95:13

you know that's a challenge for us. We

95:14

don't know how things work. And then she

95:16

said to me, "Our distributed systems

95:17

were never deterministic." And now

95:20

they're really not deterministic. And of

95:21

course, she's right because when we take

95:23

our distributed system and we add the

95:25

people in beyond the rabbits, right, and

95:28

the fires and the people, we always had

95:31

a degree of non-determinism. We're just

95:32

amping that up a bit. So I think that's

95:34

a continuation. So for me, I think it's

95:36

a confusing landscape. It's not good or

95:38

bad. I think at the micro level, there's

95:40

some really great things that we can do.

95:41

When we say macro level, that's the

95:43

tactical things that we can do, right?

95:44

>> I think really what I mean by that is

95:46

I'm taking the macroeconomic policy

95:48

situation out of it. I'm saying as a

95:49

developers, there's things that we can

95:50

make use of, right? There's some good

95:52

stuff in there that we can make use of,

95:53

but I also think there's some hedging we

95:55

need to do longer term. If you're

95:57

building AI into your product,

95:59

>> there's some simple hedging things. So,

96:01

being multi- vendor, being multimodel,

96:04

for example, breaking rather than having

96:06

a single agent, breaking that down into

96:09

more workflow models. Therefore, you can

96:11

take bits of your workflow and realize

96:13

actually this could now be swapped out

96:14

for a bit of deterministic code that I

96:15

write that could run more efficiently.

96:17

>> I think these are all sensible things

96:18

that you can do. We can't fix this.

96:20

>> Mhm.

96:21

>> We can at least deal with our world and

96:23

I think there's some sensible things

96:24

that we can do in that space.

96:26

>> What are the things that we know that we

96:28

do not know about AI?

96:30

>> I think the tech world in general is

96:33

quite naive about AI and fundamentally

96:37

misunderstands what an LLM is. Let's be

96:40

real. Like, why did the LLM delete my

96:43

database?

96:45

Well, because it has no concept of

96:46

causality.

96:48

That's what it comes down to. Has no

96:50

concept of causal. There's a glass here.

96:53

If I push that glass onto the floor,

96:56

you'll probably work out carpet down

96:57

there. If I ask you what's going to

96:59

happen, you said the glass is probably

97:00

going to be fine. If I push it onto that

97:01

floor, you're looking at saying that's a

97:02

hard floor

97:03

>> that might break. You're carrying out a

97:05

bunch of calculations in your head.

97:07

You've got an idea about the physical

97:08

properties of the universe. You've got a

97:09

sense if I push the glass this is going

97:11

to happen. LM don't do any of that. They

97:13

have no concept that if I do AB happens.

97:16

>> Yeah. Well, there there's push for world

97:18

models, but these LMS are not world

97:20

models.

97:20

>> They're not world models. And world

97:21

models have been around for a long time.

97:23

They arguably predate LLMs. They can do

97:26

stuff like that. So, they could make

97:27

decisions like if you had the

97:29

appropriate model and the appropriate

97:30

inputs, they can at least get to the

97:32

point of if I do X, I then Y happens and

97:34

I've been told not to do Y. This is why

97:36

all the guard rails around LM are really

97:38

not long-term going to be the right

97:40

solution. And so I think we expect LLMs

97:43

to do more than they can actually do

97:44

because they seem so smart.

97:45

>> Yeah.

97:46

>> And so I think that's the problem and

97:48

that leads us to overestimate their

97:52

capabilities

97:53

>> a bit too much I think

97:55

>> or maybe over rely on them without

97:57

knowing and we might have some incidents

97:58

later.

97:59

>> Absolutely. Absolutely. And I think with

98:01

knowing where and when to to kind of to

98:04

to to use those things and I think what

98:06

we don't know right now is where should

98:07

I be having and again this is wider

98:09

where should I have the LLM do it and

98:11

where should I just write some

98:12

deterministic code like there's a lot to

98:13

be said for just having your agent call

98:15

a script and you know that script works

98:18

rather than having it implement the

98:19

script in its magical brain for you.

98:21

>> Well there's something to be said that

98:23

it seems both labs both leading labs and

98:25

tropic and open air have realized that

98:28

coding is so important. So often times

98:31

when you ask the LM to do something it

98:33

will start to generate code because it

98:35

writes a deterministic program like

98:37

because that part will be deterministic.

98:39

It's very interesting when when you ask

98:41

it it will it will often just pump out a

98:42

Python or or TypeScript or or whatever

98:44

code especially when it when it has to

98:46

do with involving compare this or or

98:48

that and they have trained these models

98:50

to like default to to coding. I'm not

98:54

sure how that this came came but it

98:56

seems to be working to some extent. It's

98:58

also because it's very tractable, right?

99:00

I mean, you know, they are there to

99:01

generate plausible code. They're there

99:04

to generate plausible words, right?

99:06

>> And in the context of code, they've

99:08

generated some plausible code that we

99:10

can now validate. Does it execute?

99:11

>> Yeah.

99:12

>> And so that's a really nice tractable

99:14

aspect of it. And there are some places

99:16

where it works really, really well, but

99:18

there are other areas where it's

99:19

terrible. Like I when I wrote my book, I

99:22

used very little um AI at all.

99:24

>> Well, you didn't use it for the writing.

99:26

use it for

99:26

>> I don't use it for writing at all. I use

99:28

it for the research

99:30

but in the context of the researcher if

99:32

I use notebookm basically but in that

99:34

context it's plausible but then I just

99:35

go and click all the links it gives me

99:37

and I say was that there or not I am

99:39

checking the work it's done way more

99:41

work than I could have done going

99:42

through all those papers and god knows

99:44

there's only so many NIST papers you can

99:45

read through right but that in that

99:47

context I feel completely fine and able

99:50

to do that in other settings you're

99:52

getting now what's this problem called

99:54

cognitive surrender which is where

99:56

you're using AI to write documents that

99:58

you're never going to read. That's not

100:00

really around a problem with the LLM

100:03

technology. That's the problem with us.

100:05

>> Okay. Can we talk about this cognitive

100:07

surrender and cognitive depth?

100:09

>> Yeah. Cognitive debts are kind of term

100:11

that's been around for a while and that

100:12

sort of explains the erosion in our

100:15

ability to think critically and to

100:17

reason that can occur when we're using

100:20

AI tools. There's been a bunch of

100:21

research into this that's shown there's

100:23

been some studies that's shown that

100:24

people's ability to think critically is

100:27

impacted the more they use chat bots and

100:29

things and and I think we've sort of

100:31

seen other examples that Margaret Anto's

100:33

got a great um article all about this

100:34

and she's cited some some of the

100:36

research around it as well and that sort

100:38

of explaining that I mean her her thing

100:39

is you know she's talking we talk about

100:41

technical debt building up in a system

100:42

we have to be careful that our use of AI

100:44

it's that cognitive debt we need to have

100:46

a shared mental model of what this

100:48

system is supposed to do thinking about

100:50

it narrowly through the lens of a

100:51

program that we're building and if our

100:54

use of AI

100:56

as an example we all go off in different

100:57

directions that shared view breaks down

101:00

that becomes a co a debt cognitively.

101:03

>> Mhm.

101:04

>> Cognitive surrender is a bit of a

101:05

different thing which is like oh yeah

101:07

it's fine it's basically LGTM right

101:11

>> but but for whatever the AI tells me.

101:13

Yeah, LGCM was typical. Looks good to

101:15

me. Approving large pull requests where

101:18

you just couldn't be bothered or you

101:19

tried to look at it and for whatever

101:21

reason you didn't want to go through or

101:23

or it came from someone who you trusted.

101:26

>> I worked on the Google's tool team on

101:27

old stuff, right? And so LGTM was

101:29

literally something we pattern match on

101:31

and takes that as an approval.

101:32

>> Yeah.

101:32

>> So if you saw LGTM, that person's

101:34

approved, right? And it was just that

101:36

was where I think that may even have

101:37

been where the acronym originally came

101:38

from. I'm not sure but

101:38

>> I think it came from Google. Yeah.

101:40

>> Yeah. But but it is this idea that and

101:41

it's become shorthand for I didn't

101:43

really look at it.

101:44

>> Yeah.

101:44

>> And I think that's that's that cognitive

101:46

surrender thing is coming out in lots of

101:48

ways and you know we're getting AI to

101:50

write documents that no one's going to

101:52

read and we've got AI that's reading

101:55

documents that weren't written by other

101:57

people. And so the cognitive surrender

101:59

piece is really that the humans this

102:01

comes back to the human being in the

102:03

loop. There's very subtle differences in

102:06

those workflows and to the kinds of

102:08

differences it changes like there's

102:10

there's a big difference corrode talks

102:12

about it's a big difference like if

102:13

you're say a cancer an oncologist or as

102:15

a cancer specialist there's a big

102:17

difference to you as oncologist working

102:19

and an LLM doing sort of detection of

102:22

some of the scans that you're looking at

102:23

going oh you should look over there by

102:24

the way you might have missed that

102:26

that's actually quite useful right

102:28

versus the LLM powered AI going here's

102:31

all the scans I've looked through here's

102:32

the ones I need you to sign off, right?

102:34

The last one, the second one, right,

102:36

takes the expert out of the loop and

102:38

makes them an approver. And often in

102:40

that context, they've got rid of a bunch

102:42

of other oncologists. You've got one

102:44

person into the funnel, which that's

102:45

going to lead into issues, right? The

102:47

other model is we're making people

102:49

better. I think that's to come back to

102:50

that original idea of AI was from the

102:53

the pitch, right, was it was going to

102:55

free us from drudgery.

102:56

>> Yep.

102:56

>> Just like the industrial revolution was

102:58

going to free us from drudgery, but like

102:59

it would elevate us. We'd have less

103:01

toil. We can be this. we can focus more

103:03

on critical thinking and smarts and so

103:05

much of our current use of AI is not

103:08

freeing us up from critical thinking.

103:10

It's causing more context switching.

103:12

It's causing less time for thinking.

103:14

People are working longer hours. We've

103:16

got studies that show this. Now, that's

103:18

not necessarily AI's fault. It's just

103:20

how are we using it? It's like we just

103:22

need to address that a little bit. Can

103:23

we talk about complexity uh and AI maybe

103:27

adding it? I'm going to quote you from

103:28

about from a few months back. You wrote,

103:31

"I worry AI could just become an

103:33

exercise in doubling down on current

103:34

complexity rather than stripping things

103:36

back to simplify, at least in the

103:38

platform space."

103:39

>> Yeah, I can't remember the exact context

103:40

in which we had that conversation, but I

103:42

mean the platform space was all I mean

103:44

the platform space was kind of

103:45

interesting, right? Because that was an

103:47

attempt to make things simpler for

103:48

developers because

103:49

>> y

103:49

>> Kubernetes became popular and it's not

103:51

developer friendly. That's not what it's

103:52

designed for, right?

103:53

>> But most developers never have to touch

103:55

it.

103:55

>> No. I mean, well, if you have a

103:57

platform, if you don't have platform

103:59

Yeah. Yeah. there's a platform team

104:00

problem, right? And that's why they get

104:02

paid what they get paid. But and and so

104:03

I think there was this idea that I was

104:06

sort of hoping that there'll be a bit of

104:07

a complexity collapse around that space.

104:09

I had this hope for things like WSGI,

104:12

for example, simplifying down those

104:14

programming models a little bit. Um, and

104:16

I think there was starting to be a bit

104:17

of a a bit of a conversation starting to

104:19

be had about some of that stuff going

104:21

on. What then happens, of course, is

104:22

AI's come out and everyone's like, I've

104:24

got to AI all the things. And so rather

104:27

than thinking about what we need and

104:28

trying to strip that complexity back,

104:30

we've now just got another piece that

104:31

requires us still have all the old

104:33

complexity but adding new complexity on

104:36

top and somebody's got to look after all

104:39

that stuff. Yeah, but I think it goes

104:40

back to a little bit of like we seems to

104:42

have more work with AI and probably it

104:44

doesn't help that it can add more

104:45

complexity especially when we're not

104:48

being clear of what we want when we're

104:50

not being critical of the output when we

104:52

have cognitive depth or cognitive

104:54

surrender especially not with cognitive

104:55

center you know just right so it these

104:58

things might be amplifying the fact that

104:59

it's just more work more complexity

105:01

right

105:02

>> yeah and I think there's also that

105:03

connection through to what the AI is

105:05

doing is comes full circle a little bit

105:07

which is the idea of potential you're

105:09

not looking at the code isn't to say

105:11

that you don't care about what the

105:12

system is that you're building is to say

105:15

that you've got a better way of

105:16

understanding what you're building. So

105:18

one of the concerns is if I'm using AI

105:20

to create code is going to create awful

105:22

loads of debt and a complicated system

105:24

no one's going to understand or we can't

105:26

let that happen. We still need to remain

105:28

connected to the system that we're

105:30

building, which is what I'm a big fan of

105:32

like modularizing system. Whether or not

105:34

you put those modules in different

105:35

computers, I don't actually care.

105:37

Getting AI to work within the modules,

105:39

having the humans think carefully about

105:41

what those modules are and the

105:42

connections between them. Let the AI go

105:44

hog wild inside those boundaries that

105:46

are easy to change, the gaps between

105:49

them. That's where the human beings

105:50

spend to think about the mental model of

105:53

how things fits and slots together. Mhm.

105:55

>> Um that feels a very sane way for us to

105:58

balance our time and our energies

106:00

appropriately.

106:01

>> So do I understand correctly that you're

106:02

saying that? That's probably a sensible

106:04

approach is have the architecture in

106:06

your head. Know how your system works.

106:08

Know how the boxes work. Know where

106:10

there's AI inside it. Maybe it's

106:12

generating code. Maybe it's running your

106:14

incident response in in isolated ways.

106:17

And then spend your time talking with

106:19

other people in the business on your

106:21

team with your customers because you're

106:24

you know as you said systems like

106:26

software is is people's ideas connected

106:28

and you have things in in your head or

106:30

you write it down but now you're using

106:32

it as an AI as a tool to enable you to

106:34

maybe take on larger chunks of the

106:36

business and maybe make better decisions

106:37

because maybe you have more time to as

106:40

as an engineer understand more on the

106:42

business on what is working what is

106:44

important those kind of things.

106:45

>> Yeah. And also to make the structure and

106:48

the model a bit more explicit as well. I

106:51

>> mean that's one thing a good modular

106:52

structure does. I mean this is why

106:53

Shopify have been so successful keeping

106:55

their thing as a monolith, right? It's

106:56

because they spend a lot of time

106:58

building their monolithic application as

106:59

a modular domain driven architecture,

107:01

right? Because it makes the structure

107:03

easier to understand. You can zoom out

107:05

and see how those things fit together.

107:08

But also in the short term while we're

107:10

having these debates about are we going

107:12

full software full software factory or

107:14

not we don't have to make a

107:16

one-sizefits-all approach. We can say

107:18

look this is our architecture be it a

107:20

modular monolith or a microser archite

107:22

doesn't really matter and over here this

107:23

area here is where we're trying a full

107:25

software factory approach where we don't

107:27

look at the code anymore but we specify

107:29

the interface we have verification

107:32

around that we know what good looks like

107:33

for that module right we've got

107:35

functional tests tests that look at say

107:37

some of the operational requirements as

107:39

well uh these areas over here we're

107:41

still wrappling these are really key and

107:43

really important to us we're not ready

107:44

to give up on those yet because we don't

107:46

have the trust level yet. We don't want

107:47

to take that risk just yet. And so over

107:50

here, we're going to work with the AI

107:53

more of a collaborative way while we

107:55

work together and we're still going to

107:56

be intimately involved with the code

107:57

because we're not ready to make that

107:58

step here. But if we approach our whole

107:59

system as one big black box, then we're

108:01

forced into making one or either

108:03

decision. I don't think that's healthy.

108:04

>> Do I understand currently that you're

108:05

you're saying that you think that the

108:08

software factory a dark factory, you

108:10

giving it a spec or or and then the AI

108:12

either building it or operating it that

108:14

that you you see that as viable? There

108:16

are some companies I know that are

108:17

already all in on this. Not everyone

108:18

should be doing it whatsoever. I think

108:21

if that is our future, if that is our

108:23

future and I think there's a lot of ifs

108:25

there. The question is about how you go

108:27

about adopting and trying. So what I'm

108:28

trying to do is find ways in which we

108:30

can lower the barrier to entry to try

108:31

these ideas out in a safe way

108:33

>> and like lowrisk environments and and

108:35

maybe simpler domains, those kind of

108:37

things, right? But also like a lot of

108:38

dark factories don't create finished

108:40

products. Like real world beyond the

108:43

fact that real world dark factories

108:44

there aren't many of them. Most of them

108:46

create components. They don't create the

108:48

finished product.

108:49

>> Yeah. So in the same way if you think

108:51

about a module being a piece of the

108:54

overarching system like well let's have

108:57

a factory run these bits here and

109:00

actually looking at it like if we had to

109:01

rewrite that from scratch it might take

109:03

us like with a collaborative way with AI

109:06

it might take us a few weeks to have to

109:07

rewrite that if we had to so actually

109:09

we're quite relaxed about leaving that

109:11

to go as is and it's been working fine

109:12

and it's a it's a module around which

109:14

we've got great test coverage already

109:15

for example where it's not on the

109:17

critical path from a latency point of

109:19

view or it's service where we've got

109:20

really good observability data and

109:22

really well definfined SLOs's and we've

109:24

got good steady state or we can start

109:26

running it as a factory now and seeing

109:28

what's happening in production we can

109:30

have a look at the SLOs's we maybe add

109:31

some special SLOs's around it I'm

109:33

hearing correctly that you're saying

109:34

that as a as a professional as someone

109:36

who wants to be up to date with the new

109:41

techniques that we can use it's probably

109:43

if you have the opportunity to start to

109:45

build a software factory a somewhat

109:47

autonomous place in a in a component in

109:49

something lowrisisk. It's probably worth

109:51

trying it out to see how it works to see

109:53

what you learn to see if it even works

109:54

or where it breaks down,

109:56

>> but do it in a way where you're you're

109:58

minimizing the blaster radius a little

109:59

bit like when you know when

110:00

microservices came out the concept you

110:03

didn't start by moving your biggest

110:04

thing. You started to build a small

110:06

service that didn't really matter all

110:07

that much and you were okay to learn

110:09

from it when it goes down and it wasn't

110:11

on the on the hot path for the business.

110:13

>> Yeah, I think the thing to start off

110:14

with was is getting your head around

110:15

spec. So looking into spectrum

110:17

development whether that's Kuro or

110:19

Tessle or Spec Kit whatever that is I

110:21

mean they're all slightly different have

110:23

a look at Briget's article on that as a

110:24

good on ramp to get ahead of it. Start

110:26

off by playing around with that because

110:28

that's the stepping stone that's like

110:29

you have to define what good looks like

110:31

as an input to your factory.

110:32

>> Yeah.

110:33

>> Start with the spec.

110:34

>> Good look input and also for the output.

110:36

>> Yes. And then it's like how you verify.

110:38

How are you going to go about verifying

110:39

the output from the factory? Have a

110:41

think about that. And you know like not

110:43

just in terms of the the kind of normal

110:45

sort of behavioral aspects of it but

110:48

like I'm with I'm agree with Kevin Hy on

110:50

this. He says he hates non-functional

110:51

requirements because if a functional if

110:53

something is nonfunctional it means it

110:55

doesn't work. So he breaks the world

110:56

down into like development requirements

110:59

um operational requirements and sort of

111:00

business requirements. So I think it's a

111:02

nice way of doing that. So along those

111:03

three axes

111:05

how do I verify that the software being

111:07

created by this module is has matches my

111:09

developer requirements. So for say

111:11

maintainability, my operational

111:13

requirements, latency, uptime, and my

111:15

business requirement, is it working?

111:18

Features working. As long as long as

111:19

you've got a way of validating

111:22

your your software around that. And if

111:23

you don't know what the good looks like

111:25

for those three things, guess what? This

111:26

isn't for you.

111:27

>> But you can still do specs, by the way.

111:29

But you can't do a factory.

111:30

>> Yeah.

111:30

>> But you can do specs. And that's you're

111:32

edging and

111:34

>> your way there. And I think it might not

111:36

work. This there may be some there may

111:38

well be some blind alley. could be model

111:40

driven development all over again which

111:43

we do not have time to get into because

111:44

I get very angry about it but it could

111:46

be that but I have a hope it might

111:49

actually work this time unlike MDM and

111:53

then as closing we I think a lot of what

111:55

we talked about is it's important to

111:58

hold the architecture in your head to

111:59

think about the architecture to think

112:01

how to modularize now for engineers who

112:03

want to get better at this kind of

112:04

highle thinking strategic thinking

112:06

architectural thinking outside of

112:08

reading your book which I think brings a

112:10

lot of really good ideas on architecture

112:12

as well and not just resilient system

112:13

but outside of that what would your

112:15

recommendation be for a for a tech

112:16

professional for an engineer who's like

112:18

I'd like to get better at architecting

112:21

systems to know know what good looks

112:23

like I I think there's a few books I can

112:26

point people at I think the um software

112:28

architecture fundamentals by Neil Ford

112:30

and Mark Richards is a good read just to

112:32

be clear they're friends of mine so I'm

112:34

not unbiased in recommending it I would

112:36

say around the modularity Vlad Colongh's

112:39

book on balanced coupling is fantastic

112:42

and it's his book on DDD is also very

112:44

good but that that balanced coupling

112:46

book is really great he's also develop

112:47

some skills and claude to take some of

112:49

those ideas so definitely definitely

112:51

take a look at those I think if you're

112:52

looking at things architecture you think

112:53

in terms of modules for me I I don't

112:55

agree with everything in Mark Neil's

112:56

book there's lots of great stuff in

112:58

there but for me actually all starts I

112:59

sort of mentioned earlier that writing

113:01

the second edition of building

113:02

microservices was really all about

113:03

smuggling in getting people thinking

113:05

about thing called information hiding

113:06

it's a very old idea from 1970s

113:09

>> still comes back there to me. Modules

113:10

are still the whole thing for me. So I

113:12

would read Vlad's book and if you want

113:14

to go read the original Parnass papers

113:15

from 1971 1972 they're still worth

113:18

reading but those would be good jumping

113:20

off points. I would say you can still I

113:22

think the nice thing about thinking in

113:23

terms of modules is even within an

113:25

existing code base you can start to

113:27

modularize it in some small ways. You

113:30

can start to think about boundaries you

113:32

can think about clear separation about

113:34

using encapsulation as a way of

113:35

information hiding. And I I guess it's

113:37

fair to say like look if you have an

113:38

idea on how you can make your existing

113:41

codebase a bit more modular, you have

113:42

zero excuse not to do it. I mean we

113:44

don't trust agents fully but this is a

113:46

textbook example of like if you can say

113:48

here's my goal refactor this like if it

113:51

would have taken by hand x amount of

113:53

time it it will be faster. So, so you

113:55

you should be empowered to at least

113:58

experiment with these, right?

113:59

>> Especially if you've got a decent test

114:01

suite

114:01

>> and if not start with that.

114:02

>> Start start with that. If you've got

114:04

statically typed language, you don't

114:05

even need to just a good oldfashioned

114:07

IDE does an amazing job, right?

114:09

Dynamically type language now don't have

114:11

the excuse, especially if it's a modern

114:12

one that's well understood by the LM.

114:13

So, if you're using, you know, Python or

114:15

Ruby, it's so much better now than it

114:16

used to be for refractionist code bases.

114:18

Absolutely. You need to get the test

114:19

suite in around that. But yeah, you can

114:21

start modernizing and that's about

114:23

building and that's also a little bit

114:25

coming back again to taking we don't

114:27

want the architecture only in your head,

114:29

right? We want the the code to sort of

114:34

represent that mental model.

114:35

>> Yep.

114:36

>> Because we communicate through the code

114:38

and maybe in the future be communicating

114:39

through the specs. And when you make

114:42

those things more explicit then I think

114:45

that helps everyone stay on the same

114:46

page. There's uh George Fairbanks wrote

114:48

a book. I've forgotten the name of the

114:49

book now, but in it he has a pattern

114:51

called an architecturally evident coding

114:53

style and that we should code in such a

114:56

way that it clearly communicates the

114:58

architecture of the system and I think

115:01

our programming languages are quite bad

115:03

at having a good concept of modules in

115:05

general. So I think we have to go a bit

115:07

above and beyond ourselves but we could

115:10

do more to make the architecture of our

115:12

systems that little bit more explicit.

115:13

This is also why I like spending time

115:14

production because especially if your

115:16

modular structure ends up being a

115:17

process structure. In other words, it's

115:20

process boundaries. I can go look at the

115:22

networks to find out my architecture. I

115:24

shouldn't have to, but at least you know

115:26

I know production is truth. It's like

115:28

football is life, production is truth.

115:30

>> So, where can people get your book?

115:33

>> You can go and order it now. Um, if you

115:35

can go and buy it from a local bookshop,

115:36

that's always a great idea. Uh, it's

115:38

also going to be available for people on

115:40

the Rider platform in in sort of digital

115:42

form. you can go and read it as part if

115:44

you're a subscriber over you can get it

115:45

there as well but lots of people love

115:47

having the physical copy

115:48

>> and we have we have these in the show

115:50

notes below so check them out to get the

115:51

book directly and also you've been doing

115:53

some videos right

115:55

>> yeah well so I've been doing some stuff

115:56

on Dave Farley's modern software

115:58

engineering channel it's a kind of a

115:59

good excuse to uh do some sort of semi-

116:03

ranty you know monologues to video and

116:05

have some fun chats so yeah go for the

116:06

modern software engineering channel on

116:08

YouTube and you can find videos from me

116:10

and Dave Farley and Kevin Henny's is

116:12

there. We've got stuff from Kent, Trisha

116:14

G, Emily Borch, Dan North is there as

116:17

well. I'm pretty sure I've forgotten

116:19

somebody else. There's almost a couple

116:21

other people there as well, but we we

116:22

try and put videos out once a week and

116:23

it's a bit of fun place to

116:24

>> pen. We're also linking that one.

116:26

>> Yeah.

116:26

>> And if people would would want to work

116:28

with you, where can they find you? How

116:30

can they find you? What kind of what

116:31

kind of stuff can they get help from you

116:33

for?

116:34

>> But I do like internal talks with people

116:36

like internal events. I do like

116:37

customized training courses on a whole

116:38

variety of things around resilient

116:40

systems and security and microservices.

116:42

I also do a lot of consulting for

116:43

clients, helping them around sort of

116:44

rearchitecting their systems and stuff

116:46

like that. If you want to know more

116:47

about that, actually go to my website,

116:49

samnewman.io, and then you can contact

116:52

me there. You can also find me on

116:54

LinkedIn, but if you come straight to

116:55

the website, use email. I'm still a bit

116:57

old-fashioned like that. And I work with

116:59

clients all over the world, so um if I'm

117:01

able to help, yeah, head over to

117:02

samnewman.io. My contact details are

117:04

there.

117:04

>> Wonderful. Well, Sam, thanks again. This

117:07

was great.

117:07

>> Thank you. Thanks very much to Sam for

117:09

this conversation. I really like Sam's

117:11

three rules of distributed systems. One,

117:14

it takes time. Two, sometimes the thing

117:16

you want to talk to isn't there. Three,

117:19

resource pools are not infinite. Sam

117:21

said how most of the outages happen

117:23

because of this last one. Resource pools

117:25

not being infinite and services are

117:27

getting saturated. But I was chuckling

117:29

when he was talking about rabbits steing

117:31

through networking cables between office

117:33

buildings. Then again, a few weeks ago,

117:35

with thousands of flights stranded on

117:37

the east coast of the US, it was because

117:38

workers accidentally cut a telephone

117:40

cable in New Jersey used by the FAA.

117:42

Another food for thought from Sam is how

117:44

failure should be handled differently

117:46

depending on the type of business. An

117:48

e-commerce shop might decide to show you

117:49

the item when the inventory service is

117:51

down. Worst case, after you order and

117:53

pay, they just refund you cuz we're

117:55

like, "Oh, we don't have the item."

117:57

Basically, failing open is fine in this

117:58

case. But on a concert ticketing

118:00

website, you don't want to sell a ticket

118:02

that might or might not be there. And so

118:05

failing close is the right call to make

118:07

cuz again, as we discussed in the

118:09

episode, if you sell the ticket, people

118:10

might book flights, they might get

118:12

upset, you might lose them as customers.

118:14

Finally, I appreciated how level-headed,

118:16

perhaps even cautious Sam is about AI.

118:19

He's got no doubts that AI is very

118:20

useful at the micro level, basically at

118:22

tactical, at things that we can already

118:24

improve. But he is worried about the

118:26

economics of the model providers. His

118:28

suggestion is pretty pragmatic. Hedge

118:30

your vendors and your models. Be

118:32

multi-endor and multi-tool and wherever

118:34

you can swap non-deterministic AI agent

118:36

workflows to deterministic ones.

118:38

Basically have LLMs generate

118:40

deterministic code which I find very

118:42

very refreshing thinking. Check the show

118:45

notes below for the story about scaling

118:47

Uber in the early days with Uber's first

118:48

CTO Tuan Palm that we discussed and it's

118:51

an awesome story. And for more the

118:52

pragmatic engineer deep dives on

118:54

resilient systems. If you enjoy this

118:56

show, do subscribe to your favorite

118:57

podcast player. And thank you very much

118:59

if you recommend the podcast to your

119:01

friends or your colleagues.

Interactive Summary

In this episode, Sam Newman, a recognized expert in resilient distributed systems and author of the landmark book on microservices, explores the architectural challenges of modern software. Sam discusses why microservices are an 'architecture of last resort,' emphasizing that organizational autonomy, not just technical trends, should drive such decisions. He outlines three fundamental rules for distributed systems: information does not travel instantaneously, components can be unavailable, and resources are finite. The conversation also covers the necessity of observability, the importance of defining 'what good looks like' for resilient systems, and the shift toward higher-level abstractions as we integrate AI. Sam advocates for a balanced approach to AI—using it for tactical improvements and deterministic code generation while cautioning against 'cognitive surrender' and highlighting the importance of maintainable, modular software architectures.

Suggested questions

4 ready-made prompts