1
00:00:00,120 --> 00:00:02,400
This episode is brought to you 
by Beam OPS. 

2
00:00:02,560 --> 00:00:05,680
If your Elixir deployments are 
painful, or your infrastructure 

3
00:00:05,680 --> 00:00:08,119
is a mess, or you just need 
experience hands to help you 

4
00:00:08,119 --> 00:00:12,040
scale, these are your people. 
Beam OPS specializes in scalable

5
00:00:12,040 --> 00:00:14,960
Elixir development, automated 
deployment pipelines, and 

6
00:00:14,960 --> 00:00:18,160
infrastructure migrations. 
They will help you work smarter 

7
00:00:18,200 --> 00:00:21,680
and ship faster. 
As authors of the Pragprog book 

8
00:00:21,720 --> 00:00:24,680
Engineering Elixir Applications,
they know their stuff. 

9
00:00:24,880 --> 00:00:30,760
Check them out at beamops.co.uk.
Secure your Elixir apps with 

10
00:00:30,760 --> 00:00:33,480
paraxial IO. 
From code analysis and bot 

11
00:00:33,480 --> 00:00:36,080
defense to dependency checks, 
they've got you covered. 

12
00:00:36,240 --> 00:00:39,040
Elixir first design with GitHub 
integration. 

13
00:00:39,160 --> 00:00:46,440
Elevate your security at 
paraxial dot IO testing. 

14
00:00:50,200 --> 00:00:52,400
What's up? 
I'm Jacob Litzow, your Elixir 

15
00:00:52,400 --> 00:00:55,080
mentor and welcome to another 
exciting episode of the Elixir 

16
00:00:55,080 --> 00:00:57,040
Mentor Podcast. 
This is where we discuss 

17
00:00:57,040 --> 00:00:59,240
everything related to Elixir, 
from interviews with 

18
00:00:59,240 --> 00:01:02,400
enthusiasts, pioneers in the 
community to innovative projects

19
00:01:02,440 --> 00:01:04,519
and library shaping Elixir's 
future. 

20
00:01:04,920 --> 00:01:08,040
Today I'm joined with a 
collect's colleague, actually 

21
00:01:08,040 --> 00:01:11,120
Jason, to dig into a couple of 
his projects. 

22
00:01:11,120 --> 00:01:13,920
And I'm sure we'll ramble on 
with a bunch of other random 

23
00:01:13,920 --> 00:01:19,200
things, but Bedrock and beadwork
are some exciting things. 

24
00:01:19,200 --> 00:01:22,240
So welcome. 
Welcome to the show, Jason. 

25
00:01:23,360 --> 00:01:27,960
Thanks for having me on bud. 
I guess like for people that 

26
00:01:27,960 --> 00:01:30,760
don't know you, do you want to 
just give us like a quick 

27
00:01:30,760 --> 00:01:33,560
background to like where you 
came from, what got you into 

28
00:01:33,560 --> 00:01:36,440
programming and like kind of 
like the start of your career? 

29
00:01:37,720 --> 00:01:42,240
Sure. 
So I've been a nerd doing this 

30
00:01:42,240 --> 00:01:45,400
stuff for just about 40 years 
now. 

31
00:01:45,400 --> 00:01:50,080
Now that I think about it, I got
my first machine when I was 8 or

32
00:01:50,080 --> 00:01:52,280
9. 
My dad fixed or repaired 

33
00:01:52,280 --> 00:01:56,000
computers for the military and 
so he always had parts and stuff

34
00:01:56,000 --> 00:01:58,880
laying around. 
And we cobbled together a 

35
00:01:59,120 --> 00:02:02,760
Frankenstein machine from parts 
at the time. 

36
00:02:02,800 --> 00:02:04,800
And it was, it was really 
deluxe. 

37
00:02:04,800 --> 00:02:09,520
It had 512K memory. 
Every time you turned it on, you

38
00:02:09,520 --> 00:02:12,640
had to set the clock, right. 
So because it didn't have a 

39
00:02:12,640 --> 00:02:15,160
battery, this was old stuff, 
right? 

40
00:02:15,320 --> 00:02:17,520
And had floppy disks. 
And if you you know, punched a 

41
00:02:17,520 --> 00:02:21,120
hole you could double sided. 
The power button actually killed

42
00:02:21,120 --> 00:02:25,200
the power supply back then. 
Oh, yeah, no, no, it was legit. 

43
00:02:25,200 --> 00:02:28,160
And then and then later on I got
one with like a turbo button 

44
00:02:28,160 --> 00:02:30,000
that like just changed the clock
frequency. 

45
00:02:30,000 --> 00:02:32,400
Like it just made it go. 
It literally made it go faster. 

46
00:02:33,000 --> 00:02:37,200
And there were games that broke 
because, you know, it just they 

47
00:02:38,200 --> 00:02:39,920
had like timing loops and things
like that. 

48
00:02:39,920 --> 00:02:41,840
So anyway, it was the dark old 
days. 

49
00:02:41,840 --> 00:02:43,800
So I've been writing software 
for a long time. 

50
00:02:44,560 --> 00:02:47,400
Badly at first, right? 
And then after you've been doing

51
00:02:47,400 --> 00:02:51,120
anything for a while, you get a 
little better at it, I started. 

52
00:02:51,480 --> 00:02:56,480
Work, I know. 
Dude, there's not a you're not 

53
00:02:56,480 --> 00:02:59,040
doing, you're not improving as a
person if you don't look back at

54
00:02:59,040 --> 00:03:01,040
the stuff you did six months ago
and cringe a little bit. 

55
00:03:01,320 --> 00:03:03,320
I mean, it's just the way it is,
right? 

56
00:03:03,320 --> 00:03:08,440
So, so about 16, I moved out the
house and got a job right in 

57
00:03:08,440 --> 00:03:12,480
software, kind of quit school on
a Friday and had a job the 

58
00:03:12,480 --> 00:03:17,000
following Monday building things
for machine control. 

59
00:03:17,680 --> 00:03:19,720
And I had imposter syndrome for 
the longest time. 

60
00:03:19,840 --> 00:03:22,000
You know, I just, I couldn't. 
Here I am in a room full of 

61
00:03:22,000 --> 00:03:28,440
people working and they're, you 
know, these old people who had 

62
00:03:28,440 --> 00:03:30,760
degrees and all stuff. 
I'm just some dumb kid. 

63
00:03:31,600 --> 00:03:35,320
And I realized after a while 
that like all the books that 

64
00:03:35,320 --> 00:03:39,480
they had and books for the thing
I, I was reading them and people

65
00:03:39,480 --> 00:03:41,000
coming to me and starting to ask
questions. 

66
00:03:41,000 --> 00:03:44,160
And so I slowly dawned on me 
over the course of working with 

67
00:03:44,160 --> 00:03:47,160
some of these folks that like I 
was actually not maybe not 

68
00:03:47,160 --> 00:03:49,760
terrible completely at this. 
And this is something I could 

69
00:03:49,760 --> 00:03:53,040
do. 
So spent some years doing that, 

70
00:03:53,240 --> 00:03:58,120
moved through contracting 
various jobs, so many messes, 

71
00:03:58,880 --> 00:04:01,560
different companies, different 
places, all kinds of different 

72
00:04:01,560 --> 00:04:05,240
tech. 
I remember the web when it was 

73
00:04:05,240 --> 00:04:10,560
CGI bin and there's a little 
compilable, you know, little 

74
00:04:10,560 --> 00:04:13,160
programs and had Pearl and all 
kinds of fun stuff to do Web. 

75
00:04:13,160 --> 00:04:14,560
It's it's it's come such a long 
ways. 

76
00:04:14,600 --> 00:04:18,880
It was so dark. 
I only remember hacking my way 

77
00:04:18,880 --> 00:04:23,360
through really ghetto HTML sites
with like no CS. 

78
00:04:23,360 --> 00:04:27,600
And write a passage well and, 
and, you know, having things 

79
00:04:27,600 --> 00:04:31,120
that suck like, you know, like 
tools that suck and machines 

80
00:04:31,120 --> 00:04:34,240
that suck and are slow. 
They really, it teaches you how 

81
00:04:34,240 --> 00:04:37,880
to, I mean, if you want to get 
anything good out of them, you 

82
00:04:37,880 --> 00:04:41,160
know, you have to work at it. 
You have to think about it and 

83
00:04:41,160 --> 00:04:44,160
you have to try and be clever or
borrow cleverness from other 

84
00:04:44,160 --> 00:04:46,280
smart people. 
Yeah, You know, I was just 

85
00:04:46,280 --> 00:04:48,760
talking about that with a like a
previous guest. 

86
00:04:48,760 --> 00:04:51,760
You almost have to just do 
embedded software, embedded 

87
00:04:51,760 --> 00:04:54,720
device stuff now for that 
because you need the limited 

88
00:04:54,720 --> 00:04:58,240
resources to become a better 
like programmer architect. 

89
00:04:59,840 --> 00:05:01,760
Well, it's true. 
So like I was a kid and I was 

90
00:05:01,760 --> 00:05:05,640
into mischief, right. 
And you know, phones and and you

91
00:05:05,640 --> 00:05:07,760
know, modems and all that stuff 
was big back in the day. 

92
00:05:07,760 --> 00:05:10,040
This is like pre Internet 
adoption. 

93
00:05:10,560 --> 00:05:15,640
And so you could literally just 
call around numbers and hit a 

94
00:05:15,640 --> 00:05:18,760
modem and it'd be like open and 
then you'd get a prompt and then

95
00:05:18,760 --> 00:05:22,480
you could start doing things. 
And there were, early on, there 

96
00:05:22,480 --> 00:05:25,120
were banks and all kinds of 
weird things that were just 

97
00:05:25,560 --> 00:05:29,280
open, right, people just so you 
build a piece of software that 

98
00:05:29,280 --> 00:05:33,040
would literally just go dial 
phone numbers, right? 

99
00:05:33,040 --> 00:05:35,840
And then when it got something 
that was they could recognize, 

100
00:05:35,840 --> 00:05:38,160
it would just put that on a list
and then you'd go back and check

101
00:05:38,160 --> 00:05:40,160
it out. 
Did I remember that this thing 

102
00:05:40,840 --> 00:05:43,800
when I was in middle school, my 
buddy and I would hang out in at

103
00:05:43,800 --> 00:05:48,080
the library computer lab all the
time and we discovered that 

104
00:05:48,520 --> 00:05:50,920
there was no security on the 
school network. 

105
00:05:50,920 --> 00:05:54,200
We could go into all the 
teachers computers and we could 

106
00:05:54,240 --> 00:05:57,000
change. 
We could change grades and we 

107
00:05:57,000 --> 00:06:00,480
were like, we were pissed 
because both of us had really 

108
00:06:00,480 --> 00:06:02,440
good grades and we didn't have 
to change ours. 

109
00:06:02,840 --> 00:06:05,000
And we're like, well, what are 
we going to do with all this 

110
00:06:05,000 --> 00:06:06,960
power? 
So we changed to Buddy's grades,

111
00:06:06,960 --> 00:06:10,840
who was not doing well. 
Yeah. 

112
00:06:10,840 --> 00:06:12,440
Did you get like 50 bucks or 
something? 

113
00:06:12,440 --> 00:06:14,000
Because that's the way that's 
right. 

114
00:06:14,920 --> 00:06:18,880
Like hey bro we can jump you up 
from this D to well we'll do AB 

115
00:06:18,960 --> 00:06:22,360
minus we can't be unrealistic. 
Right. 

116
00:06:22,400 --> 00:06:24,360
And so, so The thing is, you 
know, you have these 

117
00:06:24,360 --> 00:06:28,360
limitations, stuff that kind of 
forces you to get better about 

118
00:06:28,360 --> 00:06:30,400
things. 
And so grew up with a lot of 

119
00:06:30,400 --> 00:06:32,800
that and you know, as computers 
were getting better and better, 

120
00:06:33,080 --> 00:06:36,000
I mean, it's crazy what you 
carry around in your pocket now.

121
00:06:36,120 --> 00:06:39,800
I mean, compared to the things I
played with when I was a kid. 

122
00:06:40,520 --> 00:06:43,000
And so, you know, there's, 
there's different waves. 

123
00:06:43,000 --> 00:06:45,960
You see the things rhyme. 
You know, you get the, the, the 

124
00:06:46,160 --> 00:06:49,680
original web wave, then you see 
the mobile wave and then you 

125
00:06:49,680 --> 00:06:53,480
ride the, the, the, you know, 
the other waves, the software as

126
00:06:53,480 --> 00:06:56,640
a service wave, the whole, you 
know, now we're into AI, which 

127
00:06:56,640 --> 00:06:59,280
is a lot of fun. 
But every place you go, there's 

128
00:06:59,280 --> 00:07:00,800
stuff to do in different 
problems. 

129
00:07:00,800 --> 00:07:03,120
And you, you pick up things 
from, from, from the folks you, 

130
00:07:03,160 --> 00:07:05,880
you bump into. 
And so I've been doing this for 

131
00:07:05,880 --> 00:07:09,040
a while now and there's, you 
know, you see a lot of things 

132
00:07:09,040 --> 00:07:13,760
that rhyme, you know, so you see
things that happen over and over

133
00:07:13,760 --> 00:07:18,120
again, which is kind of fun, but
lots of different places. 

134
00:07:18,960 --> 00:07:23,080
I mean it's like the the 
amazingness of like the BEAM or 

135
00:07:23,080 --> 00:07:28,440
Erlang too, Like the problems 
they solved back in the 80s are 

136
00:07:29,440 --> 00:07:33,320
recurring problems now with AI 
and agents and processes, 

137
00:07:33,320 --> 00:07:36,080
whatever you might need. 
Right. 

138
00:07:36,080 --> 00:07:38,480
You see, I mean, I mean the beam
is, I mean to refresh people's 

139
00:07:38,480 --> 00:07:41,360
memory, it's like almost 40 
years old, like it's been around

140
00:07:41,360 --> 00:07:44,320
for a hot minute. 
And so you have these things 

141
00:07:44,320 --> 00:07:47,640
where like the, the 
underpinnings of it, some of the

142
00:07:47,640 --> 00:07:49,400
stuff has changed underneath, 
right. 

143
00:07:49,400 --> 00:07:53,560
But the basic way that it works 
is fairly fairly, you know, 

144
00:07:53,640 --> 00:07:55,840
locked in. 
And you have these, this idea 

145
00:07:55,840 --> 00:08:00,000
where you have small processes, 
you have, you know, not shared 

146
00:08:00,000 --> 00:08:01,320
memory. 
So they can do whatever they 

147
00:08:01,320 --> 00:08:03,320
want with their little, their 
little corner of the universe. 

148
00:08:03,560 --> 00:08:06,600
And then they trade things with 
messages like this has become a,

149
00:08:06,800 --> 00:08:10,320
a, a really powerful pattern. 
And it works well for all kinds 

150
00:08:10,320 --> 00:08:13,320
of the more modern problems, not
just dealing with telephone 

151
00:08:13,320 --> 00:08:16,640
switches or whatever it was that
they built it for originally. 

152
00:08:16,800 --> 00:08:20,360
So, yeah, I know it's, it's, 
it's, it's a really kind of 

153
00:08:20,360 --> 00:08:22,600
interesting model. 
I mean, you see different, it's 

154
00:08:22,920 --> 00:08:24,880
one of the things I like about 
different languages and things 

155
00:08:24,880 --> 00:08:27,440
is you can try on a different 
headspace, right? 

156
00:08:27,440 --> 00:08:30,400
Like there's a different way of 
thinking that goes with each one

157
00:08:30,400 --> 00:08:33,480
of these things. 
You get the beam and there's a 

158
00:08:33,559 --> 00:08:35,559
certain way of thinking that 
goes along with it. 

159
00:08:35,840 --> 00:08:39,960
You got Go or Rust or C plus any
of these other things, right? 

160
00:08:40,320 --> 00:08:43,400
And there's a, a, a, a, a, a 
just kind of a headspace that 

161
00:08:43,400 --> 00:08:45,720
goes along with it. 
And it's kind of fun to try them

162
00:08:45,720 --> 00:08:50,400
on a little bit 'cause you can 
pick up things from one place 

163
00:08:50,400 --> 00:08:52,080
and bring them to another, 
right? 

164
00:08:52,280 --> 00:08:54,880
Like, I just had a, a rough 
project I was working on and I 

165
00:08:54,880 --> 00:08:58,760
brought Elixir style telemetry 
over to it because it made it 

166
00:08:58,760 --> 00:09:02,640
easier to, to, to get at certain
problems, you know, and it's, 

167
00:09:02,840 --> 00:09:06,120
it's interesting that sometimes 
people don't play with things 

168
00:09:06,120 --> 00:09:08,520
that are outside of their normal
wheelhouse. 

169
00:09:08,840 --> 00:09:11,000
And I think they miss out a 
little bit because there's 

170
00:09:11,040 --> 00:09:12,760
interesting ways to solve 
problems. 

171
00:09:13,160 --> 00:09:16,840
And if you don't look, you don't
see, do you know what I mean? 

172
00:09:17,400 --> 00:09:22,560
I was better at that when I was 
younger and for whatever reason 

173
00:09:22,560 --> 00:09:26,400
now I just want to be a cranky 
old man and stay in my bubble. 

174
00:09:27,520 --> 00:09:29,480
I hear you. 
No, it's fun and it's nice. 

175
00:09:29,480 --> 00:09:32,720
I mean, immutable data, I mean, 
just being able to think about 

176
00:09:32,720 --> 00:09:34,880
the, I put that there, it's 
going to stay there and nobody's

177
00:09:34,880 --> 00:09:37,440
going to mess with it, even if I
have other processes and things 

178
00:09:37,440 --> 00:09:41,000
flying around. 
And again, the limitations, 

179
00:09:41,000 --> 00:09:43,000
right? 
Because you have this process 

180
00:09:43,240 --> 00:09:46,240
and, you know, I have to think 
about, you know, the, the way 

181
00:09:46,240 --> 00:09:49,880
that it manages information, 
because if I want to move thing 

182
00:09:49,880 --> 00:09:53,120
from one thing from from one 
process to another, I have to 

183
00:09:53,120 --> 00:09:55,280
pay that tax of going through 
the mailbox, right? 

184
00:09:55,680 --> 00:09:59,760
And things are copied. 
So this is, this is a, an 

185
00:09:59,760 --> 00:10:02,280
interesting problem because if 
you have a large piece of 

186
00:10:02,280 --> 00:10:04,120
information, you want to move it
from one place to another. 

187
00:10:04,200 --> 00:10:07,240
It can be slow, but there are 
ways around this. 

188
00:10:07,240 --> 00:10:09,400
And we can get more into that 
when we talk about bedrock, 

189
00:10:09,400 --> 00:10:12,280
because that's one of the tricks
I, I end up pulling there. 

190
00:10:12,760 --> 00:10:16,360
Yeah, yeah, I think Bedrock will
be a fun conversation. 

191
00:10:16,640 --> 00:10:18,600
What? 
Before we get there though, 

192
00:10:18,800 --> 00:10:23,000
how'd you find yourself to like?
What was your path to Elixir? 

193
00:10:23,000 --> 00:10:27,760
And like, what made you discover
Elixir and start using a 

194
00:10:27,760 --> 00:10:34,280
daylight? 
20/16/2017 I had a buddy who was

195
00:10:34,280 --> 00:10:38,840
like neck deep in it, you smart 
guy, you know and he was really 

196
00:10:38,840 --> 00:10:41,160
into it and I didn't quite get 
it at the time. 

197
00:10:41,240 --> 00:10:44,560
It took me a while to come 
around to 'cause I'm like, OK, 

198
00:10:44,640 --> 00:10:46,520
you know, fantastic pattern 
matching. 

199
00:10:46,560 --> 00:10:48,560
Yeah. 
You know, it just didn't really 

200
00:10:48,560 --> 00:10:53,440
click in my brain, right. 
And then he showed me this thing

201
00:10:53,440 --> 00:10:56,960
once that was like, really like 
parse GIFs or something like 

202
00:10:56,960 --> 00:10:58,280
that. 
And it was like this much code. 

203
00:10:58,640 --> 00:11:01,600
It was so cute. 
This thing, it just, it, it was 

204
00:11:01,600 --> 00:11:04,800
kind of this little haiku poem 
of, of, of, of software. 

205
00:11:05,160 --> 00:11:09,680
And it, it stuck in my mind. 
And then when I ended up having 

206
00:11:09,680 --> 00:11:15,040
to solve some other problems, 
it, it, it was a tool I kind of 

207
00:11:15,040 --> 00:11:18,840
reached for and I, I, I tried it
out and it worked And then it 

208
00:11:18,840 --> 00:11:20,440
was crazy. 
I found people pay me to do it. 

209
00:11:20,440 --> 00:11:24,120
So that was, that's always fun. 
You know when you can do the 

210
00:11:24,120 --> 00:11:27,280
things that you want to do and 
and get paid for it, That's. 

211
00:11:27,400 --> 00:11:30,280
Yeah, I had a similar story. 
A buddy was just in my ear 

212
00:11:30,280 --> 00:11:32,800
telling me how great Elixir was 
and I was like, I'm sure it's 

213
00:11:32,840 --> 00:11:33,760
great. 
Like whatever. 

214
00:11:34,360 --> 00:11:37,440
And then I actually took it 
seriously because I was, I 

215
00:11:37,440 --> 00:11:40,680
started building a side project,
my I, it was called perfect 

216
00:11:40,680 --> 00:11:43,120
form. 
It was like a, a fitness 

217
00:11:43,120 --> 00:11:46,040
marketplace and I was like, all 
right, let me look into Elixir 

218
00:11:46,040 --> 00:11:48,680
because I think it sounds like 
it'd be a great fit. 

219
00:11:48,920 --> 00:11:52,240
So I started digging into it and
it was like before I even like 

220
00:11:52,240 --> 00:11:56,720
actually understood the power 
that I was learning, but I was 

221
00:11:56,720 --> 00:11:59,480
like, oh, I love the syntax. 
And then once I like wrap my 

222
00:11:59,480 --> 00:12:02,200
head around pattern matching and
immutability, I was like, oh, 

223
00:12:02,200 --> 00:12:04,400
this is I just love it. 
It's like fun to write. 

224
00:12:04,800 --> 00:12:10,320
So I started writing my first 
like REST API, very object 

225
00:12:10,320 --> 00:12:15,080
oriented ish, but with paradigm 
like. 

226
00:12:15,280 --> 00:12:18,160
It wasn't pretty, it was 
horrible, but I learned a lot 

227
00:12:18,160 --> 00:12:21,120
and I rewrote a lot of code 
'cause I would like get it 

228
00:12:21,120 --> 00:12:22,840
working. 
And then like, oh, this is like 

229
00:12:22,840 --> 00:12:27,240
so wrong, this is not Elixir. 
And so I'd fix it, correct it. 

230
00:12:27,240 --> 00:12:30,440
And then I decided to start a 
YouTube channel with tutorials 

231
00:12:30,440 --> 00:12:33,920
because my learning curve was so
difficult coming from like 

232
00:12:34,880 --> 00:12:37,880
JavaScript and like object 
oriented background to 

233
00:12:37,880 --> 00:12:40,240
functional language. 
And I was like, I need to just 

234
00:12:40,240 --> 00:12:43,680
like help people get off the 
ground running and that that. 

235
00:12:44,000 --> 00:12:45,160
Makes. 
Sense. 

236
00:12:46,360 --> 00:12:50,520
One of the things I dig about it
is like I find myself reaching 

237
00:12:50,520 --> 00:12:54,840
for something and I go dig 
around in either the ecosystem 

238
00:12:54,840 --> 00:12:57,920
or frequently just go dig in the
beam docks, right? 

239
00:12:57,920 --> 00:12:59,800
You go look in the Earl dock, 
the Earl link docks. 

240
00:12:59,800 --> 00:13:02,360
And it's like there's this 
little gem somebody thought 

241
00:13:02,360 --> 00:13:06,080
about it 15 years ago and it's 
in there and you can just dredge

242
00:13:06,080 --> 00:13:09,600
up this little toy for, for 
doing things like I was, I was 

243
00:13:09,600 --> 00:13:13,120
building a thing for doing file 
diffs the other day. 

244
00:13:13,160 --> 00:13:15,760
And wonder, I wonders there's a 
tool in there. 

245
00:13:15,760 --> 00:13:17,400
It's built into the runtime 
library. 

246
00:13:17,400 --> 00:13:21,040
You can you get the, the Myers 
diff algorithm is right there. 

247
00:13:21,280 --> 00:13:25,000
You just trot it out and poof, 
you can do file diffing line by 

248
00:13:25,000 --> 00:13:25,720
line. 
Lovely. 

249
00:13:26,480 --> 00:13:29,640
And so there's all kinds of toys
like that. 

250
00:13:29,640 --> 00:13:32,320
And, and what's neat is when 
you, when you when you're 

251
00:13:32,320 --> 00:13:34,200
digging around in there, you 
can, you can roll your own. 

252
00:13:34,200 --> 00:13:35,840
It's really easy. 
And then of course, like I said,

253
00:13:35,840 --> 00:13:38,800
there's all kinds of stuff to to
play with, which is which is 

254
00:13:38,800 --> 00:13:41,360
fun. 
There's a so many rocks to turn 

255
00:13:41,360 --> 00:13:43,120
over. 
I mean, like you said, when you 

256
00:13:43,880 --> 00:13:46,080
you get into it and the more you
get into it, you start feeling 

257
00:13:46,080 --> 00:13:50,480
like Oh well this is neat and 
processes and OTP look at this 

258
00:13:50,480 --> 00:13:54,720
whole thing, supervision trees 
and all kinds of power this 

259
00:13:54,720 --> 00:13:57,320
unlocks. 
So good fun. 

260
00:13:58,040 --> 00:14:00,480
It is fun. 
And then like, yeah, the more 

261
00:14:00,480 --> 00:14:04,080
you learn, like how to use 
supervision trees, Genservers 

262
00:14:04,080 --> 00:14:07,040
and all of that, it just starts 
compounding and you're like, I 

263
00:14:07,040 --> 00:14:09,960
can do anything I want. 
Right. 

264
00:14:10,240 --> 00:14:12,160
And then it's just a matter of 
having hours in the day. 

265
00:14:12,800 --> 00:14:15,440
Yeah, that's true. 
I don't have enough of those, 

266
00:14:15,440 --> 00:14:19,360
honestly. 
All right, so do you want to 

267
00:14:19,360 --> 00:14:22,480
dive into bedrock first? 
Sure, we can talk about it. 

268
00:14:22,480 --> 00:14:27,400
I mean, I think it makes sense 
to talk about the problem that 

269
00:14:27,400 --> 00:14:32,200
we're that it's trying to solve 
and then maybe loop into what it

270
00:14:32,240 --> 00:14:34,600
does and that attempt at 
solving. 

271
00:14:34,800 --> 00:14:38,800
All right, I OK, I want to read 
your little like one liner from 

272
00:14:38,800 --> 00:14:42,440
your docs and have and have you 
and then have you explain it. 

273
00:14:43,200 --> 00:14:47,040
Yeah, no, just explain it to me 
like I'm, I'm five, you know? 

274
00:14:47,720 --> 00:14:49,040
Fair enough. 
All right. 

275
00:14:49,320 --> 00:14:54,080
So it's an embedded distributed 
key value store with guarantees 

276
00:14:54,080 --> 00:14:57,840
beyond ACID like OK, right, 
what's that mean? 

277
00:14:58,400 --> 00:15:00,360
It sounds there's a whole. 
Bunch of words in there. 

278
00:15:00,440 --> 00:15:02,120
It's got croutons and 
everything, right? 

279
00:15:02,160 --> 00:15:08,240
OK, so, so The thing is that you
find yourself, I mean, and 

280
00:15:08,240 --> 00:15:11,200
they've solved this problem on 
the beam in in ways a long time 

281
00:15:11,200 --> 00:15:12,680
ago, but it's got real 
limitations. 

282
00:15:13,080 --> 00:15:15,920
You have things like amnesia, 
right? 

283
00:15:15,920 --> 00:15:18,160
Where you have a, a, a cluster 
of nodes. 

284
00:15:18,440 --> 00:15:21,840
And I want to be able to have, 
you know, records and things 

285
00:15:21,840 --> 00:15:25,000
that flow across them so that on
one node I can do a thing, 

286
00:15:25,520 --> 00:15:27,200
right? 
And then on the other node, I 

287
00:15:27,200 --> 00:15:29,840
see the thing and this is great,
right? 

288
00:15:29,840 --> 00:15:34,560
This is a lovely thing. 
Amnesia has all kinds of 

289
00:15:34,600 --> 00:15:36,440
limitations, though. 
You have to like a kind of a, 

290
00:15:36,680 --> 00:15:39,480
they didn't really imagine, you 
know, clusters that would scale 

291
00:15:39,480 --> 00:15:41,040
up or down over the course of 
the day. 

292
00:15:41,040 --> 00:15:43,280
You'd have a machine called 
Ernie and one called Bert. 

293
00:15:43,280 --> 00:15:45,320
And they would, they would play 
nicely together. 

294
00:15:45,320 --> 00:15:48,680
And that's what would happen. 
And so Amnesia breaks down when 

295
00:15:48,680 --> 00:15:51,720
you have to do things like add a
node or remove a node. 

296
00:15:51,760 --> 00:15:57,840
So like dynamically scale nodes?
Yeah, pain, pain, lots of pain. 

297
00:15:57,840 --> 00:15:59,800
Just Ouch. 
Hurts, right? 

298
00:15:59,800 --> 00:16:02,160
So that's one of the places 
where it's got sharp edges, 

299
00:16:02,280 --> 00:16:04,280
right? 
So it's it's not, it's not so 

300
00:16:04,280 --> 00:16:07,000
fun right there. 
There are other ways in which 

301
00:16:07,000 --> 00:16:09,760
like it can break. 
There's limitations just on the 

302
00:16:09,760 --> 00:16:12,720
amount of data, the people, 
there's all kinds of fun things 

303
00:16:12,720 --> 00:16:16,080
that that come in there that 
make it not really suitable. 

304
00:16:16,080 --> 00:16:18,280
So This is why you don't see a 
lot of people just, you know, 

305
00:16:18,880 --> 00:16:21,240
amnesia, even though it's there 
and you could reach for it, 

306
00:16:21,240 --> 00:16:24,800
right. 
So you got this problem where it

307
00:16:24,800 --> 00:16:29,360
really is useful to be able to 
have a cluster of machines and 

308
00:16:29,360 --> 00:16:32,400
to be able to have like a 
consistent picture or something,

309
00:16:32,880 --> 00:16:34,880
right? 
And then of course, if you can 

310
00:16:34,880 --> 00:16:37,680
then run a transaction on that 
thing, right? 

311
00:16:37,680 --> 00:16:40,320
So that you can be sure that 
what you're changing either 

312
00:16:40,320 --> 00:16:44,000
happens or doesn't, right? 
And then it works across the 

313
00:16:44,000 --> 00:16:46,400
cluster. 
And those machines don't have to

314
00:16:46,400 --> 00:16:49,360
do a whole lot of things, you 
know to to to get at it from a 

315
00:16:49,640 --> 00:16:52,760
ergonomic standpoint. 
One thing I want to poke at, 

316
00:16:53,000 --> 00:16:57,000
yeah, before we like dive too 
deep into like how Bedrock 

317
00:16:57,000 --> 00:17:00,520
works, like on a distributed 
system, I think a lot of people 

318
00:17:00,520 --> 00:17:04,800
miss like how difficult it is. 
Like, for instance, like when 

319
00:17:04,800 --> 00:17:07,599
you're running a Postgres 
database, you usually just have 

320
00:17:07,599 --> 00:17:09,800
one big database, right? 
And. 

321
00:17:09,880 --> 00:17:12,880
One picture of the world. 
One picture of the world that 

322
00:17:12,880 --> 00:17:17,240
all your nodes are pointing at. 
So you still have that 

323
00:17:17,240 --> 00:17:19,480
bottleneck, right? 
Right. 

324
00:17:19,480 --> 00:17:22,240
Well, it's not even just what 
we've done here is, and this is 

325
00:17:22,240 --> 00:17:26,440
a good thing is when we're 
talking about a system where you

326
00:17:26,440 --> 00:17:29,960
have a bunch of nodes and you 
still have like 1 database, 

327
00:17:30,000 --> 00:17:31,360
right? 
What you've really done is 

328
00:17:31,360 --> 00:17:34,680
you've outsourced your 
distributed system problems to 

329
00:17:34,680 --> 00:17:37,640
the DB, right? 
I, I, if I'm going to keep a 

330
00:17:37,640 --> 00:17:40,200
consistent picture there, I go 
to the DB and I ask it a 

331
00:17:40,200 --> 00:17:42,720
question, right? 
I want to change things. 

332
00:17:42,720 --> 00:17:46,000
I go to the DB and I, I put a 
transaction together and I do 

333
00:17:46,000 --> 00:17:47,960
it. 
And it's the place that deals 

334
00:17:47,960 --> 00:17:50,720
with all of that problem, that 
hard problem. 

335
00:17:52,200 --> 00:17:55,280
The downside is, is that there's
only so much bigger you can make

336
00:17:55,280 --> 00:17:59,280
ADB and they don't really 
horizontal is not a thing that 

337
00:17:59,280 --> 00:18:02,360
they do so well, right? 
They're just, it's not, it's not

338
00:18:02,360 --> 00:18:04,480
the way that's built for a lot 
of these things. 

339
00:18:04,520 --> 00:18:08,720
And so you end up having to 
reach for all kinds of thing 

340
00:18:09,640 --> 00:18:12,000
other other property caching, 
people want to reach for 

341
00:18:12,000 --> 00:18:13,720
caching. 
But then you have this 

342
00:18:13,720 --> 00:18:18,800
distributed problem where I have
a user and I just read it out of

343
00:18:18,800 --> 00:18:22,080
the database and I make some 
changes to it and it's on node 

344
00:18:22,080 --> 00:18:24,440
one. 
The next request comes into node

345
00:18:24,440 --> 00:18:27,800
2, right? 
I want to get at the same user 

346
00:18:28,240 --> 00:18:31,440
the freshest copies right here. 
But I don't know that. 

347
00:18:31,960 --> 00:18:34,160
And so I have to go to the DB 
again and get it. 

348
00:18:34,800 --> 00:18:39,000
And if I try to cache something 
in a place like Redis or some 

349
00:18:39,000 --> 00:18:42,000
other tool like that, all we've 
done is we've just outsourced 

350
00:18:42,000 --> 00:18:43,600
the problem again to another 
thing. 

351
00:18:43,840 --> 00:18:48,120
Right, it's the same problem. 
You, you, you kind of, I mean, 

352
00:18:48,120 --> 00:18:51,600
it's faster, but you can't get 
right. 

353
00:18:51,600 --> 00:18:54,240
And so now you think, OK, fine, 
well, I'm going to keep track of

354
00:18:54,240 --> 00:18:58,200
this on this node, you know, and
this user's right here right 

355
00:18:58,200 --> 00:19:00,080
now, and I'm going to let that 
be here. 

356
00:19:00,080 --> 00:19:03,320
And then this other guy needs to
talk to that talk, read 

357
00:19:03,320 --> 00:19:06,360
something about that same user, 
and it now has to know where to 

358
00:19:06,360 --> 00:19:10,520
find it, right? 
This is the problem all by 

359
00:19:10,520 --> 00:19:12,840
itself. 
Like where are things just 

360
00:19:12,840 --> 00:19:15,680
keeping track and keeping that 
information up to date is 

361
00:19:16,080 --> 00:19:17,760
difficult. 
And then of course, if you're 

362
00:19:17,760 --> 00:19:20,200
going to deal with something 
like a cash, now you have this 

363
00:19:20,200 --> 00:19:23,880
problem where I've got new 
information here and it might 

364
00:19:23,880 --> 00:19:26,480
make a change over here and it 
becomes stale and now I got to 

365
00:19:26,480 --> 00:19:28,720
shoot it down. 
So there's all of these 

366
00:19:28,720 --> 00:19:31,640
interesting distributed problems
when you have a computer, number

367
00:19:31,640 --> 00:19:34,800
of computers with, you know, N 
more than one right now, all 

368
00:19:34,800 --> 00:19:37,800
these, there's different places 
that information can be and you 

369
00:19:37,800 --> 00:19:41,200
have to know where what's fresh,
what's not, what's useful, 

370
00:19:41,200 --> 00:19:43,600
what's not. 
And then if you're making 

371
00:19:44,120 --> 00:19:47,640
decisions about money or 
people's financial stuff, 

372
00:19:47,680 --> 00:19:50,160
anything like that, you, you 
have to have the fresh stuff. 

373
00:19:50,160 --> 00:19:54,040
So This is why everybody just 
ends up going back to echo again

374
00:19:54,040 --> 00:19:56,560
and going back to the database 
and letting the database deal 

375
00:19:56,560 --> 00:19:59,080
with it, right? 
Just, I mean, it's, it's a lot 

376
00:19:59,120 --> 00:20:02,760
easier to do that. 
It is it is it is a problem. 

377
00:20:03,320 --> 00:20:06,240
You have to pay. 
Attention, that's when it comes,

378
00:20:06,240 --> 00:20:07,200
that's where the rubber meets 
the road. 

379
00:20:07,200 --> 00:20:10,280
It's like when you have a system
that you've built and for most 

380
00:20:10,280 --> 00:20:12,800
things, I would say 90% of 
things that people are building,

381
00:20:12,920 --> 00:20:15,680
this is perfectly fine. 
This is these are problems you 

382
00:20:15,680 --> 00:20:19,040
don't necessarily need to solve.
But if you start getting, if you

383
00:20:19,040 --> 00:20:23,440
have something that's big or 
growing, right, like for work, 

384
00:20:23,440 --> 00:20:26,160
work, we have a situation where 
you know, things are growing. 

385
00:20:26,200 --> 00:20:28,720
You have millions of people, you
know, you need to be able to 

386
00:20:28,720 --> 00:20:30,520
split things onto more than one 
machine. 

387
00:20:30,520 --> 00:20:33,080
And now all of a sudden, you 
know, the way you built all the 

388
00:20:33,080 --> 00:20:35,680
way up until now doesn't work so
well, right? 

389
00:20:35,680 --> 00:20:37,240
You run into all these problems 
head on. 

390
00:20:37,760 --> 00:20:43,800
And so, you know, the, the idea,
the problem that Bedrock is 

391
00:20:43,800 --> 00:20:49,720
trying to solve is how do we 
take and make it so that we have

392
00:20:49,920 --> 00:20:54,840
within the beam a consistent 
picture from node to node and 

393
00:20:54,840 --> 00:20:57,720
that things that conflict 
because we're changing them in 

394
00:20:57,720 --> 00:21:01,160
the changing the same thing in 
two places conflict properly. 

395
00:21:01,480 --> 00:21:05,680
But things that don't touch the 
same data, they can sail through

396
00:21:05,920 --> 00:21:08,280
without a problem. 
Like you see what I'm saying, 

397
00:21:08,280 --> 00:21:11,400
Like user A makes a change, user
B makes a change. 

398
00:21:11,560 --> 00:21:13,560
Those things are unrelated, 
right? 

399
00:21:13,560 --> 00:21:16,000
They shouldn't conflict. 
They should sail through nice 

400
00:21:16,000 --> 00:21:18,240
and quick. 
But if user A is changed here 

401
00:21:18,240 --> 00:21:21,040
and user A is changed here, then
there needs to be some kind of 

402
00:21:21,040 --> 00:21:22,800
order. 
There needs to be some kind of 

403
00:21:22,800 --> 00:21:25,760
order imposed on that so that 
somebody gets, when they try to 

404
00:21:25,760 --> 00:21:30,560
withdraw money, you know, twice 
somebody gets an error and 

405
00:21:30,560 --> 00:21:33,720
somebody doesn't you know, we 
got to you got to sort that 

406
00:21:33,720 --> 00:21:36,280
problem out. 
And so that's kind of the 

407
00:21:36,280 --> 00:21:40,480
problem space that Bedrock lives
in is what that looks like to 

408
00:21:40,480 --> 00:21:44,880
you is I've got this giant KV 
universe, right? 

409
00:21:45,160 --> 00:21:46,440
And I can which. 
Kind of like. 

410
00:21:46,440 --> 00:21:49,280
Keys and right keys. 
It's basically a dictionary, 

411
00:21:49,280 --> 00:21:50,600
right? 
When you have, you're just 

412
00:21:50,720 --> 00:21:51,640
doing. 
Oh yeah, it looks like a big. 

413
00:21:51,840 --> 00:21:54,240
Value, Yeah, OK. 
Yep, Yep. 

414
00:21:54,360 --> 00:21:57,040
And with some special operations
for things like range scanning 

415
00:21:57,040 --> 00:21:59,680
where, you know, I want to start
a key and I want to grab the 

416
00:21:59,680 --> 00:22:04,160
next X number of keys or I want 
to, I want to do a walk through 

417
00:22:04,480 --> 00:22:06,760
a set of keys. 
You know, things that you can't 

418
00:22:06,760 --> 00:22:09,720
really do on like a map, but the
map is a perfectly good mental 

419
00:22:09,720 --> 00:22:11,600
model for how this thing works, 
right? 

420
00:22:11,600 --> 00:22:15,760
It's, you know, I puts and gets 
right really when it comes down 

421
00:22:15,760 --> 00:22:18,520
to it with with some fancy sauce
on top. 

422
00:22:19,280 --> 00:22:22,240
So the mental model is easy. 
I have a thing I want to put it 

423
00:22:22,240 --> 00:22:24,720
somewhere and then later on I 
want to be able to get it back 

424
00:22:25,640 --> 00:22:27,520
right. 
And so that leaves a lot of 

425
00:22:27,520 --> 00:22:31,360
choice up to the to the user as 
to how granular they want to get

426
00:22:31,360 --> 00:22:32,120
it. 
Do you want to put a whole 

427
00:22:32,120 --> 00:22:34,080
record in there? 
Do I want to put pieces of a 

428
00:22:34,080 --> 00:22:35,760
record? 
You get the idea. 

429
00:22:36,320 --> 00:22:40,760
But the important thing is, is 
that when I'm messing with 

430
00:22:40,760 --> 00:22:42,680
something over here and I'm and 
you're messing with the same 

431
00:22:42,680 --> 00:22:47,080
keys over here, we need to 
figure out who, how this is 

432
00:22:47,080 --> 00:22:49,600
going to work so that we're not 
stepping on each other's stuff. 

433
00:22:49,960 --> 00:22:53,760
Because you can imagine we have 
a key that keeps track of your 

434
00:22:53,760 --> 00:22:56,840
bank balance and somebody's 
doing a debit here or somebody's

435
00:22:56,840 --> 00:22:59,520
doing a credit here. 
We want to make sure that that 

436
00:22:59,520 --> 00:23:02,440
key stays properly updated with 
the correct value. 

437
00:23:02,720 --> 00:23:05,880
And that's going to matter as to
which order those things go in. 

438
00:23:05,880 --> 00:23:08,800
And we obviously, you know, 
don't want them both to go at 

439
00:23:08,800 --> 00:23:12,280
the same time such that you end 
up with a mess, right? 

440
00:23:13,160 --> 00:23:15,960
So that's, that's the general 
problem space. 

441
00:23:15,960 --> 00:23:17,240
That's what we're trying to 
solve. 

442
00:23:17,240 --> 00:23:20,720
And of course, by making it 
simple like that, I've just, 

443
00:23:21,280 --> 00:23:25,080
I've got AI can start a 
transaction, I can read and 

444
00:23:25,080 --> 00:23:28,760
write and then I can commit it 
and it either happens or it 

445
00:23:28,760 --> 00:23:32,120
doesn't, right. 
This is a nice, easy ergonomic 

446
00:23:32,120 --> 00:23:33,600
mental model for people to play 
with. 

447
00:23:34,800 --> 00:23:37,480
Yeah. 
And OK, you've made reference to

448
00:23:37,480 --> 00:23:39,480
like foundation DB and stuff, 
right? 

449
00:23:39,480 --> 00:23:45,680
And that that is written in C++.
They actually have their own 

450
00:23:45,680 --> 00:23:50,000
weird language that like 
transpiles down to C++. 

451
00:23:50,280 --> 00:23:52,880
And the reason they did is the 
the it's funny because 

452
00:23:53,520 --> 00:23:56,520
Foundation DB actually is built 
on the actor model. 

453
00:23:56,960 --> 00:24:01,400
So it's they're trying to do the
same thing that we do on the 

454
00:24:01,400 --> 00:24:03,680
Beam with message passing and 
all of this. 

455
00:24:03,680 --> 00:24:07,560
I was going to ask, So what 
advantage do you get using the 

456
00:24:07,560 --> 00:24:09,280
beam? 
Like, it sounds like you would 

457
00:24:09,280 --> 00:24:11,120
get a lot more out-of-the-box 
just. 

458
00:24:12,080 --> 00:24:16,080
There are some places where the 
the beam is really sharp on this

459
00:24:16,080 --> 00:24:19,480
and there's some places where 
that hurts too. 

460
00:24:19,920 --> 00:24:21,200
And we can get into that in a 
minute. 

461
00:24:21,600 --> 00:24:24,400
The, the general idea is the 
foundation, give these, these 

462
00:24:24,400 --> 00:24:28,960
really smart people a decade 
ago, decade and change ago, 

463
00:24:29,320 --> 00:24:31,480
they, they came up with this. 
They had the same basic idea 

464
00:24:31,480 --> 00:24:33,400
where I'm going to have a key 
value store. 

465
00:24:33,480 --> 00:24:36,600
We're going to have it spread 
across a distributed system such

466
00:24:36,600 --> 00:24:40,200
that all of these clients could 
read and write and keep their 

467
00:24:40,200 --> 00:24:42,880
stuff straight and it would be 
nice and simple. 

468
00:24:42,880 --> 00:24:44,920
And if a machine goes down, it's
not a big event. 

469
00:24:45,320 --> 00:24:47,680
If parts of the cluster go down,
it's not a big deal. 

470
00:24:48,440 --> 00:24:50,720
Things come and go, right? 
Sounds lovely. 

471
00:24:50,800 --> 00:24:53,920
And it was, it was lovely enough
that Apple bought them, right? 

472
00:24:53,920 --> 00:24:58,960
Apple bought them back in what 
15 and had them for many years 

473
00:24:58,960 --> 00:25:02,200
and most there's a good chunk of
Apple right now. 

474
00:25:02,200 --> 00:25:07,080
Cloudkit, all that stuff runs on
top of foundation DB now and and

475
00:25:07,120 --> 00:25:08,520
I don't see it going away 
anytime soon. 

476
00:25:09,080 --> 00:25:12,040
So again, the same mental model 
where you have key values, you 

477
00:25:12,040 --> 00:25:16,000
have transactions across them 
and that you can guarantee what 

478
00:25:16,000 --> 00:25:19,160
happens and what work, right. 
This is, this is a good thing. 

479
00:25:20,080 --> 00:25:21,680
Like I said, they built it on 
the actor model. 

480
00:25:22,680 --> 00:25:26,120
So you have these this idea of 
like little tiny processes, 

481
00:25:26,480 --> 00:25:30,880
right, that do one thing and 
they move things back and forth.

482
00:25:31,320 --> 00:25:33,960
And if there's always a sound 
and like a really good fit for 

483
00:25:33,960 --> 00:25:39,520
some things, you know, it is so 
this this this model fits onto 

484
00:25:39,520 --> 00:25:42,360
the beam in a pretty it just 
kind of sneaks in there in a, in

485
00:25:42,360 --> 00:25:47,000
a, in a, in a really nice way. 
So there's some wrinkles, you 

486
00:25:47,000 --> 00:25:49,360
know, because as we mentioned 
before, like there's copying, 

487
00:25:49,360 --> 00:25:52,000
you know, when you when you send
messages back and forth in 

488
00:25:52,040 --> 00:25:55,120
between processes on the theme, 
like people don't realize this, 

489
00:25:55,120 --> 00:25:58,840
but things are quite right. 
There's the processes don't 

490
00:25:58,840 --> 00:26:03,080
share anything. 
So if I haven't a map full of 

491
00:26:03,080 --> 00:26:05,280
stuff. 
You also can't control the order

492
00:26:05,280 --> 00:26:11,800
your messages come in. 
No, yeah, you have kind of a 

493
00:26:11,800 --> 00:26:14,480
rough, they have a priority 
mechanism. 

494
00:26:14,480 --> 00:26:17,000
Most people don't know about it 
or use it, but there's a thing 

495
00:26:17,000 --> 00:26:19,840
you can do, right? 
But yeah, it's there's a lot of 

496
00:26:19,840 --> 00:26:22,640
there's a lot of, you know, 
messages are coming through the 

497
00:26:22,640 --> 00:26:25,280
door. 
And so when I have a map and I 

498
00:26:25,280 --> 00:26:28,240
send you a message, it's nothing
but just a map of things, right?

499
00:26:28,440 --> 00:26:33,200
That map gets copied onto your 
other processes heap, right? 

500
00:26:33,480 --> 00:26:37,000
And then your process kicks in 
and now it has that stuff. 

501
00:26:37,240 --> 00:26:39,880
And so it's immutable, but it's 
also copied. 

502
00:26:40,160 --> 00:26:42,800
So if you, This is why some 
people don't realize that you 

503
00:26:42,800 --> 00:26:45,720
can't just ping pong big data 
structures back and forth 

504
00:26:45,720 --> 00:26:49,000
between processes. 
Hey, why is my stuff slow? 

505
00:26:49,000 --> 00:26:50,600
Well, it's because you're doing 
a silly thing. 

506
00:26:51,200 --> 00:26:52,640
You know, it's like, it's a 
little silly. 

507
00:26:53,240 --> 00:26:57,320
There is one exception on the 
beam, and this is binaries that 

508
00:26:57,320 --> 00:27:00,920
are larger than 64 bytes for, 
you know, nerds out there, 

509
00:27:00,920 --> 00:27:03,560
right? 
If you are tossing a binary back

510
00:27:03,560 --> 00:27:06,320
and forth between two processes,
it's free. 

511
00:27:07,120 --> 00:27:08,640
You're just passing a pointer, 
right? 

512
00:27:08,640 --> 00:27:11,000
That's reference counted. 
There's like a global heap for 

513
00:27:11,000 --> 00:27:11,920
binaries. 
Yeah. 

514
00:27:12,200 --> 00:27:16,640
So if you think about this now, 
you know, from a standpoint of, 

515
00:27:16,640 --> 00:27:18,840
like, I'm going to put together 
a transaction and it's got to 

516
00:27:18,840 --> 00:27:21,400
flow through the system, and a 
lot of things need to look at 

517
00:27:21,400 --> 00:27:23,800
it, right? 
And where it ends up, it's going

518
00:27:23,800 --> 00:27:27,680
to end up on the disk somewhere.
You know, if I'm packing and 

519
00:27:27,680 --> 00:27:29,880
unpacking this thing, it's going
to be really slow. 

520
00:27:30,280 --> 00:27:33,320
If I send it in some kind of 
disaggregated form, like I said,

521
00:27:33,320 --> 00:27:36,360
a big old map or lists of stuff 
or whatever, it's going to be 

522
00:27:36,360 --> 00:27:37,560
copied and that's going to be 
slow. 

523
00:27:38,160 --> 00:27:42,560
And but if I send a binary, 
right, that can go from process 

524
00:27:42,600 --> 00:27:47,440
A to B to C to D all the way to 
the disk with no copies, right, 

525
00:27:47,520 --> 00:27:49,280
Zero copy. 
How do you? 

526
00:27:49,280 --> 00:27:51,920
It doesn't move at all. 
How do you control state at that

527
00:27:51,920 --> 00:27:55,160
point? 
So you got to be clever. 

528
00:27:55,400 --> 00:27:59,560
So like what you do is you just 
say, for instance, in Bedrock, 

529
00:27:59,560 --> 00:28:02,640
what we do is we take and the, 
the client actually puts 

530
00:28:02,640 --> 00:28:05,560
together the transaction. 
You have a little packet, right?

531
00:28:05,560 --> 00:28:08,640
It binary encodes it like the 
little binary that's built. 

532
00:28:09,000 --> 00:28:12,160
And what happens is that's what 
it submits to the system, right?

533
00:28:12,160 --> 00:28:15,960
It's a little encoded key value 
pack with just the stuff that 

534
00:28:15,960 --> 00:28:19,680
changed and what was read, 
version numbers, a few other 

535
00:28:19,680 --> 00:28:21,800
things, some details, but it's 
basically a little binary 

536
00:28:21,800 --> 00:28:25,640
package and it flows to the next
process and it flows with no 

537
00:28:25,640 --> 00:28:28,160
copies. 
And so the next little process 

538
00:28:28,160 --> 00:28:30,080
in the, in the, in the chain 
looks at it and says like, oh, 

539
00:28:30,080 --> 00:28:31,680
well, this is what I got to do 
with it. 

540
00:28:31,680 --> 00:28:33,000
And then it moves along and so 
on. 

541
00:28:33,320 --> 00:28:35,240
And eventually this thing ends 
up on the disk. 

542
00:28:35,600 --> 00:28:39,960
And there are relatively few 
places, a lot of places that are

543
00:28:39,960 --> 00:28:42,840
taking it apart and reading it 
right, but nothing that's 

544
00:28:42,840 --> 00:28:45,720
actually changing it. 
And so you don't end up having 

545
00:28:45,720 --> 00:28:48,120
to copy things that way. 
People don't realize it's 

546
00:28:48,200 --> 00:28:51,080
something like ETS, like if you 
have an ETS table and I put a 

547
00:28:51,080 --> 00:28:55,440
giant piece of data in it and I 
go to read that from another 

548
00:28:55,440 --> 00:28:59,480
process that's not free. 
It copies each time I read it 

549
00:28:59,480 --> 00:29:02,480
from ETF, it copies it right 
into my memory, right. 

550
00:29:02,480 --> 00:29:06,520
So if I go put 60 megabytes of 
something into AETF table and 

551
00:29:06,520 --> 00:29:09,080
then read it back in another 
process, dude, if it's not a 

552
00:29:09,080 --> 00:29:12,240
binary, you're, you're, you're 
making copies of that stuff each

553
00:29:12,240 --> 00:29:14,760
time. 
So, you know, it's there's, 

554
00:29:14,760 --> 00:29:17,920
there's, there's some limits. 
We got Mike Hostetler in the 

555
00:29:17,920 --> 00:29:20,760
comments pretending he just 
learned about this today. 

556
00:29:23,560 --> 00:29:26,320
They said today I learned about 
passing binaries among OTP 

557
00:29:26,320 --> 00:29:27,520
processes. 
So awesome. 

558
00:29:27,640 --> 00:29:29,320
Same dude. 
I also just. 

559
00:29:29,320 --> 00:29:32,440
Learned it is it is true. 
I mean, but see, again, this is 

560
00:29:32,440 --> 00:29:35,320
one of those places where, you 
know, Harkins back to you go dig

561
00:29:35,320 --> 00:29:37,560
in the docs and you peel back 
the layers of the beam and you 

562
00:29:37,560 --> 00:29:40,920
take a look at like how it works
and and and what it does. 

563
00:29:40,920 --> 00:29:44,440
And I just started this once, 
Dude, it's good. 

564
00:29:44,600 --> 00:29:46,920
It's good. 
It's good, right? 

565
00:29:46,920 --> 00:29:49,960
Where does that go wrong? 
You know, I love books, you 

566
00:29:49,960 --> 00:29:52,120
know, and so The thing is, is 
that you, you, you learn about 

567
00:29:52,120 --> 00:29:53,320
these things and you're like, 
oh, wait a minute. 

568
00:29:53,320 --> 00:29:56,960
Well, if I know about it, then I
can take advantage of it, right?

569
00:29:56,960 --> 00:29:59,400
And that's, I think this is 
where it comes down to a lot of 

570
00:29:59,400 --> 00:30:02,080
different kinds of software. 
It's like you have to understand

571
00:30:02,080 --> 00:30:05,120
the thing that you're using. 
And if you do, you can squeeze 

572
00:30:05,120 --> 00:30:08,600
and speed out it. 
So bedrock story is how do I 

573
00:30:08,600 --> 00:30:10,520
take and, and keep these things 
straight? 

574
00:30:10,600 --> 00:30:12,800
We can get to that in the 
details of that if you'd like, 

575
00:30:13,920 --> 00:30:17,760
but we make it so that also it's
moving things quickly, right? 

576
00:30:18,920 --> 00:30:21,160
Well, so, so let's, let's walk 
through how how it works. 

577
00:30:21,400 --> 00:30:24,960
Foundation DB is what's called a
disaggregated database. 

578
00:30:25,160 --> 00:30:28,680
In other words, normally you 
have this monolithic thing. 

579
00:30:28,680 --> 00:30:31,880
I submit a query to things 
disappear inside it, right? 

580
00:30:31,880 --> 00:30:34,200
And it's one big process that 
goes through and chunks through 

581
00:30:34,200 --> 00:30:35,920
all these. 
Well, most of us know and then 

582
00:30:35,920 --> 00:30:39,320
deal with like, right? 
With like breathing? 

583
00:30:40,680 --> 00:30:43,800
Yep, like breathing like this is
this is, you know, we, we do it 

584
00:30:43,800 --> 00:30:46,280
without even, we're fish in a 
fish tank, We're not even 

585
00:30:46,280 --> 00:30:47,840
thinking about the water 
anymore, right? 

586
00:30:47,840 --> 00:30:50,200
We're just so used to it, right?
This is, this is the way things 

587
00:30:50,200 --> 00:30:53,360
are done. 
And so these foundation DB guys,

588
00:30:53,560 --> 00:30:56,480
they're really smart dudes. 
They, they basically said, OK, 

589
00:30:56,480 --> 00:30:58,640
well, how do we turn this 
problem on it's head? 

590
00:30:58,640 --> 00:31:00,880
How do we split it up so that we
can make this problem into 

591
00:31:00,880 --> 00:31:04,320
something that we can do across 
all these computers and still be

592
00:31:04,320 --> 00:31:07,160
safe? 
And what they figured out was 

593
00:31:07,160 --> 00:31:10,840
that you, you need to be able to
guarantee an order between two 

594
00:31:10,840 --> 00:31:12,680
things. 
So if you're making a change and

595
00:31:12,680 --> 00:31:14,560
I'm making a change, you know, 
there's two things. 

596
00:31:14,800 --> 00:31:16,720
Those two things can't happen at
the same time. 

597
00:31:16,720 --> 00:31:19,880
We need to have a kind of a 
logical concept of what, what 

598
00:31:19,880 --> 00:31:23,520
goes before what. 
So they have this idea of this 

599
00:31:23,520 --> 00:31:28,920
thing called a sequence, right? 
Everything gets a sequence 

600
00:31:28,920 --> 00:31:34,000
number. 
Wait, wait, wait. 

601
00:31:34,520 --> 00:31:39,280
We might have. 
OK, we lost you for a second. 

602
00:31:41,040 --> 00:31:45,080
Oh, I I think your Internet just
got a little laggy, but just 

603
00:31:45,080 --> 00:31:47,240
talk about sequence order from 
the start again, yeah. 

604
00:31:47,920 --> 00:31:50,120
Sure. 
So, so sequence order like we 

605
00:31:50,120 --> 00:31:53,760
have to be able to, to, to, we 
have to understand that things 

606
00:31:53,760 --> 00:31:55,560
happen in a particular order, 
right? 

607
00:31:55,560 --> 00:31:58,720
So I'm going to do this debit 
and then there's a credit. 

608
00:31:59,400 --> 00:32:01,280
Things might be different if I 
did the, you know, the credit 

609
00:32:01,280 --> 00:32:03,600
before the debit. 
Like it matters, right? 

610
00:32:03,600 --> 00:32:05,960
And we certainly don't want 
things happening at the same 

611
00:32:05,960 --> 00:32:09,720
time. 
It's OK if they appear to, if 

612
00:32:09,720 --> 00:32:11,640
they're not touching the same 
things, but for certain for 

613
00:32:11,640 --> 00:32:14,160
things that are touching the 
same pieces of data, they need 

614
00:32:14,160 --> 00:32:17,680
to happen in a particular order.
So they realized this and they 

615
00:32:17,680 --> 00:32:20,240
said, OK, fine, we're going to, 
we need a concept of a sequence.

616
00:32:20,560 --> 00:32:24,360
Great. 
So they, they, they have that. 

617
00:32:24,600 --> 00:32:27,280
Then then individual clients 
need to be able to read data, 

618
00:32:27,960 --> 00:32:29,240
right? 
So when I set up a transaction, 

619
00:32:29,240 --> 00:32:30,880
I need to be able to, I need to 
be able to read this stuff. 

620
00:32:30,880 --> 00:32:33,600
So what they do is they say, OK,
well, when I do a read, I'm 

621
00:32:33,600 --> 00:32:36,520
going to do a read at a 
particular sequence number. 

622
00:32:36,520 --> 00:32:39,640
So first thing I do if I want to
start doing anything is I get a 

623
00:32:39,640 --> 00:32:42,520
sequence and I say, OK, this is,
this is the version of the 

624
00:32:42,520 --> 00:32:46,040
system, right, that I'm going to
look at. 

625
00:32:46,680 --> 00:32:49,080
This is my snapshot. 
We can imagine that everything 

626
00:32:49,080 --> 00:32:52,600
is frozen in time, right At that
point, right? 

627
00:32:52,600 --> 00:32:54,920
This is the point I'm going to 
look at and I'm going to go ask 

628
00:32:54,920 --> 00:32:56,840
questions. 
I'm going to say, hey, you know,

629
00:32:56,920 --> 00:32:58,840
I want to read this key. 
I'm gonna read this key. 

630
00:32:58,840 --> 00:33:01,400
At that point, I'm gonna, you 
know, I'm gonna write something.

631
00:33:01,400 --> 00:33:03,320
I'm gonna write it. 
It'll happen right after that 

632
00:33:03,320 --> 00:33:05,360
point. 
What does that do? 

633
00:33:05,360 --> 00:33:08,000
Like this just sounds like now 
you have to manage all these 

634
00:33:08,000 --> 00:33:12,200
copies of a entire database, OK?
Yes, and we're gonna get there. 

635
00:33:12,200 --> 00:33:14,320
And it's really, it's really 
sick, right? 

636
00:33:14,320 --> 00:33:17,120
So here's what happens. 
So I'm, I'm reading. 

637
00:33:17,160 --> 00:33:19,680
I'm reading things happily, 
right? 

638
00:33:19,680 --> 00:33:22,200
I, I said, OK, all these things,
I read it at a particular 

639
00:33:22,200 --> 00:33:25,520
version, so that's important. 
I read key A at this version, 

640
00:33:25,520 --> 00:33:27,640
key B at this version. 
Cool, great. 

641
00:33:28,160 --> 00:33:29,720
Now I'm going to make some 
decisions. 

642
00:33:29,800 --> 00:33:33,360
If we're doing anything useful, 
if I'm just doing a read only 

643
00:33:33,360 --> 00:33:35,040
transaction, it doesn't matter 
at all, right? 

644
00:33:35,040 --> 00:33:36,240
We're done. 
Like I've looked at my 

645
00:33:36,240 --> 00:33:39,000
consistent snapshot. 
Things aren't if I read the same

646
00:33:39,000 --> 00:33:42,240
key multiple times, they're all 
read the same version. 

647
00:33:42,240 --> 00:33:44,400
Nothing's changing. 
I'm not seeing half of somebody 

648
00:33:44,400 --> 00:33:46,600
else's data. 
I see a consistent picture. 

649
00:33:46,960 --> 00:33:49,600
You can think about this in a 
sequel database. 

650
00:33:49,600 --> 00:33:52,120
We get the same thing when we 
create a transaction. 

651
00:33:52,520 --> 00:33:55,120
And depending on the isolation 
level, like if, if, if I have a,

652
00:33:55,120 --> 00:33:59,160
you know, full isolation, then 
when I'm making changes, I see 

653
00:33:59,160 --> 00:34:00,960
my own changes, but I don't see 
other people. 

654
00:34:01,520 --> 00:34:05,680
I don't see your half baked, you
know, import of something until 

655
00:34:05,680 --> 00:34:08,000
it's done right. 
So we have this idea of 

656
00:34:08,440 --> 00:34:10,320
atomicity. 
You know, this is the a, an 

657
00:34:10,320 --> 00:34:14,679
acid, right? 
So how Foundation DB gets there 

658
00:34:14,719 --> 00:34:17,159
and how Bedrock does it too is 
you have a version that you're 

659
00:34:17,159 --> 00:34:18,679
reading at? 
I'm reading, reading, reading, 

660
00:34:18,840 --> 00:34:21,760
and then I make decisions. 
So there's logic that's 

661
00:34:21,760 --> 00:34:23,600
involved. 
You know, it's I'm doing a 

662
00:34:23,600 --> 00:34:26,520
debit, right? 
I'm going to update other keys 

663
00:34:26,520 --> 00:34:29,199
based on the things I read. 
So I'm going to do a thing. 

664
00:34:29,239 --> 00:34:32,280
I'm going to read some data. 
I'm going to subtract 50 from 

665
00:34:32,280 --> 00:34:33,239
it. 
I'm going to come up with a New 

666
00:34:33,239 --> 00:34:34,800
Balance. 
The New Balance is what I want 

667
00:34:34,800 --> 00:34:36,679
to save, right? 
This is important. 

668
00:34:37,280 --> 00:34:41,199
And so now we have a thing that 
can conflict, right? 

669
00:34:41,199 --> 00:34:43,080
So when I have, when I, when I 
put together my little 

670
00:34:43,080 --> 00:34:45,320
transaction here, I keep track 
of all the things that I've read

671
00:34:45,320 --> 00:34:49,159
and at what version and what 
keys I want to change, right? 

672
00:34:49,159 --> 00:34:52,840
I submit that to the system, the
system Now, like you said, we've

673
00:34:52,840 --> 00:34:55,800
got copies of these things. 
We need to reconcile this, 

674
00:34:56,600 --> 00:34:57,720
right? 
How does this work? 

675
00:34:58,320 --> 00:35:03,040
And So what it does is there's 
some, some some services called 

676
00:35:03,040 --> 00:35:05,120
the resolvers that are in this 
process. 

677
00:35:05,400 --> 00:35:08,200
And what it does is it they 
basically say, OK, well, we're 

678
00:35:08,200 --> 00:35:10,120
going to take these two things 
and we're going to check them. 

679
00:35:10,520 --> 00:35:15,760
And the question is, is did this
transaction read or write any of

680
00:35:15,760 --> 00:35:18,800
the keys that this guy needed? 
Right. 

681
00:35:18,800 --> 00:35:21,800
And if the answer's no, then 
they don't touch and they can 

682
00:35:21,800 --> 00:35:24,320
both sail through. 
They can happen in either order.

683
00:35:24,320 --> 00:35:26,320
It wouldn't matter. 
OK, right. 

684
00:35:26,840 --> 00:35:30,120
So no follow me. 
It flows through and they. 

685
00:35:30,280 --> 00:35:32,800
Can both touch sail? 
On they can both touch the same 

686
00:35:32,800 --> 00:35:34,760
row or key. 
At this point, they. 

687
00:35:34,760 --> 00:35:38,680
Can read the same things, right?
But if one, if somebody writes 

688
00:35:38,680 --> 00:35:41,640
something that you read, so 
let's say at version zero, you 

689
00:35:41,640 --> 00:35:45,920
know, you read a key A, right, 
version 0A, right. 

690
00:35:45,920 --> 00:35:49,320
And you and somebody goes along 
and while you're doing your 

691
00:35:49,320 --> 00:35:54,480
computation, somebody writes A 
at version 5, right? 

692
00:35:55,080 --> 00:35:56,400
So this happens. 
A has changed. 

693
00:35:56,760 --> 00:36:00,920
Now when we go to reconcile your
your transaction, we're going to

694
00:36:00,920 --> 00:36:04,120
say we read A at 5. 
We made decisions and you know, 

695
00:36:04,120 --> 00:36:07,280
all the decisions are based on 
the fact we read A at 0, excuse 

696
00:36:07,280 --> 00:36:09,760
me, and somebody changed it. 
So because there's an 

697
00:36:09,760 --> 00:36:12,120
intervening change, we know 
there's a conflict. 

698
00:36:13,280 --> 00:36:15,600
I see. 
You follow me. 

699
00:36:16,000 --> 00:36:18,440
Yep. 
So like, you know, so like you 

700
00:36:19,280 --> 00:36:20,760
think about it with people, 
right? 

701
00:36:20,760 --> 00:36:23,400
I, I, you know, you're basic. 
I'm going to give you some 

702
00:36:23,400 --> 00:36:25,400
information, right? 
You're, you're, you're, you're 

703
00:36:25,400 --> 00:36:27,320
going to make some decisions 
based on it, right? 

704
00:36:27,520 --> 00:36:29,360
And then somebody comes along 
and does something to one of 

705
00:36:29,360 --> 00:36:32,280
those underlying pieces of 
information, right? 

706
00:36:32,840 --> 00:36:34,760
You're, what you've done is now 
suspect. 

707
00:36:34,760 --> 00:36:37,440
It's not right anymore, right? 
Somebody beat you to it. 

708
00:36:38,600 --> 00:36:40,680
Two people pulling money on the 
same bank account. 

709
00:36:41,040 --> 00:36:44,920
Deciding how to do cash like 
that's a very difficult problem.

710
00:36:45,360 --> 00:36:47,760
Yeah, sure. 
Perfect, right. 

711
00:36:47,760 --> 00:36:51,800
So like, you know, you have this
situation where it's like, I, I 

712
00:36:51,800 --> 00:36:55,200
need to know, like the database 
needs to know, did anybody touch

713
00:36:55,200 --> 00:36:57,520
the things that this, this set 
of decisions was based on? 

714
00:36:57,520 --> 00:36:59,680
And if the answer's no, great, 
sail through. 

715
00:36:59,720 --> 00:37:01,320
Awesome. 
That's most the case. 

716
00:37:01,600 --> 00:37:05,720
So the thing that the foundation
DB people got that they 

717
00:37:05,720 --> 00:37:08,520
understood was that lots of 
these changes to the system 

718
00:37:08,760 --> 00:37:11,480
don't have anything to do with 
one another at all. 

719
00:37:12,320 --> 00:37:14,440
Most of them, in fact. 
Right? 

720
00:37:14,440 --> 00:37:16,920
If I've got a user over here and
a user over there and they're 

721
00:37:16,920 --> 00:37:19,680
screwing with their own data, 
man, none of that touching. 

722
00:37:19,920 --> 00:37:21,120
Like. 
You're in your own, you're not 

723
00:37:21,120 --> 00:37:22,800
colliding. 
You're right. 

724
00:37:22,800 --> 00:37:24,800
You're doing your own thing. 
And like where what needs, what 

725
00:37:24,800 --> 00:37:26,960
you need to be able to do is you
need to be able to figure out 

726
00:37:26,960 --> 00:37:30,080
when that's happening and then 
what to do about it, right? 

727
00:37:30,080 --> 00:37:33,120
And so their answer in this 
situation is really shockingly 

728
00:37:33,120 --> 00:37:35,360
simple. 
You basically do this. 

729
00:37:35,360 --> 00:37:38,240
You say, OK, fine. 
Well, we found out that I read 

730
00:37:38,240 --> 00:37:41,520
this key at a particular value. 
Jacob changed it, right? 

731
00:37:41,520 --> 00:37:43,720
I want to do something that was 
based on that information. 

732
00:37:44,640 --> 00:37:46,520
I can't do that. 
It basically figures out that 

733
00:37:46,520 --> 00:37:49,560
there's a conflict the first 
time first conflict and not not 

734
00:37:49,560 --> 00:37:53,440
which ones, just that there's a 
conflict it it just rejects the 

735
00:37:53,440 --> 00:37:56,120
transaction says no, can't do 
it, no good. 

736
00:37:56,520 --> 00:37:57,880
And then you now how that 
service. 

737
00:37:58,000 --> 00:38:01,240
Fetch the data or. 
Yeah, you basically redo it. 

738
00:38:01,400 --> 00:38:05,040
Now, what's kind of interesting 
is in Elixir you can just, you 

739
00:38:05,040 --> 00:38:08,200
know, I have a transaction, I 
pass a, a block, I pass a, a 

740
00:38:08,200 --> 00:38:10,280
function, right, that does the 
actual work. 

741
00:38:10,280 --> 00:38:12,760
It reads and does all the 
reading and does all the 

742
00:38:12,760 --> 00:38:14,920
writing, right. 
And then and it's done. 

743
00:38:14,920 --> 00:38:17,040
It's going to go ahead and 
submit the transaction. 

744
00:38:17,040 --> 00:38:18,640
This is all done by the 
machinery for you. 

745
00:38:19,000 --> 00:38:23,360
And if there's a conflict, what 
it will automatically do is just

746
00:38:24,000 --> 00:38:26,040
rerun your function. 
I'm curious. 

747
00:38:26,040 --> 00:38:30,720
Simple like when you're running 
like a database transaction at 

748
00:38:30,720 --> 00:38:35,320
least like in a post address 
world like you can lock a row or

749
00:38:35,320 --> 00:38:37,120
lock a table, right? 
How? 

750
00:38:37,200 --> 00:38:40,320
How would that work as bedrock? 
You don't, you don't. 

751
00:38:40,360 --> 00:38:44,160
And So what happens is what what
happens is you basically things 

752
00:38:44,160 --> 00:38:46,800
either conflict or they don't, 
right is what happens. 

753
00:38:46,800 --> 00:38:50,200
And so, so if I'm, if I'm I'm 
going to go, you know, we're 

754
00:38:50,200 --> 00:38:51,480
both going to go start a 
transaction. 

755
00:38:51,480 --> 00:38:53,040
We're trying to take money out 
of an account, right? 

756
00:38:53,240 --> 00:38:55,520
You read the balance. 
I read the balance right. 

757
00:38:55,520 --> 00:38:58,360
We both decide that there's 20 
bucks in there and you're going 

758
00:38:58,360 --> 00:39:00,520
to pull out all 20 and I only 
want to pull out 10. 

759
00:39:00,800 --> 00:39:03,520
But obviously both of them can't
happen, right? 

760
00:39:03,760 --> 00:39:06,560
One or the other has to happen. 
So now you know, let's say 

761
00:39:06,560 --> 00:39:10,120
you're a little faster and you 
get yours in there first, right?

762
00:39:10,240 --> 00:39:13,480
What happens is, is I see mine 
at the at the same or older 

763
00:39:13,480 --> 00:39:15,560
version. 
I my change wants to happen 

764
00:39:15,560 --> 00:39:17,480
after yours. 
What we see is that there's a 

765
00:39:17,480 --> 00:39:21,000
conflicting key, right? 
And then mine gets rejected and 

766
00:39:21,000 --> 00:39:25,120
so then my code runs again. 
I pull the balance, the New 

767
00:39:25,120 --> 00:39:28,160
Balance which I read is going to
be 0 because you took all 20. 

768
00:39:28,160 --> 00:39:29,360
Bucks and you're like shit, 
right? 

769
00:39:29,400 --> 00:39:31,080
We got robbed. 
Well, and then I just, well, 

770
00:39:31,080 --> 00:39:33,400
then it, what, what happens is 
instead of a database error, it 

771
00:39:33,400 --> 00:39:36,240
turns into an application error 
where it's like, oh, sorry, 

772
00:39:36,240 --> 00:39:38,560
there's not enough balance in 
here, right. 

773
00:39:38,560 --> 00:39:41,760
And so it's it the code for a 
bedrock, you know, when, when 

774
00:39:41,760 --> 00:39:45,360
you're working with it reads 
really nicely because I get the 

775
00:39:45,360 --> 00:39:47,440
information that I'm basing my 
decisions on. 

776
00:39:47,640 --> 00:39:50,280
And then I do things and then 
the whole thing either happens 

777
00:39:50,280 --> 00:39:53,760
or it doesn't, right? 
And if there's a conflict, my 

778
00:39:53,760 --> 00:39:57,560
code runs again, right? 
I, I read the values and, oh, 

779
00:39:57,680 --> 00:39:59,200
this time there's no money in 
there. 

780
00:39:59,200 --> 00:40:02,320
Well, I just returned. 
Sorry, Jacob, you know I took 

781
00:40:02,320 --> 00:40:04,200
out the money. 
I'm all right. 

782
00:40:04,200 --> 00:40:06,920
So this is all happening. 
We have a distributed system, 

783
00:40:06,920 --> 00:40:13,800
all these nodes, right? 
Where, where does the, the, the,

784
00:40:14,240 --> 00:40:16,840
the truth? 
Where Where does everything sit?

785
00:40:17,440 --> 00:40:20,480
Because that can't Can you pick 
a master node or what's 

786
00:40:20,480 --> 00:40:23,720
happening? 
So what, what the, the, the, the

787
00:40:23,720 --> 00:40:27,800
trick that foundation DB pulls 
and we ape is that they, they 

788
00:40:27,800 --> 00:40:33,200
realize that you actually don't 
need a tremendous amount of like

789
00:40:33,320 --> 00:40:37,360
coordination once you've got 
the, the basic pieces of the 

790
00:40:37,360 --> 00:40:40,880
system set up and wired, right? 
So now imagine this I've got, 

791
00:40:42,120 --> 00:40:44,080
we've got this, this, this 
commit proxy. 

792
00:40:44,080 --> 00:40:46,600
This is the thing that sits in 
the in this is what I submit my 

793
00:40:46,600 --> 00:40:48,480
transactions to as a user, 
right? 

794
00:40:48,840 --> 00:40:50,600
I've got some number of them in 
the system. 

795
00:40:50,600 --> 00:40:56,440
They're well known if it's going
to talk to the resolver, it 

796
00:40:56,440 --> 00:40:57,960
knows about the resolver. 
That's cool. 

797
00:40:58,000 --> 00:41:00,720
All these pieces are wired 
together and the information can

798
00:41:00,720 --> 00:41:03,880
flow really quickly. 
What Foundation DB realized is 

799
00:41:03,880 --> 00:41:08,240
that that under the normal 
static state of a system, right,

800
00:41:08,240 --> 00:41:10,040
things can flow. 
We don't have to figure out, you

801
00:41:10,040 --> 00:41:13,000
know, is this guy still up? 
There's all these complicated 

802
00:41:13,000 --> 00:41:14,840
things that you that could go 
wrong, right? 

803
00:41:15,280 --> 00:41:19,120
So what they figured out is that
instead of trying to come up 

804
00:41:19,120 --> 00:41:22,560
with all of these different 
compensations for all of these 

805
00:41:22,560 --> 00:41:25,240
edge cases, they do something 
really simple. 

806
00:41:25,240 --> 00:41:29,880
They say, OK, we'll run the way 
we're going to run until there's

807
00:41:29,880 --> 00:41:32,880
a problem, right? 
So I, I'm a commit proxy. 

808
00:41:32,880 --> 00:41:34,720
I try to talk to it, it's 
broken. 

809
00:41:35,480 --> 00:41:38,080
You know, there's a problem. 
The commit proxy tries to talk 

810
00:41:38,080 --> 00:41:39,840
to the resolver. 
Resolver is broken. 

811
00:41:40,160 --> 00:41:43,000
There's a problem resolver. 
You get the idea that you're 

812
00:41:43,000 --> 00:41:45,920
going to pass to the logs. 
You know, there's a problem. 

813
00:41:46,320 --> 00:41:49,920
So what, it's what their whole 
trick was, is to figure out that

814
00:41:49,920 --> 00:41:53,280
like when something goes wrong, 
to realize it, to have something

815
00:41:53,280 --> 00:41:55,680
that's kind of watching these 
things to realize that there's a

816
00:41:55,680 --> 00:41:58,000
problem. 
Mark the system is invalid. 

817
00:41:58,280 --> 00:42:02,960
Stop everything, tear it all 
down, put it all back together 

818
00:42:02,960 --> 00:42:06,400
again. 
Very OTP, very supervision tree,

819
00:42:06,920 --> 00:42:08,520
right? 
Set up the supervision tree of 

820
00:42:08,520 --> 00:42:11,880
these processes again and then 
let it RIP again. 

821
00:42:12,360 --> 00:42:16,280
And so it's it's the model fits 
on the beam so well. 

822
00:42:17,760 --> 00:42:21,360
Yeah, No, it sounds like, yeah, 
I do have a question, but we're 

823
00:42:21,360 --> 00:42:25,880
going to take a quick break for 
ads and then I have my question.

824
00:42:25,880 --> 00:42:26,680
All right, cool. 
I will I. 

825
00:42:27,000 --> 00:42:29,640
Will I will. 
Coding Elixir with AI or 

826
00:42:29,640 --> 00:42:31,640
building AI into your Elixir 
apps? 

827
00:42:31,880 --> 00:42:35,360
The Elixir AI Collective Discord
is your community for both. 

828
00:42:35,480 --> 00:42:40,400
Link in the description below. 
Hey, I'm Kimberly with Elixir 

829
00:42:40,400 --> 00:42:43,920
mentor Jacob recently added 
recruitment services to help 

830
00:42:43,920 --> 00:42:46,120
companies hire pre vetted Elixir
devs. 

831
00:42:46,720 --> 00:42:49,840
I help with company outreach, so
if you're hiring, I may be 

832
00:42:49,880 --> 00:42:52,840
reaching out, or you can connect
with us anytime at 

833
00:42:52,840 --> 00:42:58,080
elixirmentor.com. 
We're going back, all right. 

834
00:42:58,680 --> 00:43:05,680
So my question now is like still
kind of going back to like where

835
00:43:05,680 --> 00:43:09,920
is our central point of truth 
for state, right? 

836
00:43:10,600 --> 00:43:15,440
Because we have nodes and they 
all have to stay updated with 

837
00:43:15,640 --> 00:43:19,560
the current data, right? 
Or maybe they don't. 

838
00:43:21,320 --> 00:43:23,040
They do and they don't. 
So here's what happens. 

839
00:43:23,200 --> 00:43:25,520
Think about if I got. 
Let's think about the simple 

840
00:43:25,520 --> 00:43:27,440
case. 
I got one machine, right? 

841
00:43:27,720 --> 00:43:29,600
I got a commit proxy. 
It needs to resolve 

842
00:43:29,600 --> 00:43:31,920
transactions, right? 
If I'm doing this all on one 

843
00:43:31,920 --> 00:43:35,200
machine, I have a commit proxy. 
I want to hand it a, a, a 

844
00:43:35,200 --> 00:43:36,800
transaction. 
You're going to hand it a 

845
00:43:36,800 --> 00:43:38,760
transaction. 
It's going to try and sort these

846
00:43:38,760 --> 00:43:40,920
things out, right? 
So what it's going to do is it's

847
00:43:40,920 --> 00:43:42,960
going to handle that transaction
to a resolver and says it was 

848
00:43:42,960 --> 00:43:46,960
anything in the last seconds 
touched this in such a way that 

849
00:43:46,960 --> 00:43:49,760
would cause a conflict. 
And if the answer is no, then it

850
00:43:49,760 --> 00:43:52,200
moves on to the logs. 
And if it gets logged as 

851
00:43:52,200 --> 00:43:54,320
something that actually 
happened, right? 

852
00:43:54,600 --> 00:43:57,240
And then from there it goes to 
storage and then we're answering

853
00:43:57,240 --> 00:44:00,320
questions again, you know, so, 
so I go from commit to 

854
00:44:00,320 --> 00:44:03,640
resolution to the log, to the 
the write ahead log. 

855
00:44:03,640 --> 00:44:07,840
And then the storage machines 
read from the log and then 

856
00:44:07,840 --> 00:44:10,960
project that for people to read 
questions again. 

857
00:44:10,960 --> 00:44:14,360
What is the difference in need? 
Like what the log state versus 

858
00:44:14,360 --> 00:44:16,320
storage? 
What are? 

859
00:44:16,440 --> 00:44:20,600
The two jobs there fair enough. 
And so The thing is, is that 

860
00:44:20,600 --> 00:44:25,000
like we mentioned that things 
have to happen in order, right? 

861
00:44:25,320 --> 00:44:27,600
There's, there's has to be an 
order to things and we have to 

862
00:44:27,600 --> 00:44:31,120
agree on it, right? 
So I, I go to submit a 

863
00:44:31,120 --> 00:44:34,320
transaction, that transaction 
gets stamped with the number, 

864
00:44:34,400 --> 00:44:38,520
the sequence number, right? 
It gets resolved when the 

865
00:44:38,520 --> 00:44:41,720
resolution happens. 
And if happy path, everything is

866
00:44:41,720 --> 00:44:43,280
cool, it's going to go to the 
log. 

867
00:44:43,320 --> 00:44:45,840
That's where it's recorded for 
posterity. 

868
00:44:45,840 --> 00:44:48,440
So the log system is looking at 
this and going like, oh, I'm 

869
00:44:48,440 --> 00:44:51,440
waiting for a transaction 
greater than 3 right. 

870
00:44:51,720 --> 00:44:54,280
And then, OK, cool. 
I'm waiting for now 4, now 5, 

871
00:44:54,280 --> 00:44:56,440
now 6 now 7. 
And we're going to go ahead and 

872
00:44:56,440 --> 00:44:59,800
write those to disk. 
So the log's job is to take all 

873
00:44:59,800 --> 00:45:02,920
the transactions that have been 
agreed upon like the everybody 

874
00:45:02,920 --> 00:45:05,280
has these don't conflict. 
This is cool. 

875
00:45:06,200 --> 00:45:08,920
Their job is to write them to 
disk as fast as possible. 

876
00:45:08,920 --> 00:45:12,480
Just put it on the disk. 
And so as soon as that stuff is 

877
00:45:12,480 --> 00:45:14,480
written to disk, that's on the 
record. 

878
00:45:15,280 --> 00:45:16,800
That's that's the way things 
happen. 

879
00:45:17,120 --> 00:45:20,320
Now, if I have a multiple, 
multiple of these logs, right, 

880
00:45:20,320 --> 00:45:22,960
I, I send the same information 
to each one of them, It's 

881
00:45:22,960 --> 00:45:26,200
replicated onto each one. 
As soon as I get an answer from 

882
00:45:26,200 --> 00:45:29,240
all of them, then I know that 
that stuff is cool and it's safe

883
00:45:30,400 --> 00:45:33,200
right? 
Now, the storage system, it 

884
00:45:33,200 --> 00:45:35,560
reads from those logs. 
It basically says like, hey, the

885
00:45:35,560 --> 00:45:37,800
last thing I got from you was 
three. 

886
00:45:38,040 --> 00:45:40,000
Let me read from three on, 
right? 

887
00:45:40,000 --> 00:45:43,360
And it gets and it applies those
transactions to it's in memory 

888
00:45:43,360 --> 00:45:46,080
state, right? 
So it's taking those things that

889
00:45:46,080 --> 00:45:49,280
we agreed upon and it's keeping 
track of them and saying, OK, 

890
00:45:49,520 --> 00:45:52,280
version 5 is this change. 
Version 6 is this change. 

891
00:45:52,280 --> 00:45:55,080
Version 7 is this change. 
So when you go and ask a 

892
00:45:55,080 --> 00:45:58,440
question to the storage, you're 
asking it at a particular 

893
00:45:58,440 --> 00:45:59,920
version. 
Do you see what I'm saying? 

894
00:46:00,440 --> 00:46:01,440
Yes. 
Follow me. 

895
00:46:02,000 --> 00:46:04,560
So when we started off, first 
thing we did, I'm going to go 

896
00:46:04,560 --> 00:46:06,680
ahead and we're going to move 
money from one place to another,

897
00:46:06,880 --> 00:46:08,960
right? 
We get a transaction number. 

898
00:46:08,960 --> 00:46:10,880
We say this is the read version 
for the system. 

899
00:46:10,880 --> 00:46:12,600
This is where we're going to 
read at right? 

900
00:46:12,600 --> 00:46:15,960
When I then I ask the storage 
server directly, hey give me 

901
00:46:15,960 --> 00:46:18,240
this key at this version it's 
going to do. 

902
00:46:18,240 --> 00:46:20,920
It and it doesn't matter if 
another version already exists. 

903
00:46:21,720 --> 00:46:24,080
Nope, Newark. 
It gives you the one picture 

904
00:46:24,080 --> 00:46:25,920
that you're asking. 
For yeah, OK. 

905
00:46:26,160 --> 00:46:28,040
Right. 
So it keeps track of and so now 

906
00:46:28,080 --> 00:46:32,840
you can't do this forever back. 
So Foundation DB famously has 

907
00:46:32,840 --> 00:46:37,360
this, the 5 second rule, right? 
And So what it does? 

908
00:46:37,400 --> 00:46:40,920
Basically. 
Very much the same thing, right?

909
00:46:40,920 --> 00:46:43,960
So the idea here is that it 
keeps track of basically the 

910
00:46:43,960 --> 00:46:46,040
last five seconds worth of 
transactions. 

911
00:46:46,920 --> 00:46:49,200
And anything older than that, 
like if you go to submit a 

912
00:46:49,200 --> 00:46:52,480
transaction, it's older than 5 
seconds, it just says no, let's 

913
00:46:52,480 --> 00:46:54,880
too old. 
I can't, I can't check it, 

914
00:46:55,000 --> 00:46:57,440
right? 
And so it keeps track of five 

915
00:46:57,440 --> 00:47:00,000
seconds worth of information. 
So this information is 

916
00:47:00,000 --> 00:47:02,760
constantly being flushed out. 
So you can see that like when 

917
00:47:02,760 --> 00:47:05,320
I'm doing resolution, the 
resolver only has to keep track 

918
00:47:05,320 --> 00:47:07,160
of five seconds worth of stuff, 
right? 

919
00:47:07,160 --> 00:47:10,760
The logs, that's posterity. 
And then the storage boxes only 

920
00:47:10,760 --> 00:47:13,520
have to keep track of five 
seconds worth of versions to 

921
00:47:13,520 --> 00:47:17,760
read right after that window, 
that stuff's on the disk. 

922
00:47:17,800 --> 00:47:20,560
It's there for good, right? 
You can you can consider. 

923
00:47:20,560 --> 00:47:24,440
That like you just dump 
everything after the five second

924
00:47:24,440 --> 00:47:26,880
window. 
Yeah, it just throws. 

925
00:47:26,920 --> 00:47:32,080
So what happens is it flattens. 
You can think of like a good 

926
00:47:32,080 --> 00:47:35,240
mental model's git, right? 
I, I, each one of these 

927
00:47:35,240 --> 00:47:39,760
transactions is a commit, right?
We have to agree on what order 

928
00:47:39,760 --> 00:47:41,760
they go in on, right? 
So, you know, I'm going to 

929
00:47:41,760 --> 00:47:43,520
commit, I'm going to commit, I'm
going to commit, I'm going to 

930
00:47:43,520 --> 00:47:45,280
commit. 
These are each changing things, 

931
00:47:45,400 --> 00:47:47,200
right? 
And we, we can agree on the 

932
00:47:47,200 --> 00:47:48,840
particular order at which it 
happens. 

933
00:47:49,160 --> 00:47:51,840
And then what happens is that 
the five second mark things just

934
00:47:51,840 --> 00:47:54,800
start squashing, right? 
It starts squashing down right, 

935
00:47:55,240 --> 00:47:56,680
right. 
So you're you're basically just 

936
00:47:56,680 --> 00:47:59,360
like, you know, you can, you can
read it, but you can't like 

937
00:48:00,000 --> 00:48:04,000
distinguish a version, an 
individual version older than 

938
00:48:04,000 --> 00:48:06,480
the certain mark that that the 
five second mark, right? 

939
00:48:06,480 --> 00:48:07,960
It just like history just gets 
flat. 

940
00:48:08,040 --> 00:48:10,560
It like runs into a wall and 
just gets flat, right. 

941
00:48:11,160 --> 00:48:15,000
So like, does that make sense? 
Yeah, so is every node 

942
00:48:15,000 --> 00:48:19,800
constantly doing some sort of 
version message passing check 

943
00:48:19,800 --> 00:48:21,680
then? 
No. 

944
00:48:21,760 --> 00:48:23,640
And this is one of the clever 
things that they did. 

945
00:48:23,680 --> 00:48:26,480
They basically said, OK, we're 
going to have the sequence 

946
00:48:26,480 --> 00:48:28,080
number and it has to increase, 
right? 

947
00:48:28,080 --> 00:48:30,040
You know, it's always 
monotonically increasing. 

948
00:48:30,320 --> 00:48:36,040
So what they did is they took 
time in it's like microseconds, 

949
00:48:36,120 --> 00:48:38,720
like nanoseconds, microseconds. 
It's a time stamp. 

950
00:48:39,040 --> 00:48:41,600
And So what happens is the 
sequencer is we're handing out 

951
00:48:41,600 --> 00:48:43,840
these, these numbers, right? 
And they're time stamps. 

952
00:48:44,000 --> 00:48:47,640
So I can basically look without 
having to coordinate clocks, 

953
00:48:47,640 --> 00:48:48,680
without having to do any of this
stuff. 

954
00:48:48,840 --> 00:48:51,680
I can just look at this version 
and say like, is this 5 million 

955
00:48:51,680 --> 00:48:54,040
more than, you know, the oldest 
1? 

956
00:48:54,360 --> 00:48:56,840
And so things just fall off. 
It's, it's really truly 

957
00:48:56,840 --> 00:48:59,520
brilliant. 
I mean, the, the engineering 

958
00:48:59,520 --> 00:49:02,880
that these guys put into this is
just top notch. 

959
00:49:03,080 --> 00:49:05,760
I think the problem was, is that
like the material science that 

960
00:49:05,760 --> 00:49:09,080
the, the toys that they had to 
play with to build it in just 

961
00:49:09,080 --> 00:49:12,000
weren't really there to, to, to,
to see their vision out. 

962
00:49:12,000 --> 00:49:14,320
So they had to like come up with
this crazy stuff. 

963
00:49:14,320 --> 00:49:16,120
But the beam is a good fit 
today. 

964
00:49:16,560 --> 00:49:19,480
So you get this 5 second window,
right? 

965
00:49:19,600 --> 00:49:21,120
Stuff that kind of falls out 
after that. 

966
00:49:21,120 --> 00:49:24,040
The storage servers only need to
be able to answer versionable 

967
00:49:24,040 --> 00:49:26,160
questions, right for that 5 
seconds. 

968
00:49:26,160 --> 00:49:28,120
And then anything after that, 
it's just like, Oh yeah, well, I

969
00:49:28,120 --> 00:49:30,760
got the, I got the most recent 
value of that, no problem. 

970
00:49:31,240 --> 00:49:33,920
So they're not having to keep 
track of like every version 

971
00:49:33,920 --> 00:49:35,280
ever. 
There's a, there's a window. 

972
00:49:37,480 --> 00:49:41,360
Yeah, 5 second in space. 
So now did you copy that same 

973
00:49:41,920 --> 00:49:42,760
idea? 
Oh, same. 

974
00:49:43,400 --> 00:49:45,360
I, I stole the stuff straight 
up. 

975
00:49:46,160 --> 00:49:48,120
When you've got a good idea, you
roll with it, right? 

976
00:49:48,120 --> 00:49:51,960
You, you take, you know, it's, 
it's, it is the, the, the height

977
00:49:51,960 --> 00:49:53,920
of arrogance to think that you 
can completely improve on 

978
00:49:53,920 --> 00:49:55,640
something. 
I mean, generally around the 

979
00:49:55,640 --> 00:49:58,400
edges, but you know, when, when 
there's a good coherent idea, 

980
00:49:58,680 --> 00:50:01,680
right, you stick with it. 
So they have this idea where you

981
00:50:01,680 --> 00:50:03,960
get processes like these pieces 
you meant. 

982
00:50:04,080 --> 00:50:06,080
We, we talked about the the 
players were talking about. 

983
00:50:06,080 --> 00:50:08,920
We got to commit proxy the 
resolver with the logs. 

984
00:50:08,920 --> 00:50:10,880
We got storage. 
There's a couple of bit pullers 

985
00:50:10,880 --> 00:50:13,080
around the edges we're not going
to need to mention, but that's 

986
00:50:13,080 --> 00:50:15,680
the general idea. 
And we we wire them together and

987
00:50:16,200 --> 00:50:18,880
once they're wired together, 
that's the system's runtime. 

988
00:50:19,120 --> 00:50:21,560
It's going to run that way until
something breaks. 

989
00:50:22,040 --> 00:50:26,160
Now machine goes down, right, 
Something dies. 

990
00:50:26,520 --> 00:50:30,560
Now you got to think about like,
well, OK, I could have all these

991
00:50:30,560 --> 00:50:33,680
complicated retries. 
I can have all this, you know, 

992
00:50:34,040 --> 00:50:36,680
crazy stuff that's really hard 
to test because distributed 

993
00:50:36,680 --> 00:50:40,320
problems are hard. 
Or, and the answer they chose, I

994
00:50:40,320 --> 00:50:42,240
think was the, the, the 
brilliantly simple one. 

995
00:50:42,680 --> 00:50:46,440
It's basically OTP. 
They throw away the process tree

996
00:50:46,560 --> 00:50:49,600
and build a new one, right? 
So there's a, there's a, a, a, 

997
00:50:50,120 --> 00:50:53,920
a, a Singleton in the system of 
the cluster controller. 

998
00:50:54,240 --> 00:50:56,520
It's job is to just kind of keep
an eye on things. 

999
00:50:56,520 --> 00:50:59,520
And when it sees a problem or a 
problem is reported to it, it 

1000
00:50:59,520 --> 00:51:03,160
basically says, all right, this 
version of the system is no 

1001
00:51:03,160 --> 00:51:05,960
longer valid. 
Can't, can't, can't process 

1002
00:51:05,960 --> 00:51:08,240
transactions anymore and we're 
going to tear it down. 

1003
00:51:08,680 --> 00:51:10,160
What does that look like on the 
Beam? 

1004
00:51:10,160 --> 00:51:13,360
Is that a supervision tree or is
that like a Gen. server? 

1005
00:51:13,480 --> 00:51:16,440
How are you doing that? 
It is it, it, but, but it spans,

1006
00:51:16,680 --> 00:51:17,840
we're spanning the clusters, 
right? 

1007
00:51:17,840 --> 00:51:19,720
Because I mean, the different 
processes can run different 

1008
00:51:19,720 --> 00:51:22,280
places, right? 
But it's the same idea, right? 

1009
00:51:22,280 --> 00:51:24,400
I mean, if you think about it, 
it's a distributed supervision 

1010
00:51:24,400 --> 00:51:27,280
tree is essentially what 
Foundation DB built. 

1011
00:51:27,280 --> 00:51:30,920
They say, OK, we got this node. 
It's a cluster controller. 

1012
00:51:30,920 --> 00:51:32,600
It's keeping track of all these 
other guys. 

1013
00:51:32,840 --> 00:51:34,920
When something breaks, we're 
going to tear them down. 

1014
00:51:34,920 --> 00:51:38,120
We're going to stand back up, 
right, and then wire them 

1015
00:51:38,120 --> 00:51:39,800
together and then we can run 
things again. 

1016
00:51:40,360 --> 00:51:43,480
And So what they said is they 
said, OK, fine, if this process 

1017
00:51:43,480 --> 00:51:46,680
is, we're going to make it 
simple, this recovery process, 

1018
00:51:46,680 --> 00:51:49,200
we're going to make it simple. 
And we're going to make it so 

1019
00:51:49,200 --> 00:51:52,120
that it's really just, there's 
some straightforward rules that 

1020
00:51:52,120 --> 00:51:54,480
you can follow. 
So we tear the old system down, 

1021
00:51:54,880 --> 00:51:58,040
we stand up new processes on the
various machines to do this 

1022
00:51:58,040 --> 00:51:59,880
stuff. 
We wire them together, let them 

1023
00:51:59,880 --> 00:52:02,480
know about each other, and then 
once everything's up and running

1024
00:52:02,720 --> 00:52:04,840
right, we can launch 
transactions again. 

1025
00:52:04,840 --> 00:52:07,800
And then things will hum along 
happily until something breaks 

1026
00:52:07,800 --> 00:52:10,920
again. 
So with Foundation DP, this 

1027
00:52:10,920 --> 00:52:15,520
recovery process is designed to 
be simple and reproducible and, 

1028
00:52:15,680 --> 00:52:18,720
and, and correct. 
And so rather than trying to 

1029
00:52:18,720 --> 00:52:21,840
come up with every edge case, 
they take the BEAM philosophy 

1030
00:52:22,360 --> 00:52:26,120
OTP philosophy, which is like, 
oh, let it fail, let it, let it 

1031
00:52:26,200 --> 00:52:27,600
fail. 
We'll just tear it down and 

1032
00:52:27,600 --> 00:52:30,440
build new ones. 
So you can see how this fits 

1033
00:52:30,440 --> 00:52:34,080
neatly onto Elixir and Beam, 
right? 

1034
00:52:34,080 --> 00:52:37,400
So you got a cluster, there's a 
bunch of machines we got to 

1035
00:52:37,400 --> 00:52:40,080
agree on who's going to run the 
Singleton, right? 

1036
00:52:40,480 --> 00:52:50,560
So in, in foundation DB, they 
use, what is it not Raft the 

1037
00:52:50,600 --> 00:52:58,160
other one, they use a mechanism 
for determining which, which 

1038
00:52:58,840 --> 00:53:00,160
who's going to be the leader, 
right? 

1039
00:53:00,160 --> 00:53:03,040
So they, they elect a leader. 
We have this, we have a, a 

1040
00:53:03,040 --> 00:53:06,320
notion of that. 
And, and once we have that, we 

1041
00:53:06,320 --> 00:53:09,120
can, we can establish A 
Singleton and then the Singleton

1042
00:53:09,200 --> 00:53:11,840
stands up the cluster and then 
everybody can run right? 

1043
00:53:11,880 --> 00:53:16,040
In bedrock, we use raft. 
So the nodes, they dynamically 

1044
00:53:16,040 --> 00:53:18,680
discover each other. 
They say, oh, well, you know, I 

1045
00:53:18,680 --> 00:53:21,000
know who I'm talking to. 
We agree on a leader. 

1046
00:53:21,200 --> 00:53:23,560
The leader sets up a cluster 
controller cluster. 

1047
00:53:23,560 --> 00:53:26,040
Controller off. 
Coordinators. 

1048
00:53:26,640 --> 00:53:29,440
Oh, you mean the the algorithm. 
No, it's how is it? 

1049
00:53:29,840 --> 00:53:31,680
It's not raft. 
It's it's on the tip of my 

1050
00:53:31,680 --> 00:53:43,200
tongue. 
It's consensus algorithm. 

1051
00:53:43,440 --> 00:53:46,640
That's the one. 
It's, it's all, it's a funny 

1052
00:53:46,640 --> 00:53:48,760
paper. 
The paper for Paxos is really 

1053
00:53:48,760 --> 00:53:51,480
weird because the guy wrote it 
like it was, he's telling the 

1054
00:53:51,480 --> 00:53:54,680
story about these people on the 
Isle of Paxos and the island and

1055
00:53:54,680 --> 00:53:56,840
there's characters and 
inhabitants and that's how we 

1056
00:53:56,840 --> 00:53:59,440
wrote the paper. 
It's really quirky, but I, I, I 

1057
00:53:59,440 --> 00:54:01,320
misplaced it. 
But yeah, they're using Paxos, 

1058
00:54:01,320 --> 00:54:05,000
right? 
Which is up until Raft came 

1059
00:54:05,000 --> 00:54:06,480
along, that was kind of like the
thing. 

1060
00:54:06,560 --> 00:54:10,800
Raft is like a simplified, more 
straightforward, easier to 

1061
00:54:10,840 --> 00:54:15,760
understand consensus algorithm. 
And so the, the general point of

1062
00:54:15,760 --> 00:54:18,840
it is like, we've got a bunch of
machines we got to agree on on 

1063
00:54:18,840 --> 00:54:21,320
something, right? 
In this case, we're agreeing on 

1064
00:54:21,480 --> 00:54:25,240
who's going to start the system.
And once we have that, that can 

1065
00:54:25,240 --> 00:54:27,960
say, OK, I'm going to go tell 
people what to do. 

1066
00:54:28,240 --> 00:54:31,000
They're going to listen to me 
because I'm the guy, right? 

1067
00:54:31,040 --> 00:54:34,160
And then once all the pieces are
stood up, they're wired together

1068
00:54:34,440 --> 00:54:36,960
and then they just run until 
something breaks. 

1069
00:54:37,640 --> 00:54:40,520
And then the idea here is that 
when something breaks, we tear 

1070
00:54:40,520 --> 00:54:42,480
on the old system, we just do it
again. 

1071
00:54:42,520 --> 00:54:44,600
And so this is how, if you think
about it, that's how a 

1072
00:54:44,600 --> 00:54:47,840
supervision tree works. 
I've got a set of processes and 

1073
00:54:47,840 --> 00:54:51,120
they got children, right. 
And when something, something 

1074
00:54:51,120 --> 00:54:54,080
goes wrong in one of the 
children, we don't sit there and

1075
00:54:54,080 --> 00:54:55,640
try and figure out every little 
thing. 

1076
00:54:55,880 --> 00:54:58,000
We let it fail. 
We let things die. 

1077
00:54:58,000 --> 00:55:00,480
And then we have rules for how 
to build it back up again, 

1078
00:55:01,160 --> 00:55:03,440
right? 
It's, it's, it's extremely 

1079
00:55:03,440 --> 00:55:07,040
similar. 
So it fits nicely on, on, on 

1080
00:55:07,040 --> 00:55:11,160
this model. 
So bedrock is foundation DB on 

1081
00:55:11,160 --> 00:55:16,760
the beam and with some basic 
ideas moved around so that we're

1082
00:55:16,760 --> 00:55:18,880
we're not having to because I 
mean, they're all written T and 

1083
00:55:18,880 --> 00:55:20,800
stuff. 
So you can modify data, you can 

1084
00:55:20,880 --> 00:55:24,000
keep the immutable things are 
happening and you can do you 

1085
00:55:24,000 --> 00:55:26,280
have to do things a little bit 
differently. 

1086
00:55:26,880 --> 00:55:30,360
But the the compromises actually
make the system run faster. 

1087
00:55:30,360 --> 00:55:32,920
Because now one of the things 
that people try really hard to 

1088
00:55:32,920 --> 00:55:35,240
do in some of these things is 
get to 0 copy. 

1089
00:55:35,720 --> 00:55:38,320
The more time when copying 
things around, the slower it 

1090
00:55:38,320 --> 00:55:41,720
gets and so zero copy is it's. 
Wonderful, right? 

1091
00:55:41,720 --> 00:55:45,280
It's extra work that you can't 
control much of either. 

1092
00:55:45,280 --> 00:55:46,800
It's just background. 
Right. 

1093
00:55:47,360 --> 00:55:51,240
So the idea here is, is that the
fast, the ideal number of times 

1094
00:55:51,240 --> 00:55:53,400
I can copy something is 0, 
right? 

1095
00:55:53,440 --> 00:55:57,240
And so if you're in the beam, if
you make a binary and you set it

1096
00:55:57,240 --> 00:56:00,520
up properly, you encode all the 
little bits and stuff, you see 

1097
00:56:00,520 --> 00:56:03,280
what I'm saying, right? 
You get it out. 

1098
00:56:03,280 --> 00:56:05,000
It just kind of falls out for 
free. 

1099
00:56:05,720 --> 00:56:08,840
And so now you get the system 
right. 

1100
00:56:09,040 --> 00:56:12,320
So you got this idea here where 
you got this disaggregated 

1101
00:56:12,320 --> 00:56:14,120
system. 
It's got this really simple 

1102
00:56:14,120 --> 00:56:16,720
model for standing itself up, 
right? 

1103
00:56:17,480 --> 00:56:20,440
There's a, there's a very clear 
path for information to flow. 

1104
00:56:20,680 --> 00:56:23,240
It can flow in such a way that 
until it has to leave that 

1105
00:56:23,240 --> 00:56:26,440
computer, there's no copying. 
So if you're running everything 

1106
00:56:26,440 --> 00:56:28,720
on one note, it's moving from 
process to process to process to

1107
00:56:28,720 --> 00:56:31,840
process to the disk, right? 
Super fast. 

1108
00:56:32,840 --> 00:56:35,200
But if, if you got, if you got 
to move it across the network, 

1109
00:56:35,360 --> 00:56:37,560
moves across the network. 
But again, the minimal number of

1110
00:56:37,560 --> 00:56:42,400
times and so you have this, it 
fits well and it actually can 

1111
00:56:42,400 --> 00:56:46,560
can go really fast. 
Foundation DB deals with this 

1112
00:56:46,560 --> 00:56:51,120
concept of you have redundancy. 
So I want to make sure that my 

1113
00:56:51,120 --> 00:56:54,840
data's safe. 
So you have these multiple logs,

1114
00:56:55,200 --> 00:56:57,800
things go to the logs, and then 
they go to multiple storage 

1115
00:56:57,800 --> 00:57:00,280
servers. 
So that's how they manage it. 

1116
00:57:00,280 --> 00:57:03,080
You can think of like everybody 
knows like what a RAID array is,

1117
00:57:03,080 --> 00:57:05,320
right? 
You have like 3 disks and it 

1118
00:57:05,360 --> 00:57:07,480
writes, you know, every piece of
information gets written to two 

1119
00:57:07,480 --> 00:57:10,280
of them, so one can fail. 
You get the idea, right? 

1120
00:57:10,560 --> 00:57:13,040
They do the same thing, right? 
So they read from the logs, 

1121
00:57:13,040 --> 00:57:15,240
they'll have 3 storage servers, 
right? 

1122
00:57:15,240 --> 00:57:17,320
Each one reading from the logs 
and they're all recording. 

1123
00:57:17,400 --> 00:57:20,520
Any one of them can answer 
questions, right? 

1124
00:57:20,520 --> 00:57:22,760
But if one of them dies, 
nothing's wrong. 

1125
00:57:23,600 --> 00:57:27,560
Bedrock takes us a bit further. 
When Foundation DB was designed,

1126
00:57:28,160 --> 00:57:32,640
they didn't have things that 
were reliable like Amazon S3 or 

1127
00:57:32,760 --> 00:57:35,120
GCS. 
You have these object stores. 

1128
00:57:35,200 --> 00:57:40,480
Now I can put data out there and
I'm pretty sure the universal 

1129
00:57:40,480 --> 00:57:42,120
burn before I lose that 
information. 

1130
00:57:42,120 --> 00:57:46,600
I mean, there's so many nines on
the reliability of those 

1131
00:57:46,600 --> 00:57:48,920
services that you just don't 
have to think about it. 

1132
00:57:48,920 --> 00:57:53,320
Once you hand off a piece of 
data to GCS or S3 and they tell 

1133
00:57:53,320 --> 00:57:57,800
you it's OK, it's good, you 
don't have to think about it 

1134
00:57:58,040 --> 00:58:01,400
ever again. 
So what that does is if we bring

1135
00:58:01,400 --> 00:58:04,440
that into the mix now, now, now 
you don't have to worry about 

1136
00:58:04,440 --> 00:58:07,520
having all these storage servers
all over the place keeping track

1137
00:58:07,520 --> 00:58:09,080
of all this. 
You can just funnel the stuff 

1138
00:58:09,080 --> 00:58:13,200
from the logs to something like 
GCS, you know, either locally 

1139
00:58:13,200 --> 00:58:15,920
run or like that. 
And now, now that data is there,

1140
00:58:16,280 --> 00:58:19,840
that deals with the replication 
issue, right? 

1141
00:58:19,960 --> 00:58:22,760
It's nice and simple. 
At the same time, it's also 

1142
00:58:22,760 --> 00:58:25,320
available so any of the other 
nodes that want to read that 

1143
00:58:25,320 --> 00:58:28,680
block of data, you can do it 
from there without having to 

1144
00:58:28,680 --> 00:58:32,320
coordinate so. 
You can have any S3 bucket the 

1145
00:58:32,640 --> 00:58:37,360
Oh yeah, the primary target. 
Yep, you just the data just get 

1146
00:58:37,360 --> 00:58:39,760
dumped in there blocks of 
transactions at a time. 

1147
00:58:39,760 --> 00:58:42,600
So as these things are moving 
along, you start off with my 

1148
00:58:42,600 --> 00:58:45,560
individual transaction right at 
the commit proxy, those get 

1149
00:58:45,560 --> 00:58:47,800
batched together into a bigger 
block, right? 

1150
00:58:47,800 --> 00:58:50,120
And then when it hits the logs, 
those get batched together into 

1151
00:58:50,120 --> 00:58:52,280
a bigger block. 
And then every so often those 

1152
00:58:52,280 --> 00:58:55,920
blocks get sent to S3 storage or
wherever. 

1153
00:58:56,400 --> 00:58:58,960
And so you end up with these, 
you know, 60 some odd Meg chunks

1154
00:58:59,200 --> 00:59:01,480
that end up on storage. 
And then when you're going to 

1155
00:59:01,480 --> 00:59:04,080
materialize them, you pull down 
these, you know, chunky but 

1156
00:59:04,080 --> 00:59:07,560
manageable pieces of information
that are, that are, that are set

1157
00:59:07,560 --> 00:59:12,080
up for easy consumption. 
All right, my next question is 

1158
00:59:13,240 --> 00:59:15,600
why? 
Why would you use anything else 

1159
00:59:16,640 --> 00:59:18,920
like? 
Why would I use Postgres 

1160
00:59:18,920 --> 00:59:21,200
anymore? 
Like where does where does? 

1161
00:59:21,200 --> 00:59:23,720
Like? 
It's a super interesting 

1162
00:59:23,720 --> 00:59:26,320
question and Postgres or my 
sequel doesn't. 

1163
00:59:27,280 --> 00:59:30,960
Well, again, these foundation DB
and I all credit to these 

1164
00:59:30,960 --> 00:59:33,400
people, right? 
When you really start picking at

1165
00:59:33,560 --> 00:59:35,800
it's a really under appreciated 
piece of tech. 

1166
00:59:36,480 --> 00:59:39,160
The more you look at how this 
thing actually works, how their 

1167
00:59:39,160 --> 00:59:41,920
thing actually works and, and, 
and the patterns that I 

1168
00:59:41,920 --> 00:59:45,120
followed, it makes a lot of 
sense. 

1169
00:59:45,360 --> 00:59:49,760
So you say, OK fine, now I get 
this KV storage, right? 

1170
00:59:50,800 --> 00:59:52,000
I've got this. 
This is great. 

1171
00:59:52,320 --> 00:59:59,440
What if I wanted to write SQL 
queries against that, right? 

1172
00:59:59,440 --> 01:00:00,760
What if I want to do something 
like that? 

1173
01:00:01,320 --> 01:00:05,160
I could store rows as keys in 
the system. 

1174
01:00:06,360 --> 01:00:10,400
The indexes are the, I mean 
store rows as values in the 

1175
01:00:10,400 --> 01:00:11,840
system. 
The indexes are the keys. 

1176
01:00:12,160 --> 01:00:15,600
I might store row one at, you 
know, whatever table slash 1. 

1177
01:00:16,000 --> 01:00:19,400
Table slash 2, table slash 3. 
I could write queries that would

1178
01:00:19,400 --> 01:00:21,800
go get these things. 
I could have indexes that are 

1179
01:00:21,800 --> 01:00:27,400
just other ranges of keys. 
You could, they did as a as a 

1180
01:00:27,480 --> 01:00:31,400
proof of tech, they took Sequel 
Lite and they took off the B 

1181
01:00:31,400 --> 01:00:34,800
tree engine that makes you know,
writes stuff to disk and they 

1182
01:00:34,800 --> 01:00:37,840
pointed it at Foundation DB. 
The Foundation DB people did 

1183
01:00:37,840 --> 01:00:40,720
this and you could have Sequel 
Lite that would actually write 

1184
01:00:40,720 --> 01:00:42,880
to read and write to Foundation 
DB. 

1185
01:00:42,880 --> 01:00:45,320
And then of course, you could 
run that on all of these 

1186
01:00:45,320 --> 01:00:48,080
different machines and you got 
all of the benefits and 

1187
01:00:48,080 --> 01:00:51,120
transaction abilities of 
Foundation DB, but you got 

1188
01:00:51,120 --> 01:00:53,960
sequel too. 
And so one of their things, one 

1189
01:00:53,960 --> 01:00:57,920
of their big ideas was that you 
have this KV layer and that's 

1190
01:00:57,920 --> 01:01:01,040
kind of like the base substrate.
That's the bedrock, if you will,

1191
01:01:01,040 --> 01:01:02,440
of what you would want to work 
on. 

1192
01:01:03,280 --> 01:01:07,000
And then you, you can layer on 
top of this other kinds of 

1193
01:01:07,000 --> 01:01:10,680
systems and they all then 
inherits the properties of the 

1194
01:01:10,680 --> 01:01:12,920
underlying pieces. 
So if I were to build something 

1195
01:01:12,920 --> 01:01:16,520
that knows how to do sequel and 
answer sequel questions on 

1196
01:01:16,520 --> 01:01:20,480
Bedrock or Foundation DP, then 
all the transaction abilities, 

1197
01:01:20,480 --> 01:01:22,680
all of that stuff I inherit for 
free. 

1198
01:01:23,120 --> 01:01:25,320
But why? 
Why do you even need to do that 

1199
01:01:25,320 --> 01:01:26,920
at that point? 
Like if you're. 

1200
01:01:27,400 --> 01:01:30,600
Sequel friendly sequel's fun. 
You know, I mean it, it's, it's 

1201
01:01:30,600 --> 01:01:34,000
a great way to be able to 
compose like if, if, let's say. 

1202
01:01:34,360 --> 01:01:37,360
Good question. 
Once Upon a time in database 

1203
01:01:37,360 --> 01:01:42,440
land, right before sequel, 
right, you had you had all these

1204
01:01:42,440 --> 01:01:46,440
systems where they were all 
different and you could answer 

1205
01:01:46,440 --> 01:01:48,040
questions, but you like some of 
them. 

1206
01:01:48,040 --> 01:01:50,440
You had to like follow nodes and
read from one to the next. 

1207
01:01:50,440 --> 01:01:52,680
And like these databases were 
complicated and weird. 

1208
01:01:52,880 --> 01:01:55,480
And the sequel came along and 
made it so you can ask general 

1209
01:01:55,480 --> 01:01:59,200
questions, you know, give me the
sum of all this stuff where this

1210
01:01:59,200 --> 01:02:00,720
is that, right? 
That's great. 

1211
01:02:00,720 --> 01:02:05,440
It's powerful, right? 
It's nice and and and and and 

1212
01:02:05,440 --> 01:02:08,680
comfortable, but at the same 
time, you know, you do have to 

1213
01:02:08,680 --> 01:02:11,960
make some concessions to it. 
There's a dude I want to shout 

1214
01:02:11,960 --> 01:02:17,920
out to that that is working on 
an ecto layer for Foundation DB.

1215
01:02:19,240 --> 01:02:25,800
So you can compose ecto queries 
and it will read and write from 

1216
01:02:25,800 --> 01:02:27,520
Foundation DB. 
So you get all of that 

1217
01:02:27,680 --> 01:02:30,880
beautifulness, right? 
You get all of that with the, 

1218
01:02:31,000 --> 01:02:33,600
with the sequel ability to be 
able to compose quotes and with 

1219
01:02:33,640 --> 01:02:35,640
Ecto, you get all that comfort, 
right. 

1220
01:02:35,760 --> 01:02:39,360
But if the storage model is 
handled and it's distributed and

1221
01:02:39,360 --> 01:02:42,160
it's replicated and you don't 
have to worry about that would 

1222
01:02:42,160 --> 01:02:45,720
take not very long to port 
something like that to see like 

1223
01:02:45,720 --> 01:02:47,840
me like a week. 
That's awesome and that makes 

1224
01:02:47,840 --> 01:02:52,800
sense to me, but not but the 
need for like. 

1225
01:02:53,040 --> 01:02:57,040
I would just adjust my daily 
procedures to not use you. 

1226
01:02:57,040 --> 01:02:58,560
Could totally do that too. 
You know. 

1227
01:02:59,680 --> 01:03:03,400
Here's where it's really cool. 
I open up a transaction, I do 

1228
01:03:03,400 --> 01:03:06,280
some SQL stuff, I read and write
some key values. 

1229
01:03:06,400 --> 01:03:08,680
I save it. 
That's all one transaction. 

1230
01:03:09,640 --> 01:03:11,560
Yeah. 
Right. 

1231
01:03:11,560 --> 01:03:13,840
It's all one transaction. 
So you could actually have a 

1232
01:03:13,840 --> 01:03:17,000
blend of the two and have that 
consistent picture. 

1233
01:03:17,360 --> 01:03:21,480
A good example, you know, some 
people have won't name names, 

1234
01:03:21,480 --> 01:03:24,080
but some people have a situation
where they have a a primary 

1235
01:03:24,080 --> 01:03:26,240
database. 
That's one system and then 

1236
01:03:26,240 --> 01:03:30,280
you've got something like Oban 
in another, right And so Oban 

1237
01:03:30,280 --> 01:03:34,320
loves Postgres and you know, 
other systems are not Oban and 

1238
01:03:34,320 --> 01:03:36,160
you're not Postgres. 
And so they don't you can't 

1239
01:03:36,160 --> 01:03:38,240
necessarily run a transaction 
across the 2. 

1240
01:03:38,800 --> 01:03:42,280
So if I have something where I 
want to, let's say I, I complete

1241
01:03:42,280 --> 01:03:45,000
an order and then I want to 
schedule a job that happens 

1242
01:03:45,000 --> 01:03:47,520
after that I have to do a little
bit of a dance to make sure 

1243
01:03:47,520 --> 01:03:50,520
that, you know, that thing goes 
through or the job insurance 

1244
01:03:50,520 --> 01:03:52,840
get, you know, like the both 
things happened. 

1245
01:03:53,080 --> 01:03:55,040
There's like you have to do a 
little bit of a dance to make 

1246
01:03:55,040 --> 01:03:58,680
sure that works. 
Imagine a situation where you 

1247
01:03:58,680 --> 01:04:01,320
could, you know, take your code 
that's used to run in Sequel. 

1248
01:04:01,320 --> 01:04:03,320
You do that. 
You could you could have it in 

1249
01:04:03,320 --> 01:04:06,240
both systems and have that 
consistent picture without 

1250
01:04:06,240 --> 01:04:10,960
having to do anything special. 
It just works, you know, so you 

1251
01:04:10,960 --> 01:04:13,680
can do some neat things. 
We have on top of Bedrock. 

1252
01:04:14,120 --> 01:04:16,240
There is just got some PRS for 
it today. 

1253
01:04:17,080 --> 01:04:20,360
There's a job layer, right? 
So I can submit jobs. 

1254
01:04:20,560 --> 01:04:23,880
They get composed into keys. 
There's other processes that 

1255
01:04:23,880 --> 01:04:25,600
know how to. 
Yeah, you see. 

1256
01:04:25,600 --> 01:04:30,560
What I'm saying I need to just 
drop postgres and use bedrock 

1257
01:04:30,560 --> 01:04:32,960
and kill switch I. 
Mean I I think I mean. 

1258
01:04:33,240 --> 01:04:34,960
We put because I also have an. 
Effort into anything. 

1259
01:04:35,400 --> 01:04:40,240
I also use Oban and if you're 
already integrating a jobs 

1260
01:04:41,120 --> 01:04:44,560
scenario sounds like well. 
One shop. 

1261
01:04:44,560 --> 01:04:45,760
Think about what you need for 
jobs. 

1262
01:04:45,760 --> 01:04:47,360
Think about what you need for 
jobs. 

1263
01:04:47,560 --> 01:04:48,960
Right. 
I need to be able to work. 

1264
01:04:48,960 --> 01:04:51,920
On job scheduler maybe? 
Right. 

1265
01:04:52,080 --> 01:04:54,200
So I need to be able, I need to 
schedule things that need to 

1266
01:04:54,200 --> 01:04:56,120
happen. 
I might want to schedule them in

1267
01:04:56,120 --> 01:05:00,080
the future, right? 
So I have a key space where I'm 

1268
01:05:00,280 --> 01:05:01,960
constantly grabbing the next 
job. 

1269
01:05:02,200 --> 01:05:05,840
I want to be able to do that in 
such a way where two things 

1270
01:05:05,840 --> 01:05:07,840
aren't conflicting that, you 
know, two job runners aren't 

1271
01:05:07,840 --> 01:05:09,280
like fighting over the same 
stuff. 

1272
01:05:09,720 --> 01:05:13,800
And it turns out that Apple has 
the same problem. 

1273
01:05:13,800 --> 01:05:16,880
They have Cloudkit and there's a
million billion things going on 

1274
01:05:16,880 --> 01:05:19,160
in Cloudkit all the time that 
are scheduled jobs. 

1275
01:05:19,920 --> 01:05:23,280
So they came up with a system 
called quick, right? 

1276
01:05:23,280 --> 01:05:28,480
It is a, a, a protocol on top of
foundation DB, right, by which 

1277
01:05:28,480 --> 01:05:32,600
you can use the key value system
and the transactions to do and 

1278
01:05:32,600 --> 01:05:36,560
run distributed jobs. 
So now you can have any number 

1279
01:05:36,560 --> 01:05:40,960
of jobs that are running, if 
they complete, they complete, it

1280
01:05:40,960 --> 01:05:45,640
gets scheduled and marked. 
If if they fail, then they're 

1281
01:05:45,640 --> 01:05:47,440
not failed forever. 
Something else comes along and 

1282
01:05:47,440 --> 01:05:49,560
eventually we'll pick it up 
after some lease timeouts. 

1283
01:05:49,720 --> 01:05:51,920
You get the idea. 
It's like they have solved this 

1284
01:05:51,920 --> 01:05:55,320
problem. 
I was able to take and the same 

1285
01:05:55,320 --> 01:05:56,800
algorithm, they published a 
paper. 

1286
01:05:57,040 --> 01:06:00,440
I took the same algorithm and 
dropped it on Bedrock as the job

1287
01:06:00,440 --> 01:06:02,320
queue system. 
And that's what you see there. 

1288
01:06:02,320 --> 01:06:06,400
So you can run jobs, you submit 
them, it's very lightweight. 

1289
01:06:06,400 --> 01:06:08,880
You can choose which machines 
are running the jobs. 

1290
01:06:09,440 --> 01:06:12,520
It's done efficiently, it's 
distributed and everything is 

1291
01:06:13,080 --> 01:06:16,360
working against the same picture
as everything else you're doing 

1292
01:06:16,360 --> 01:06:19,160
in Bedrock. 
Fun stuff. 

1293
01:06:19,960 --> 01:06:21,280
Yeah. 
So you want to think in layers, 

1294
01:06:21,680 --> 01:06:23,200
right? 
Like there's, there's, there's, 

1295
01:06:23,320 --> 01:06:25,920
there's, there's layers to it. 
You know, you, I've got the 

1296
01:06:25,920 --> 01:06:27,520
jobs. 
And now on top of that, maybe I 

1297
01:06:27,520 --> 01:06:30,600
want to build a workflow system,
right? 

1298
01:06:31,000 --> 01:06:33,920
So now that I got transactions 
and I can do jobs and I can do 

1299
01:06:33,920 --> 01:06:36,200
jobs, transactions. 
Well, now I can think about a 

1300
01:06:36,200 --> 01:06:39,240
workflow or an agent or 
something like that that sits on

1301
01:06:39,240 --> 01:06:41,600
top of it. 
And now I can be. 

1302
01:06:41,880 --> 01:06:44,360
Now you see why Mike is 
interested in in. 

1303
01:06:44,520 --> 01:06:48,760
Easter Hostetler. 
I mean, MM has it integrated 

1304
01:06:48,760 --> 01:06:51,440
into Jeeto, right? 
Yeah. 

1305
01:06:52,040 --> 01:06:54,000
Yeah. 
He's he's Guinea pig and things 

1306
01:06:54,000 --> 01:06:55,440
for me. 
So what I was hoping when I 

1307
01:06:55,440 --> 01:06:57,680
built this thing is that there's
a problem set. 

1308
01:06:57,720 --> 01:06:59,880
I mean, if you want to have a 
distributed cash, if you want to

1309
01:06:59,880 --> 01:07:02,960
have a, a, a situation where 
I've got all these machines, I 

1310
01:07:02,960 --> 01:07:05,760
want to be able to, you know, 
look into cash, get a user 

1311
01:07:05,760 --> 01:07:08,760
record and know that it's the 
freshest thing. 

1312
01:07:10,440 --> 01:07:12,600
Bedrock or something like it 
could work really well for you. 

1313
01:07:12,640 --> 01:07:15,920
And then if you're changing 
things, you, you know, you write

1314
01:07:15,920 --> 01:07:17,760
through, you do treat it like a 
write through cache, write to 

1315
01:07:17,760 --> 01:07:20,320
the database, but write to 
Bedrock at the same time. 

1316
01:07:20,520 --> 01:07:22,720
And that way all the other 
machines can just look at. 

1317
01:07:23,160 --> 01:07:26,800
It on like a performance level, 
like obviously having a single 

1318
01:07:26,800 --> 01:07:30,120
database, there's a bottleneck 
there, right? 

1319
01:07:30,240 --> 01:07:33,480
Right. 
Is there ever an issue with like

1320
01:07:33,480 --> 01:07:37,920
too many nodes or like are you 
going to run into like syncing 

1321
01:07:37,920 --> 01:07:41,120
or? 
Well, that's the beauty of the 

1322
01:07:41,120 --> 01:07:44,360
system is if, if information 
flows in One Direction only, 

1323
01:07:44,400 --> 01:07:45,400
right? 
I mean like so. 

1324
01:07:45,600 --> 01:07:48,720
So I've got transactions, they 
get resolved once we're sure 

1325
01:07:48,720 --> 01:07:51,600
about who who's doing what, then
they get logged, and then the 

1326
01:07:51,600 --> 01:07:54,880
logs can be read by anything. 
And it's always first time 

1327
01:07:55,280 --> 01:07:57,200
served, right? 
And then you get rejected if 

1328
01:07:57,200 --> 01:07:58,520
you're asked, Yeah. 
Right. 

1329
01:07:58,880 --> 01:08:01,160
It's who, who because I mean, we
can't know, right. 

1330
01:08:01,160 --> 01:08:03,440
So it's, it's, it's however, 
who, whoever gets to it first. 

1331
01:08:03,920 --> 01:08:07,080
And so whichever order they're 
assigned when they happen to 

1332
01:08:07,080 --> 01:08:10,000
come through, it's gonna, you 
know, they'll, they'll they'll 

1333
01:08:10,000 --> 01:08:12,920
be de conflicted and then one or
one or the other will lose. 

1334
01:08:13,120 --> 01:08:16,319
How would like fast like if you 
have like a really fast rights 

1335
01:08:16,319 --> 01:08:21,200
or like an update to a single 
field would that would it just 

1336
01:08:21,200 --> 01:08:23,399
overwrite like as the second one
comes in? 

1337
01:08:24,720 --> 01:08:26,720
Well, that's The thing is 
everything is de conflicted 

1338
01:08:26,720 --> 01:08:29,600
before that happens, right? 
So you know nothing, nothing 

1339
01:08:29,600 --> 01:08:32,479
makes it to the to the logs 
until it's passed resolution. 

1340
01:08:32,479 --> 01:08:35,840
And resolution is the explicit 
step of just how do does this 

1341
01:08:35,840 --> 01:08:38,319
touch this? 
If the answer's no, yes, it can 

1342
01:08:38,319 --> 01:08:42,319
go right. 
And so there's some clever stuff

1343
01:08:42,319 --> 01:08:45,479
with batching and, and to make 
this whole process much faster, 

1344
01:08:45,920 --> 01:08:48,560
but so that we're not constantly
communicating between these 

1345
01:08:48,560 --> 01:08:51,640
parts. 
But it's, it's relative. 

1346
01:08:51,680 --> 01:08:54,600
I mean, it's fast. 
So I mean, on a single machine, 

1347
01:08:54,600 --> 01:08:56,600
you're, you're getting things 
written at the disk and round 

1348
01:08:56,600 --> 01:09:00,760
trips and, you know, 
microseconds under millisecond 

1349
01:09:00,760 --> 01:09:03,520
easy. 
You know, the nice thing about 

1350
01:09:03,520 --> 01:09:06,399
the model is, is it hides the 
latency that you would normally 

1351
01:09:06,399 --> 01:09:09,439
see to something like S3. 
You know, S3's they're they're, 

1352
01:09:09,439 --> 01:09:10,520
they're, they're vast. 
It's going to be. 

1353
01:09:10,560 --> 01:09:12,960
It's going to be you. 
Can store data forever, but it's

1354
01:09:12,960 --> 01:09:16,160
a little slow, right? 
And so what's nice is the way 

1355
01:09:16,160 --> 01:09:19,120
the system works is if things 
batch together larger and larger

1356
01:09:19,120 --> 01:09:22,760
chunks and then end up on S3. 
Well, and you're not. 

1357
01:09:22,840 --> 01:09:25,040
Big meaty bits. 
You're not getting your data 

1358
01:09:25,040 --> 01:09:28,120
from S3, your nodes are. 
No, no. 

1359
01:09:28,120 --> 01:09:30,640
And what's happening is, is you 
can you have this idea of the, 

1360
01:09:30,640 --> 01:09:33,160
the, the storage thing is 
reading, reading from the logs. 

1361
01:09:33,240 --> 01:09:35,800
And the worst case goes back to 
S3 for it. 

1362
01:09:36,040 --> 01:09:37,800
But basically it's just playing 
back transactions. 

1363
01:09:37,800 --> 01:09:40,439
And you can have, because it's 
just playing back the same log, 

1364
01:09:40,640 --> 01:09:42,160
you can have more than one of 
them. 

1365
01:09:42,520 --> 01:09:45,760
So imagine this, I've got a 
cluster of machines. 

1366
01:09:46,000 --> 01:09:48,680
I've got some hot spots where 
some machines are handling a 

1367
01:09:48,680 --> 01:09:52,720
particular set of information. 
There's nothing stopping Bedrock

1368
01:09:52,720 --> 01:09:56,320
from spinning up a materializer.
It's something that's dealing 

1369
01:09:56,320 --> 01:09:58,280
with the storage and 
materializing that right there 

1370
01:09:58,280 --> 01:10:01,120
on that note where the data 
doesn't have to leave at all. 

1371
01:10:01,560 --> 01:10:04,000
So now you got one process 
that's watching the logs, 

1372
01:10:04,000 --> 01:10:06,440
updating the internal state, and
then other things are asking 

1373
01:10:06,440 --> 01:10:08,040
questions of it. 
Right there. 

1374
01:10:08,480 --> 01:10:11,520
You can move the information 
right to where it's being used. 

1375
01:10:11,840 --> 01:10:13,320
Yeah, I feel like I wouldn't 
power. 

1376
01:10:13,320 --> 01:10:15,640
Beam. 
To use anything else for any 

1377
01:10:15,640 --> 01:10:19,800
distributed system. 
I think if we put some time and 

1378
01:10:19,800 --> 01:10:22,160
effort and love into something 
like this, then you're 

1379
01:10:22,160 --> 01:10:25,440
absolutely right. 
I, I, I, I would not reach for 

1380
01:10:25,440 --> 01:10:28,600
other things. 
It's just right because it's 

1381
01:10:28,600 --> 01:10:29,720
nice and simple to think about 
it. 

1382
01:10:29,720 --> 01:10:33,160
I've got a function right it, it
reads data, it writes data. 

1383
01:10:33,360 --> 01:10:36,000
It's wrapped in a transaction. 
Done. 

1384
01:10:36,360 --> 01:10:40,080
It either happens or it doesn't.
How hard is it for me to tear 

1385
01:10:40,080 --> 01:10:45,440
out Postgres and use bedrock? 
Well, funny you should ask. 

1386
01:10:46,000 --> 01:10:48,840
So what I would recommend is if 
you were going to do embark on 

1387
01:10:48,840 --> 01:10:51,960
something like this one, be a 
little careful because bedrock 

1388
01:10:51,960 --> 01:10:54,080
is bleeding edge stuff. 
So sometimes you get a little 

1389
01:10:54,080 --> 01:10:56,280
bloody. 
But you know, we put a little 

1390
01:10:56,280 --> 01:10:57,920
time and love into it. 
It could be better. 

1391
01:10:58,480 --> 01:11:01,520
The the idea here is that the 
general flow would be I would 

1392
01:11:01,520 --> 01:11:03,040
treat it like right through 
cash. 

1393
01:11:03,280 --> 01:11:08,680
So day one, the benefit you 
would see is that instead of 

1394
01:11:08,680 --> 01:11:11,360
going to Redis or something 
else, you could say, hey, 

1395
01:11:11,360 --> 01:11:14,120
Bedrock, give me user ID #23 
right? 

1396
01:11:14,120 --> 01:11:17,240
And I can be sure that user ID 
23 that I'm looking at is the 

1397
01:11:17,240 --> 01:11:21,600
latest freshest copy. 
When somebody changes something,

1398
01:11:21,800 --> 01:11:24,800
you would go ahead and write it 
to to Bedrock after having 

1399
01:11:24,800 --> 01:11:27,520
written it to the database, 
right? 

1400
01:11:27,520 --> 01:11:29,360
So the database is system of 
record at that point. 

1401
01:11:29,360 --> 01:11:31,800
You still keep track of stuff 
there, but if the thing goes 

1402
01:11:31,800 --> 01:11:34,640
through, then you write it to 
Bedrock and then everybody else 

1403
01:11:34,800 --> 01:11:36,080
that's there. 
So it's a cache. 

1404
01:11:36,440 --> 01:11:39,880
You can treat it like a cache. 
Now over time what would happen 

1405
01:11:39,880 --> 01:11:42,360
is is your data would naturally 
just collect there would 

1406
01:11:42,360 --> 01:11:45,520
naturally pick up the entire set
as things are read from the 

1407
01:11:45,520 --> 01:11:47,200
database. 
And oh, actually what you're 

1408
01:11:47,200 --> 01:11:49,040
saying that's smart. 
Then you don't have to run like 

1409
01:11:49,040 --> 01:11:50,920
data migrations or anything 
really. 

1410
01:11:52,720 --> 01:11:55,120
It might be kind of fun. 
So like you could see an off 

1411
01:11:55,120 --> 01:11:58,480
ramp for some of the existing 
tech onto something like this, 

1412
01:11:59,720 --> 01:12:01,440
provided we can, you know, give 
people the same level. 

1413
01:12:01,440 --> 01:12:03,520
We want to make sure that 
there's a storage system. 

1414
01:12:03,520 --> 01:12:05,480
So you got to be serious about 
people's data and you want to 

1415
01:12:05,480 --> 01:12:08,640
make sure that that that things 
are being dealt with properly. 

1416
01:12:08,640 --> 01:12:10,360
So there's a whole bunch of 
testing. 

1417
01:12:10,760 --> 01:12:12,600
I can't have a data failures 
right? 

1418
01:12:12,600 --> 01:12:16,520
Because it has to be there when 
they don't expect it to work. 

1419
01:12:16,520 --> 01:12:19,080
You know it has to always work. 
So that's one of the reasons why

1420
01:12:19,080 --> 01:12:21,920
I would recommend, but you could
treat it as, like I said, like a

1421
01:12:22,160 --> 01:12:23,800
cash. 
So in other words, what happens 

1422
01:12:23,800 --> 01:12:26,080
when the cash fails when a cash 
fails, right? 

1423
01:12:26,080 --> 01:12:27,960
You just go do what you were 
going to do anyway from the 

1424
01:12:27,960 --> 01:12:30,640
database, no big deal from the 
database, right? 

1425
01:12:30,880 --> 01:12:32,960
So what you could do is you 
could use something like this, 

1426
01:12:33,160 --> 01:12:36,800
you know, while kinks are being 
worked out to, to, to, to answer

1427
01:12:36,800 --> 01:12:39,240
those kinds of questions 
quickly, right? 

1428
01:12:39,240 --> 01:12:41,360
So you can take pressure off 
your database. 

1429
01:12:41,600 --> 01:12:45,360
And one of our conversations I 
like I showed you like a region 

1430
01:12:45,440 --> 01:12:50,640
map, right where yes, really 
high lag in like Asia, obviously

1431
01:12:50,640 --> 01:12:53,200
because I only have one server 
here in the US. 

1432
01:12:53,920 --> 01:12:57,440
But light only goes so fast. 
Now using Bedrock as like a 

1433
01:12:57,440 --> 01:13:02,200
caching system, if I sprung up a
note over there it would be 

1434
01:13:02,200 --> 01:13:04,400
amazing. 
And the data's sitting there on 

1435
01:13:04,400 --> 01:13:05,080
the note. 
Right. 

1436
01:13:05,320 --> 01:13:07,600
And see Foundation DB 
contemplates this, right? 

1437
01:13:07,600 --> 01:13:10,520
They have this idea where 
you're, you've got, you know, 

1438
01:13:11,240 --> 01:13:15,040
multiple data centers worth of 
machines, things that span 

1439
01:13:15,200 --> 01:13:18,920
different places. 
And as a result, information is 

1440
01:13:18,960 --> 01:13:22,960
kind of the replication problem 
is dealt with for you that way 

1441
01:13:23,480 --> 01:13:25,920
or the the system that kind of 
the features you get out of the 

1442
01:13:25,920 --> 01:13:28,840
way the system is built end up 
with moving your information 

1443
01:13:28,840 --> 01:13:30,480
around in ways that are 
advantageous. 

1444
01:13:30,800 --> 01:13:33,120
Think about this. 
You know, you're, you're in a 

1445
01:13:33,120 --> 01:13:35,720
global situation. 
I'm in, I'm on, you know, 

1446
01:13:35,720 --> 01:13:38,640
continent A and I'm writing 
things and I'm mostly reading 

1447
01:13:38,640 --> 01:13:41,840
over here on continent B. 
So now continent B, you know, 

1448
01:13:41,960 --> 01:13:46,960
can pull from S3 or GCS or 
whatever, slower pace, but it 

1449
01:13:46,960 --> 01:13:49,440
still gets there. 
It's, it's, it's, it's big 

1450
01:13:49,440 --> 01:13:52,720
blocks of information that move 
quickly on fast networks that 

1451
01:13:52,720 --> 01:13:55,760
are internal ones, right? 
And then you can answer your 

1452
01:13:55,760 --> 01:13:59,320
questions because you can 
materialize that data over here.

1453
01:13:59,640 --> 01:14:03,560
So you might instead of having 
500 milliseconds worth of of 

1454
01:14:03,560 --> 01:14:06,560
lag, you might only have 15 or 
20 or 30. 

1455
01:14:06,720 --> 01:14:10,160
You know, I mean like it's a lot
less and with without having to 

1456
01:14:10,160 --> 01:14:11,600
do a whole lot of crazy 
coordination. 

1457
01:14:12,000 --> 01:14:13,640
Yeah, that's. 
Awesome is the promise. 

1458
01:14:14,240 --> 01:14:16,520
Well, I mean, whenever you're 
starting to hit 500 

1459
01:14:16,520 --> 01:14:18,600
milliseconds, things get 
painful. 

1460
01:14:18,600 --> 01:14:20,640
Like from a UX experience? 
Well. 

1461
01:14:21,920 --> 01:14:24,040
Think about this. 
I mean, right, you got, I got 

1462
01:14:24,040 --> 01:14:27,760
this data and if I got to ask a 
question and then I have 500 

1463
01:14:27,760 --> 01:14:31,000
milliseconds before I can ask my
next question, it's not fun. 

1464
01:14:31,840 --> 01:14:35,600
I mean, that's, that's you just,
you know, now all of a sudden 

1465
01:14:35,600 --> 01:14:40,160
the pain of having to go back to
the database is crazy, right? 

1466
01:14:40,440 --> 01:14:43,400
But if you can keep copies of 
the information in multiple 

1467
01:14:43,400 --> 01:14:47,080
places and keep those fresh and 
be sure about them, right? 

1468
01:14:47,080 --> 01:14:49,440
You can be sure about how that 
you know that they're valid, 

1469
01:14:49,840 --> 01:14:51,800
then all of a sudden the rules 
change. 

1470
01:14:52,160 --> 01:14:55,480
So, yeah, I think that this kind
of model, not only does it fit 

1471
01:14:55,480 --> 01:14:59,640
the beam, but I think that when 
when you put the kind of rigor 

1472
01:14:59,640 --> 01:15:01,960
in that you need for a storage 
system, we put a little bit more

1473
01:15:01,960 --> 01:15:04,880
rigor into it. 
We would have something that 

1474
01:15:04,880 --> 01:15:07,000
people would really want to use.
And I think you'd have to tear 

1475
01:15:07,160 --> 01:15:12,080
pry it on my hands. 
I I was talking to a community 

1476
01:15:12,080 --> 01:15:17,840
member who benchmarked Bedrock 
versus Rox DB, their NIF and. 

1477
01:15:17,840 --> 01:15:20,520
And they were surprised. 
And it it blew it out of the 

1478
01:15:20,520 --> 01:15:23,480
water. 
That's awesome. 

1479
01:15:23,760 --> 01:15:25,760
Like. 
Yeah, yeah. 

1480
01:15:25,840 --> 01:15:28,320
I mean like because you're past.
Binaries around. 

1481
01:15:28,520 --> 01:15:30,440
I never knew that. 
I learned that today. 

1482
01:15:30,480 --> 01:15:32,320
That's brand new information to 
me. 

1483
01:15:32,520 --> 01:15:36,600
No, like I said, I mean my, my, 
my, my problem in life is that, 

1484
01:15:36,640 --> 01:15:39,120
you know, I got, I got in touch 
with autism, right? 

1485
01:15:39,120 --> 01:15:41,480
So you know, I and I'm a tool 
user. 

1486
01:15:41,640 --> 01:15:45,680
So, So what happens is I get 
something and I just have to 

1487
01:15:45,680 --> 01:15:48,320
like, you know, I just, you 
know, autistically fixate on it 

1488
01:15:48,560 --> 01:15:52,440
to the annoyance of my family 
until I understand something. 

1489
01:15:52,640 --> 01:15:55,120
And then once I understand it, 
then it's like, like I know how 

1490
01:15:55,120 --> 01:15:59,440
to bend it and twist it to my 
will, you know, so the, the beam

1491
01:15:59,440 --> 01:16:01,520
is no different. 
Like you get some I oh man, it's

1492
01:16:01,520 --> 01:16:05,160
just stuff you can dig around in
there and find and it's great, 

1493
01:16:05,800 --> 01:16:07,480
you know, so that was one of the
gems. 

1494
01:16:07,480 --> 01:16:11,200
I, I don't remember where I ran 
across that, but yeah, I think I

1495
01:16:11,200 --> 01:16:13,400
was looking at the, the 
documentation for like send and 

1496
01:16:13,400 --> 01:16:16,360
receive, like the low level. 
And it's like, oh, well, wait a 

1497
01:16:16,360 --> 01:16:18,480
minute. 
I don't know why that's going to

1498
01:16:18,480 --> 01:16:19,600
be useful. 
I'm going to tuck that little 

1499
01:16:19,600 --> 01:16:22,600
fact away in my brain. 
And so go to do something like 

1500
01:16:22,600 --> 01:16:25,720
Bedrock or you, you where you're
moving information around and it

1501
01:16:25,720 --> 01:16:27,760
needs to be done in a way that 
you don't want to copy it. 

1502
01:16:28,000 --> 01:16:29,800
Well, the natural form is now 
binaries. 

1503
01:16:31,440 --> 01:16:36,240
So it's interesting that there's
the the materializer, the way 

1504
01:16:36,240 --> 01:16:38,760
it's built inside of bedrock, 
the way it like keeps track of 

1505
01:16:38,760 --> 01:16:43,160
all the key values that's done 
with pages of information that 

1506
01:16:43,160 --> 01:16:46,560
are stored in binary, even 
though they're, it's cheaper in 

1507
01:16:46,560 --> 01:16:50,880
Elixir to just pattern match and
decode these things. 

1508
01:16:51,360 --> 01:16:53,880
Well, pattern matches are really
fast to pattern match and decode

1509
01:16:53,880 --> 01:16:55,760
these things. 
And it is to keep them loose and

1510
01:16:55,760 --> 01:16:59,280
update them, right. 
So it's, it's kind of wild. 

1511
01:16:59,680 --> 01:17:01,600
Yeah. 
Now it's it's. 

1512
01:17:01,600 --> 01:17:04,680
It's an interesting model. 
I think it this is an important 

1513
01:17:04,680 --> 01:17:08,400
lesson, why it's like so 
important to understand what 

1514
01:17:08,400 --> 01:17:12,720
you're building on. 
Like you can't just know Elixir,

1515
01:17:12,720 --> 01:17:14,880
you have to kind of understand 
Erlang, and you need to 

1516
01:17:14,880 --> 01:17:18,320
understand how the BEAM works 
and then when you do and. 

1517
01:17:18,320 --> 01:17:19,680
Then the machine underneath it, 
right? 

1518
01:17:19,680 --> 01:17:24,040
Like so like the, I call this, 
you have to have like mechanical

1519
01:17:24,040 --> 01:17:26,080
sympathy, right? 
You have to have sympathy for 

1520
01:17:26,080 --> 01:17:29,200
the machine and what dumb ass 
thing you're asking it to do 

1521
01:17:30,200 --> 01:17:32,720
because it's, I mean, computers,
computers are fast. 

1522
01:17:33,080 --> 01:17:35,120
They're they're ridiculously 
fast. 

1523
01:17:35,120 --> 01:17:37,600
But if you ask them to do 
something in a stupid way, 

1524
01:17:38,040 --> 01:17:40,640
they're going to do it, but 
it'll be done stupidly and don't

1525
01:17:40,640 --> 01:17:42,640
be surprised. 
Well, you and I have had 

1526
01:17:42,640 --> 01:17:47,480
conversations around like I've 
struggled with like my sequel 

1527
01:17:47,480 --> 01:17:49,160
performance, like with queries 
and things. 

1528
01:17:49,160 --> 01:17:51,600
And we've talked about like, 
well, look at what you're asking

1529
01:17:51,600 --> 01:17:54,080
it. 
And it's just like, well, yeah, 

1530
01:17:54,080 --> 01:17:55,840
obviously. 
Yeah, that's really dumb. 

1531
01:17:57,000 --> 01:17:59,080
Well, that's the thing. 
It's like these tools have 

1532
01:17:59,080 --> 01:18:04,360
different textures to them. 
Like my sequel, you bring that 

1533
01:18:04,360 --> 01:18:06,120
up. 
We we've had our battles with 

1534
01:18:06,120 --> 01:18:08,240
this right? 
And, and, and people are a lot 

1535
01:18:08,240 --> 01:18:11,040
of people are in the Postgres 
world and Postgres is wonderful 

1536
01:18:11,040 --> 01:18:14,760
and it and it is right. 
And I'm no certainly no my 

1537
01:18:14,760 --> 01:18:19,280
sequel fanboy, but the tool has 
interesting properties and if 

1538
01:18:19,280 --> 01:18:22,320
you use them and don't fight 
them, suddenly things become 

1539
01:18:22,320 --> 01:18:25,000
really fast. 
One thing that Postgres really 

1540
01:18:25,000 --> 01:18:28,640
doesn't like is it doesn't like 
lots of tiny little changes. 

1541
01:18:29,160 --> 01:18:31,680
It doesn't like them, right? 
You, you end up with this 

1542
01:18:31,680 --> 01:18:34,200
garbage collection stuff that it
ends up having to do, but just 

1543
01:18:34,200 --> 01:18:36,800
because of the way it was built.
And keep in mind, Postcrest is 

1544
01:18:36,800 --> 01:18:40,240
40 years old too. 
It was designed in the 80s and a

1545
01:18:40,240 --> 01:18:43,080
lot of that tech has has been 
replaced, but a lot of the 

1546
01:18:43,080 --> 01:18:44,640
underlying ideas are still 
there. 

1547
01:18:44,960 --> 01:18:48,440
It's got this garbage collection
mechanism deep down in it that 

1548
01:18:49,240 --> 01:18:51,800
runs out of, you know, runs out 
of numbers and has to compact 

1549
01:18:51,800 --> 01:18:54,000
things. 
And it, it, it, it, it causes it

1550
01:18:54,320 --> 01:18:59,800
pain in Postcrest when you store
a record, record 1 and record 2,

1551
01:19:00,480 --> 01:19:03,640
it does it with hashing. 
So there's no guarantee that 

1552
01:19:03,640 --> 01:19:05,720
those two things of pieces of 
information are going to be 

1553
01:19:05,720 --> 01:19:08,200
anywhere near each other within 
the system. 

1554
01:19:09,320 --> 01:19:12,400
Well, my sequel is different. 
My sequel takes it what's called

1555
01:19:12,400 --> 01:19:16,560
index oriented storage. 
And so it says, hey, if I've got

1556
01:19:16,560 --> 01:19:19,800
a primary key and I got, you 
know, the next one up, those 

1557
01:19:19,800 --> 01:19:21,360
things are going to be on the 
same page. 

1558
01:19:22,760 --> 01:19:26,080
So you know, the thing we did 
with the attributes, you got 

1559
01:19:26,080 --> 01:19:29,240
attributes for a piece of 
information. 

1560
01:19:29,240 --> 01:19:32,440
I want to store them. 
If I take and I store them by by

1561
01:19:33,800 --> 01:19:36,720
key, you know, primary key and 
then like like an attribute 

1562
01:19:36,720 --> 01:19:39,720
name, then I know because that's
a compound key. 

1563
01:19:39,840 --> 01:19:41,960
Those things are going to be 
like row by row by row, like 

1564
01:19:41,960 --> 01:19:44,120
right next to each other. 
So when I do the common thing of

1565
01:19:44,120 --> 01:19:50,480
like give me all the attributes 
for X, they're all groups, not 

1566
01:19:50,480 --> 01:19:53,200
so much. 
Like in our case, we have like 

1567
01:19:53,200 --> 01:19:56,440
products and products have 
attributes, but we could have 20

1568
01:19:56,440 --> 01:19:59,440
attributes per product, but 
they're all on the same page, 

1569
01:19:59,440 --> 01:20:01,440
yeah. 
They're going to be right next 

1570
01:20:01,440 --> 01:20:04,880
to each other on disk. 
And so in in my sequel, that 

1571
01:20:04,880 --> 01:20:08,440
kind of structure pays. 
It would be nothing but pain on 

1572
01:20:08,440 --> 01:20:10,800
Postgres, right? 
Postgres, you have to take it 

1573
01:20:10,800 --> 01:20:12,200
different. 
But see, The thing is, is that 

1574
01:20:12,320 --> 01:20:13,720
people are like, oh, well, SQL, 
SQL, SQL. 

1575
01:20:13,720 --> 01:20:18,360
And it's like, yeah. 
I used to think that way until I

1576
01:20:18,360 --> 01:20:21,840
met a guy named Jason. 
Well, you gotta, you have to 

1577
01:20:21,840 --> 01:20:23,400
think about the what you're 
asking it to do. 

1578
01:20:23,400 --> 01:20:25,400
I mean, it's not none of this 
shit is magic. 

1579
01:20:26,360 --> 01:20:29,040
It's cool, but none of this 
shit, it's magic. 

1580
01:20:29,320 --> 01:20:31,040
I mean if you don't understand 
it. 

1581
01:20:31,240 --> 01:20:33,960
Yes, fair. 
Right. 

1582
01:20:33,960 --> 01:20:37,560
So it's, you know, as soon as, 
as soon as as soon as you 

1583
01:20:37,560 --> 01:20:40,160
understand something, it's it, 
it, it loses it's mystical 

1584
01:20:40,160 --> 01:20:42,200
qualities a little bit. 
And that's a good thing because 

1585
01:20:42,200 --> 01:20:43,520
then you can take advantage of 
it, right. 

1586
01:20:43,520 --> 01:20:46,640
So we learned this thing about 
how mysical works and because of

1587
01:20:46,640 --> 01:20:48,400
that, you can take advantage of 
it. 

1588
01:20:49,000 --> 01:20:51,440
That kind of thing doesn't work 
so well on Postgres, you get the

1589
01:20:51,440 --> 01:20:53,040
idea. 
But you have to be, you have to 

1590
01:20:53,040 --> 01:20:56,120
have sympathy for what the 
machine what you're asking the 

1591
01:20:56,120 --> 01:20:59,960
machine to do, right? 
And if you don't, you're going 

1592
01:20:59,960 --> 01:21:02,640
to it'll probably work. 
Machines have a lot of memory 

1593
01:21:02,640 --> 01:21:03,840
and they get a lot of cores 
these days. 

1594
01:21:03,840 --> 01:21:07,400
So it'll, it'll work. 
I mean, Bunny quotes, but it's 

1595
01:21:07,600 --> 01:21:09,080
you're not going to get 
something that's going to be 

1596
01:21:09,080 --> 01:21:13,440
fast or simple or memory 
efficient or any of the other 

1597
01:21:13,440 --> 01:21:17,000
things that you're after. 
You know, this is, you know, AI 

1598
01:21:17,000 --> 01:21:21,840
has this problem. 
Anywho, so you, you, you bedrock

1599
01:21:21,840 --> 01:21:24,360
is neat. 
I wish that more people would 

1600
01:21:24,360 --> 01:21:27,080
look at it. 
There's a a live book that you 

1601
01:21:27,080 --> 01:21:28,600
can grab. 
People can grab it. 

1602
01:21:28,640 --> 01:21:31,800
They can run the entire thing. 
Keep in mind there's no nifs, 

1603
01:21:32,000 --> 01:21:34,600
there's no nothing. 
It's just pure Elixir code. 

1604
01:21:34,880 --> 01:21:39,680
You can run it and it's sizes 
down to run inside of a, a live 

1605
01:21:39,680 --> 01:21:43,160
book and it could run across a 
cluster depending on how you 

1606
01:21:43,160 --> 01:21:46,360
want to set it up. 
So you can grab this live book 

1607
01:21:46,360 --> 01:21:49,800
you can run through, I think I 
have a, what is it a college 

1608
01:21:49,800 --> 01:21:54,040
courses or allocating seats to a
room, you know, tickets to a 

1609
01:21:54,040 --> 01:21:56,920
room, things like that and all 
these things, thousand processes

1610
01:21:57,640 --> 01:22:02,560
trying to fight over allocating 
seats and it happens in 

1611
01:22:02,600 --> 01:22:05,000
milliseconds. 
It's nice and quick. 

1612
01:22:05,080 --> 01:22:06,720
So you can grab it, try it, play
with it. 

1613
01:22:08,120 --> 01:22:11,440
If people want to use it, then I
recommend you be a little 

1614
01:22:11,440 --> 01:22:15,160
careful because it is new, but 
at the same time play with it. 

1615
01:22:15,160 --> 01:22:19,680
And if we make it better, I 
think it's a killer weapon that 

1616
01:22:19,680 --> 01:22:21,720
something you'd have on the beam
that just people just don't 

1617
01:22:21,720 --> 01:22:23,960
have. 
It's kind of like live use a a 

1618
01:22:24,360 --> 01:22:27,360
killer weapon for elixir. 
You know, it's like you can you 

1619
01:22:27,360 --> 01:22:30,200
could you could do some cool 
stuff, but you combine these two

1620
01:22:30,200 --> 01:22:32,000
things and now you're starting 
to get really fun. 

1621
01:22:32,560 --> 01:22:37,520
So you can, right? 
I mean I already want to RIP it 

1622
01:22:37,520 --> 01:22:40,560
out, but I know that's not the I
want to RIP postgres out of kill

1623
01:22:40,560 --> 01:22:42,760
switch. 
But I know what you said is a 

1624
01:22:42,760 --> 01:22:48,480
smarter approach. 
Well, and you know, like you 

1625
01:22:48,480 --> 01:22:51,320
could try that first and, and 
see how that goes, you know, and

1626
01:22:51,320 --> 01:22:53,400
then like I said, your data is 
naturally going to kind of end 

1627
01:22:53,400 --> 01:22:55,240
up there. 
Plus, The thing is, is like 

1628
01:22:55,240 --> 01:22:57,680
anything you know, you're going 
to have to figure out how you 

1629
01:22:57,680 --> 01:22:59,200
want to arrange your 
information. 

1630
01:23:00,080 --> 01:23:01,400
Like. 
Storing things with like. 

1631
01:23:02,360 --> 01:23:06,280
Here's the thing. 
Like my, like I, I, I don't even

1632
01:23:06,280 --> 01:23:09,600
have any users in Asia, but just
knowing that my latency sucks 

1633
01:23:09,600 --> 01:23:13,600
there it it bothers me. 
Yeah, You know what I mean. 

1634
01:23:13,920 --> 01:23:15,640
Like a core level no I get. 
It dude, it's just. 

1635
01:23:15,680 --> 01:23:16,760
It's one of those things where 
it's just. 

1636
01:23:17,200 --> 01:23:20,560
Like like this isn't like this 
would actually be a really 

1637
01:23:20,560 --> 01:23:23,160
shitty experience if I logged 
into Killswitch in Asia? 

1638
01:23:24,160 --> 01:23:27,200
And and and I might someday. 
And if I did, I would be upset. 

1639
01:23:27,440 --> 01:23:28,640
I. 
Would be pissed right? 

1640
01:23:29,200 --> 01:23:33,480
But. 
But even if I spring up another 

1641
01:23:33,760 --> 01:23:39,000
node and I still have a database
in the US right? 

1642
01:23:39,000 --> 01:23:43,160
So my data, my CRUD actions are 
still going to be slow and make 

1643
01:23:43,160 --> 01:23:46,920
things feel shitty still. 
So like I need I need something 

1644
01:23:46,920 --> 01:23:50,600
like this. 
I, I, I, like I said, there's a,

1645
01:23:51,160 --> 01:23:53,960
a series of niches that 
something like this would fill. 

1646
01:23:54,320 --> 01:23:57,760
And I think that we have had our
heads stuck in the Postgres. 

1647
01:23:57,840 --> 01:24:01,080
You know, this Postgres is the 
way you know and date, you know,

1648
01:24:01,640 --> 01:24:03,480
monolithic databases are the 
way. 

1649
01:24:04,200 --> 01:24:06,280
They're good. 
You can solve a lot of problems 

1650
01:24:06,280 --> 01:24:07,680
with them. 
They're pretty awesome. 

1651
01:24:07,920 --> 01:24:10,760
But there's a limit. 
And they also force you into 

1652
01:24:11,480 --> 01:24:13,920
another subtle thing is like 
they force you into thinking in 

1653
01:24:13,920 --> 01:24:17,320
terms of sequel, right? 
Which is sometimes a problem. 

1654
01:24:17,840 --> 01:24:21,000
I would like if I could just, 
you know, I could get an account

1655
01:24:21,000 --> 01:24:23,880
and I could look at the number 
and then I could, you know, so 

1656
01:24:23,880 --> 01:24:26,160
we put all these abstraction 
layers on top of it, but 

1657
01:24:26,200 --> 01:24:28,440
ultimately we're still fighting 
with sequel to get some of this 

1658
01:24:28,440 --> 01:24:31,760
stuff done. 
And so I have to kind of shape 

1659
01:24:31,760 --> 01:24:35,640
my problem, my problem Sequel 
shaped in order to, to, to make 

1660
01:24:35,640 --> 01:24:38,600
it work. 
And it would be nice if I could 

1661
01:24:38,600 --> 01:24:41,920
just think in terms of data. 
Like I wanted to store this map.

1662
01:24:43,240 --> 01:24:44,840
I got a map of stuff. 
I just like to store it. 

1663
01:24:44,840 --> 01:24:46,440
I'd like to get it back when I 
asked for it. 

1664
01:24:46,440 --> 01:24:48,960
And I would like to make sure 
that when changes are made to 

1665
01:24:48,960 --> 01:24:51,720
it, that I get the latest stuff 
and that when I make changes to 

1666
01:24:51,720 --> 01:24:53,600
it, my changes don't stop on 
other people's. 

1667
01:24:53,800 --> 01:24:55,920
That'd be great. 
So, I mean, and of course, a 

1668
01:24:55,920 --> 01:24:59,640
whole bunch of problems get a 
lot simpler, right, conceptually

1669
01:25:00,000 --> 01:25:02,440
when you start thinking about 
things that way and because it 

1670
01:25:02,440 --> 01:25:05,280
lifts you out of it. 
So there's a class of problems 

1671
01:25:05,520 --> 01:25:06,400
that you can do it. 
You can. 

1672
01:25:06,400 --> 01:25:08,080
You can do that. 
That makes sense. 

1673
01:25:08,080 --> 01:25:12,160
Sequel has its place, yeah. 
You know, but I'm also like, I'm

1674
01:25:12,160 --> 01:25:16,440
thinking from the perspective of
like most CRUD web applications,

1675
01:25:16,440 --> 01:25:20,320
you're, you're, you're not going
to really have data conflicts 

1676
01:25:20,320 --> 01:25:22,760
because you're the only user 
touching your data. 

1677
01:25:23,920 --> 01:25:25,800
Right. 
Well, I mean, so and that's a 

1678
01:25:25,800 --> 01:25:27,600
good, that's a good point. 
That's an observation. 

1679
01:25:27,600 --> 01:25:29,440
It's important to understand. 
It's like, it's important to 

1680
01:25:29,440 --> 01:25:31,720
understand your machine, right? 
And how it's working. 

1681
01:25:32,320 --> 01:25:36,000
It's also important to 
understand the structure and 

1682
01:25:36,000 --> 01:25:39,880
texture of your data, right? 
It's like, because I mean, 

1683
01:25:39,880 --> 01:25:42,320
ultimately you're designing a 
container for something, right? 

1684
01:25:42,320 --> 01:25:45,760
You, you designing, I can't 
build a bucket. 

1685
01:25:45,760 --> 01:25:48,160
I don't know what a bucket is. 
I can't make a bucket if I don't

1686
01:25:48,160 --> 01:25:51,400
know what water does. 
Does it respond to gravity? 

1687
01:25:52,280 --> 01:25:54,680
Is it heavier than air? 
Does it stay? 

1688
01:25:54,840 --> 01:25:56,600
You know what I mean, Liz? 
Does it evaporate? 

1689
01:25:56,600 --> 01:25:58,000
Like what? 
What are the properties of 

1690
01:25:58,000 --> 01:25:59,400
water? 
And as soon as I know about the 

1691
01:25:59,400 --> 01:26:01,920
properties of water, I can build
a better container for it, 

1692
01:26:01,920 --> 01:26:03,720
right? 
The when we're building our 

1693
01:26:03,720 --> 01:26:05,320
systems, it's the same kind of 
thing. 

1694
01:26:05,840 --> 01:26:07,120
You need to understand the 
properties. 

1695
01:26:07,120 --> 01:26:12,480
So if I'm building linear or 
kill switch, I've got data 

1696
01:26:12,880 --> 01:26:17,720
that's it's not a huge amount 
for any given person, but in 

1697
01:26:17,720 --> 01:26:22,760
aggregate, there's a lot, right?
And the data's not supposed to 

1698
01:26:22,760 --> 01:26:24,720
cross. 
I mean, it would be really bad 

1699
01:26:24,720 --> 01:26:27,400
if I were to able be able to 
look at linear and see somebody 

1700
01:26:27,400 --> 01:26:30,560
else's tickets, right? 
You know, or pull up kill switch

1701
01:26:30,560 --> 01:26:32,280
and be able to see somebody 
else's data, right? 

1702
01:26:32,280 --> 01:26:35,280
That's a bad thing. 
And so you have these isolated 

1703
01:26:35,360 --> 01:26:38,000
silos. 
Some problems are not like that.

1704
01:26:38,160 --> 01:26:40,840
You have the good news on 
Facebook, right? 

1705
01:26:40,840 --> 01:26:43,040
The. 
Good news with kill switch is 

1706
01:26:43,040 --> 01:26:45,560
even if you got someone else's 
data, you couldn't decrypt it. 

1707
01:26:46,840 --> 01:26:48,840
This is good. 
So I mean, we're gonna roll that

1708
01:26:48,840 --> 01:26:50,800
but but we're not gonna give it 
to them in the first place 

1709
01:26:50,800 --> 01:26:52,000
because why? 
Exactly. 

1710
01:26:52,480 --> 01:26:55,280
But if it happened, they can't 
read it guys so. 

1711
01:26:55,400 --> 01:26:57,320
You'd be safe. 
The power of encryption. 

1712
01:26:58,800 --> 01:27:02,320
Math math for the win, right? 
All deep, dark math nerds, dude.

1713
01:27:02,640 --> 01:27:05,200
So The thing is, is that that 
you've got, you know, if you've 

1714
01:27:05,200 --> 01:27:07,600
got a data that's siloed, right,
that's one shape. 

1715
01:27:07,800 --> 01:27:11,040
I mean, you could run each and, 
and people do this where they 

1716
01:27:11,040 --> 01:27:14,600
have sequel Lite, you know, like
each split and they they Shard 

1717
01:27:14,600 --> 01:27:17,000
it that way and they'll they'll 
do these things where they'll 

1718
01:27:17,000 --> 01:27:19,600
take sequel Lite and they'll you
know, it'll come down to the 

1719
01:27:19,600 --> 01:27:21,720
node, they'll do things for it 
and they'll put the database 

1720
01:27:21,720 --> 01:27:24,280
back. 
You know, there's things that do

1721
01:27:24,280 --> 01:27:29,000
this and then you have something
like Twitter, you know, X or 

1722
01:27:29,000 --> 01:27:31,400
whatever it's called these days 
where, where I have a thing 

1723
01:27:31,400 --> 01:27:34,480
that's published, but other 
people see it, right? 

1724
01:27:34,480 --> 01:27:36,440
So that you have you have 
information that's kind of like 

1725
01:27:36,680 --> 01:27:40,680
semi public and it cuts across 
collection has this problem, 

1726
01:27:40,680 --> 01:27:43,120
right, where I put up people's 
cards and other people can see 

1727
01:27:43,120 --> 01:27:45,680
my collection, right. 
So it's a it's a different 

1728
01:27:45,680 --> 01:27:48,560
textural problem where I want 
people to see the things that I 

1729
01:27:48,560 --> 01:27:50,840
put up there versus I don't want
that at all. 

1730
01:27:51,360 --> 01:27:55,480
So it's important to understand 
your problem, right, and how, 

1731
01:27:55,480 --> 01:27:59,360
how, how that goes together. 
So I think like I said, if if, 

1732
01:27:59,440 --> 01:28:02,680
if people were so inclined as to
play with it a little bit, I 

1733
01:28:02,680 --> 01:28:05,600
think they would like the idea 
and if they like the idea enough

1734
01:28:05,600 --> 01:28:07,960
to submit some pull requests, we
can make it really awesome. 

1735
01:28:08,200 --> 01:28:10,120
So. 
OK. 

1736
01:28:10,120 --> 01:28:13,920
So Dalton has a question. 
Does bedrock run adjacent to the

1737
01:28:13,920 --> 01:28:18,000
prod beam or within it? 
Within it, it's a Elixir 

1738
01:28:18,000 --> 01:28:20,040
process, just like it's 100% 
Elixir. 

1739
01:28:20,400 --> 01:28:24,000
It just runs on OTP just like 
your other stuff right next to 

1740
01:28:24,000 --> 01:28:26,440
it. 
So if you were to run this on a 

1741
01:28:26,440 --> 01:28:29,200
single node and you were to ask 
a question, the node you're 

1742
01:28:29,200 --> 01:28:31,000
asking a question of is the same
node. 

1743
01:28:31,000 --> 01:28:33,640
It's a process hop. 
You're going to get your data in

1744
01:28:33,640 --> 01:28:36,080
nanoseconds. 
Yeah, it's so cool. 

1745
01:28:36,200 --> 01:28:39,560
It's so cool. 
It's safe to sell the next 

1746
01:28:39,560 --> 01:28:40,600
machine over. 
There might be a few 

1747
01:28:40,600 --> 01:28:43,360
milliseconds. 
But it's safe to say you have to

1748
01:28:43,360 --> 01:28:47,080
come back on to talk about 
beadwork, because I knew this 

1749
01:28:47,080 --> 01:28:49,000
was going to happen and we're 
going to talk about Bedrock for 

1750
01:28:49,000 --> 01:28:50,600
an hour and a half. 
But I like, I love. 

1751
01:28:50,600 --> 01:28:54,400
It are we at time. 
Well, we're not at time, but I 

1752
01:28:54,400 --> 01:28:56,120
don't think it's worth like. 
Because I do. 

1753
01:28:57,200 --> 01:28:59,280
I mean, we can touch on it if 
you want to. 

1754
01:28:59,480 --> 01:29:00,560
OK. 
All right. 

1755
01:29:00,640 --> 01:29:02,800
But I feel like it would be 
better to talk about beadwork 

1756
01:29:02,800 --> 01:29:06,200
for an hour and a half. 
Oh, OK, I could go on and on. 

1757
01:29:07,160 --> 01:29:10,680
It's up to you though. 
Well, I mean, let's let's tell 

1758
01:29:10,680 --> 01:29:14,360
people what it is, right? 
So what the whistle a little 

1759
01:29:14,360 --> 01:29:17,440
bit. 
So it's not a crazy idea and 

1760
01:29:17,440 --> 01:29:21,640
it's not a new one. 
But you have a situation where 

1761
01:29:21,640 --> 01:29:26,160
you have agents and they need to
be able to keep track of things.

1762
01:29:26,160 --> 01:29:29,560
And all these agents they have 
like to do lists and they really

1763
01:29:29,560 --> 01:29:31,920
suck because when you hit 
compaction, the To Do List get 

1764
01:29:31,920 --> 01:29:33,640
compacted. 
Bad things happen. 

1765
01:29:33,640 --> 01:29:37,640
People work out of a markdown 
document, the agent forgets 

1766
01:29:37,640 --> 01:29:40,520
where it needs to update the 
little check box and bad things 

1767
01:29:40,520 --> 01:29:42,840
happen. 
So it's not a elegant system. 

1768
01:29:43,720 --> 01:29:46,840
And so Steve Yagi came up with 
this idea of beads. 

1769
01:29:47,040 --> 01:29:49,120
And it's a ticketing system 
that's kind of baked into Git. 

1770
01:29:49,960 --> 01:29:55,800
And it's it's, it's slick. 
But now it's 200 megabytes of 

1771
01:29:55,800 --> 01:29:58,680
stuff to download and it does 
all this crazy. 

1772
01:29:59,040 --> 01:30:00,640
And So what I did is I took that
strip. 

1773
01:30:01,960 --> 01:30:07,720
Well, it's built with AI big 
into the dark factory idea and 

1774
01:30:08,320 --> 01:30:10,720
it, it, it's got, I mean, it's 
got warts and legs and horns by 

1775
01:30:10,720 --> 01:30:13,400
now. 
And so I practiced it. 

1776
01:30:13,440 --> 01:30:17,280
It, it hit me one day when I 
was, I, I downloaded it the 

1777
01:30:17,280 --> 01:30:21,160
latest version and it told me I 
needed to run BD doctor to get 

1778
01:30:21,160 --> 01:30:23,200
it to work. 
And I was like, OK, cool. 

1779
01:30:23,200 --> 01:30:28,000
So then I ran it and BD doctor 
told me to run BD doctor, which 

1780
01:30:28,080 --> 01:30:31,080
was rage inducing. 
And so I practice a little rage 

1781
01:30:31,080 --> 01:30:33,680
driven development and end up 
building speed work. 

1782
01:30:34,120 --> 01:30:37,680
So there is a simple, light, 
reasonable system for managing 

1783
01:30:37,680 --> 01:30:40,680
tickets for agents. 
It doesn't get, it doesn't in a 

1784
01:30:40,680 --> 01:30:43,440
clever way that doesn't corrupt 
off your repo. 

1785
01:30:43,560 --> 01:30:46,720
And you know, like I said, we 
could talk about it lots more at

1786
01:30:46,720 --> 01:30:51,120
some other point, but it's, it's
a good tool and I think people 

1787
01:30:51,120 --> 01:30:53,280
would like it if they knew about
it. 

1788
01:30:54,720 --> 01:30:56,200
So. 
Yeah, I agree. 

1789
01:30:56,360 --> 01:30:59,840
It's pretty dope. 
I think what we should do, I was

1790
01:30:59,840 --> 01:31:03,280
looking at my schedule is trying
to get you back on. 

1791
01:31:05,960 --> 01:31:10,800
Wait, what month are we in? 
June 19th is my next opening. 

1792
01:31:12,160 --> 01:31:14,280
Should we do a beadwork episode 
then? 

1793
01:31:15,480 --> 01:31:17,760
At least I. 
Might even have something more 

1794
01:31:17,760 --> 01:31:18,840
interesting to talk to than 
that. 

1795
01:31:20,200 --> 01:31:23,600
Something cooking. 
Oh, man, All right, Jason 

1796
01:31:23,600 --> 01:31:27,640
already always cooking. 
Dude, well, that's The thing is 

1797
01:31:27,640 --> 01:31:30,920
like these days you got like 
bionic arms, right, you know? 

1798
01:31:30,920 --> 01:31:32,400
It's bad. 
It's everything. 

1799
01:31:32,400 --> 01:31:36,520
Like the busier I am, the more 
ideas pop in my head and you 

1800
01:31:36,520 --> 01:31:38,400
have to be like, no, don't build
that. 

1801
01:31:38,400 --> 01:31:40,680
Do not build that. 
Focus on this. 

1802
01:31:41,560 --> 01:31:45,680
It's going to come down to, I 
mean, in a world where anyone 

1803
01:31:45,680 --> 01:31:51,000
can build anything, it's going 
to come down to style and taste 

1804
01:31:52,080 --> 01:31:53,920
like, yeah, right. 
I mean, I could build. 

1805
01:31:54,120 --> 01:31:56,200
I could build AI could build a 
house with purple polka dots. 

1806
01:31:56,200 --> 01:31:58,120
But should I? 
We were just talking about that 

1807
01:31:58,120 --> 01:32:04,040
with Mike, like it's, it's 
coming down to style and taste 

1808
01:32:04,040 --> 01:32:07,360
for building good products 
because everyone there's, I mean

1809
01:32:07,360 --> 01:32:11,160
not everyone, but for the most 
part, engineers can read and 

1810
01:32:11,160 --> 01:32:13,360
know if code is well written or 
not. 

1811
01:32:14,040 --> 01:32:16,840
Like that's not like the highest
of skill anymore. 

1812
01:32:19,440 --> 01:32:21,440
People have a sense of smell, 
right? 

1813
01:32:21,480 --> 01:32:23,560
Like, and you look at something 
and you can be like, oh, this is

1814
01:32:23,560 --> 01:32:24,720
smelly. 
Yeah, yeah, yeah. 

1815
01:32:24,720 --> 01:32:27,000
It doesn't. 
It's just, it's just solving the

1816
01:32:27,000 --> 01:32:28,840
local problem over and over and 
over again. 

1817
01:32:28,840 --> 01:32:32,840
And sometimes the aggregate is 
silly and people call it slop. 

1818
01:32:33,240 --> 01:32:36,240
But let me, I'll tell you a 
secret, right? 

1819
01:32:36,240 --> 01:32:39,160
Slop has always existed, man. 
Like, since forever. 

1820
01:32:39,160 --> 01:32:41,480
People have been making crystal 
palaces of crazy. 

1821
01:32:41,480 --> 01:32:43,400
Crazy. 
Shit, I always joke. 

1822
01:32:43,600 --> 01:32:45,360
I was like they. 
Just do it faster now. 

1823
01:32:45,520 --> 01:32:49,080
Before LLMS made it, we were 
copying and pasting dangerous 

1824
01:32:49,080 --> 01:32:53,360
ass code off stack Overflow. 
Like now it does it for us, 

1825
01:32:53,360 --> 01:32:57,160
right? 
Yeah. 

1826
01:32:58,240 --> 01:33:00,640
You know, but but will it work 
next week? 

1827
01:33:00,640 --> 01:33:02,760
That's the problem. 
It's AI doesn't have to deal 

1828
01:33:02,760 --> 01:33:04,360
with the consequences of its 
actions. 

1829
01:33:05,560 --> 01:33:08,320
I'm excited. 
I'm having Peter, Peter Ulrich 

1830
01:33:08,320 --> 01:33:12,720
back on and he's been finding 
like all those CPS, yeah with. 

1831
01:33:13,440 --> 01:33:15,400
That's that's exciting. 
Yeah. 

1832
01:33:15,880 --> 01:33:18,920
Well, I mean, here's the thing. 
These things are they can focus,

1833
01:33:19,160 --> 01:33:22,760
you know, autistically on, you 
know, finding tracking something

1834
01:33:22,760 --> 01:33:25,000
down and that's it's, it's 
amazing. 

1835
01:33:25,160 --> 01:33:28,240
So anyhow. 
So the tools used by the right 

1836
01:33:28,240 --> 01:33:31,280
people can be pretty awesome, or
in the right way. 

1837
01:33:32,320 --> 01:33:34,720
It's always ever been, man. 
I mean, like, you know, it's, 

1838
01:33:35,080 --> 01:33:40,000
it's always been that way. 
It it just it took more that 

1839
01:33:40,000 --> 01:33:44,480
dedication and nerdiness back in
the day, you know, you just had 

1840
01:33:44,480 --> 01:33:46,040
to because you have to know how 
to make things. 

1841
01:33:46,040 --> 01:33:49,440
Now you can just, you know, 
Leviosa it into existence. 

1842
01:33:50,440 --> 01:33:52,880
It's a little a little bit 
different, so. 

1843
01:33:56,400 --> 01:33:58,600
Yep. 
What am I down? 

1844
01:33:58,600 --> 01:34:01,000
I don't. 
Know you get that look on your 

1845
01:34:01,000 --> 01:34:08,080
face. 
I pushed a button but this is a 

1846
01:34:08,080 --> 01:34:10,760
lot of fun. 
I really appreciate you coming 

1847
01:34:10,760 --> 01:34:16,640
on bedrock, sounds amazing. 
I will send over some links for 

1848
01:34:16,640 --> 01:34:20,920
the show notes and to underlying
foundation DB. 

1849
01:34:21,160 --> 01:34:23,960
If you don't play with my stuff,
go read about their stuff. 

1850
01:34:24,000 --> 01:34:27,200
It's super awesome and you might
want to use their stuff if you 

1851
01:34:27,200 --> 01:34:27,760
don't use mine. 
It's. 

1852
01:34:28,200 --> 01:34:29,120
Good stuff. 
That's awesome. 

1853
01:34:29,160 --> 01:34:31,080
Yeah. 
Well, thanks a lot for joining 

1854
01:34:31,080 --> 01:34:33,200
me today and we're going to get 
you back on. 

1855
01:34:33,200 --> 01:34:35,520
Hopefully you're free on the 
19th of June. 

1856
01:34:36,240 --> 01:34:37,080
Yeah, we'll see. 
I think. 

1857
01:34:37,080 --> 01:34:38,520
I think we can make that work. 
Cool. 

1858
01:34:38,600 --> 01:34:40,360
All right, bud. 
All right. 

1859
01:34:40,400 --> 01:34:42,400
Have a good one. 
Thanks everyone for tuning in 

1860
01:34:42,400 --> 01:34:47,720
and I'll see you guys next week 
testing.

