1
00:00:00,049 --> 00:00:02,819
The most important thing about
the cloud is collaboration.

2
00:00:02,819 --> 00:00:05,319
You can send someone a link and
you're working together right away.

3
00:00:05,629 --> 00:00:09,219
But the downside of the cloud is that
you don't actually have the software.

4
00:00:09,559 --> 00:00:14,669
And so what we think you should have is
a copy of the program and the data on

5
00:00:14,669 --> 00:00:18,169
your computer, but it should still be
able to collaborate with other people.

6
00:00:18,695 --> 00:00:21,045
Welcome to the localfirst.fm podcast.

7
00:00:21,255 --> 00:00:25,225
I'm your host, Johanna Schickling, and I'm
a web developer, a startup founder, and

8
00:00:25,225 --> 00:00:27,275
love the craft of software engineering.

9
00:00:27,687 --> 00:00:31,947
For the past few years, I've been on a
journey to build a modern, high quality

10
00:00:31,977 --> 00:00:34,027
music app using web technologies.

11
00:00:34,407 --> 00:00:38,957
And in doing so, I've been falling down
the rabbit hole of local first software.

12
00:00:39,313 --> 00:00:42,443
This podcast is your invitation
to join me on that journey.

13
00:00:42,888 --> 00:00:47,158
In this inaugural episode, I'm speaking
to Peter van Hardenberg, who helped to

14
00:00:47,158 --> 00:00:49,888
coin and popularize the term Local First.

15
00:00:50,363 --> 00:00:53,813
As the director of the Ink & Switch
Research Lab, he's been on

16
00:00:53,813 --> 00:00:56,913
the forefront of this work for
the better part of a decade.

17
00:00:57,473 --> 00:01:01,093
My conversation with him today
starts with the basics of what Local

18
00:01:01,103 --> 00:01:04,963
First is and why you, an application
developer, should care about it.

19
00:01:05,768 --> 00:01:10,428
Before getting into it, also a big
thank you to Expo and Crab Nebula for

20
00:01:10,428 --> 00:01:14,738
supporting this podcast and supporting
the local first ecosystem as a whole.

21
00:01:15,218 --> 00:01:17,368
And now my interview with Peter.

22
00:01:19,069 --> 00:01:21,119
Hello, welcome Peter.

23
00:01:21,239 --> 00:01:25,889
Thank you so much for making it today
to kick off this new podcast with me.

24
00:01:26,269 --> 00:01:28,129
So would you mind introducing yourself?

25
00:01:28,849 --> 00:01:29,029
Yeah.

26
00:01:29,049 --> 00:01:30,949
Hi, my name is Peter Van Hardenberg.

27
00:01:31,009 --> 00:01:34,896
I am the director of
Ink & Switch Research Labs.

28
00:01:34,916 --> 00:01:37,979
We're an independent industrial
research lab studying the future

29
00:01:37,979 --> 00:01:39,369
of computing and tools for thought.

30
00:01:40,299 --> 00:01:40,859
Awesome.

31
00:01:40,929 --> 00:01:43,286
Peter and I have known
us for quite a while.

32
00:01:43,483 --> 00:01:47,803
Back then, Peter, has been just
closing up his last chapter at Heroku

33
00:01:48,293 --> 00:01:50,623
which I've been always a big fan of.

34
00:01:50,743 --> 00:01:57,913
Peter found his way now working on local
first and defining what local first is.

35
00:01:58,030 --> 00:02:01,387
Before going into it, what
has led you to   local first?

36
00:02:02,212 --> 00:02:04,592
Yeah, I mean, obviously it's
a bit of a departure, right?

37
00:02:04,622 --> 00:02:07,642
Like, here I was building
a platform as a service.

38
00:02:07,752 --> 00:02:12,162
You know, Heroku, for those who
don't know, is a,  basically a host

39
00:02:12,437 --> 00:02:15,677
Primarily when it started for Ruby
on Rails applications, but over

40
00:02:15,677 --> 00:02:16,987
time for pretty much everything.

41
00:02:17,427 --> 00:02:20,457
And the idea behind Heroku is
that you could build an app on

42
00:02:20,457 --> 00:02:21,797
your machine and then push it.

43
00:02:22,387 --> 00:02:26,187
To a continuous delivery system, and it
would put it live in the cloud, and there

44
00:02:26,187 --> 00:02:30,927
are other systems like that today, you
can imagine it as you know, proto Netlify

45
00:02:30,947 --> 00:02:34,947
or early kind of, containerized cloud.

46
00:02:35,577 --> 00:02:38,947
Yeah, and it is a bit of a departure
to go from trying to get everybody's

47
00:02:38,947 --> 00:02:41,967
apps running in the cloud to telling
people that maybe they should

48
00:02:41,967 --> 00:02:43,677
just run them on their computer.

49
00:02:44,127 --> 00:02:46,487
So I guess I should really
explain how we got there.

50
00:02:47,927 --> 00:02:50,317
I think for me.

51
00:02:50,877 --> 00:02:56,567
I'd like to tell a story about riding the
train in San Francisco, the subway there.

52
00:02:57,097 --> 00:03:00,597
And my friends had been working on
a music app called Rdio which was

53
00:03:00,597 --> 00:03:02,267
sort of a competitor to Spotify.

54
00:03:02,277 --> 00:03:03,347
They're not around anymore.

55
00:03:03,917 --> 00:03:08,114
And you know, as I was riding on
this train, I had been listening

56
00:03:08,114 --> 00:03:10,844
to music in the online mode
when the train was above ground.

57
00:03:11,254 --> 00:03:14,624
And then when we went into the tunnel,
the music would just stop working.

58
00:03:15,164 --> 00:03:17,494
And it was really...

59
00:03:17,999 --> 00:03:22,249
upsetting to me because like I couldn't go
back and even listen to songs I'd already

60
00:03:22,249 --> 00:03:27,319
listened to or like scroll through the
playlists that I had because I wasn't in

61
00:03:27,339 --> 00:03:34,909
offline mode and I just remember having
this feeling like we've really blown it

62
00:03:35,764 --> 00:03:39,384
we've turned software from this thing that
you can just have like they call it an

63
00:03:39,394 --> 00:03:43,514
informational good that means that like
you know the marginal cost of copying it

64
00:03:43,514 --> 00:03:47,654
and using it as zero it's just it was this
idea that like software had gone from this

65
00:03:47,654 --> 00:03:51,894
thing that anyone could have a copy of To
a thing that didn't even work on the train

66
00:03:51,894 --> 00:03:53,454
because I didn't really have the app.

67
00:03:53,494 --> 00:03:57,244
Even though I'd had the data in my
hand on my screen in front of me, in

68
00:03:57,244 --> 00:04:01,254
my ears listening to it, somehow it had
just completely evaporated in the time

69
00:04:01,254 --> 00:04:02,804
it took a train to go into a tunnel.

70
00:04:02,944 --> 00:04:03,584
right.

71
00:04:03,654 --> 00:04:06,544
And riding a train is
not this out there thing.

72
00:04:06,594 --> 00:04:08,144
It's like this is a daily thing.

73
00:04:08,404 --> 00:04:09,764
Yeah, is my daily commute.

74
00:04:09,764 --> 00:04:12,874
And, you know, there are people out
there who say, Oh, yeah, you know, the

75
00:04:12,874 --> 00:04:16,754
Internet's going to be everywhere next
week, and have you taken a subway lately?

76
00:04:16,894 --> 00:04:20,004
You know, and like, both
in big cities, right?

77
00:04:20,004 --> 00:04:22,634
You have this problem, but also
in more rural communities, right?

78
00:04:22,634 --> 00:04:26,104
There's lots of places where there's
no Internet, or the Internet is slow.

79
00:04:26,104 --> 00:04:28,584
And you can even be in places
where there is Internet, right?

80
00:04:28,614 --> 00:04:32,064
But your cell phone reception
isn't great next to the fridge,

81
00:04:32,064 --> 00:04:33,444
or your Wi Fi has a cut out.

82
00:04:33,864 --> 00:04:37,314
Faced this every day when I'm just like
leaving the house and  there's just this

83
00:04:37,314 --> 00:04:40,474
little gap of the wifi stops  responding.

84
00:04:40,484 --> 00:04:44,454
There's a little bit of signal and my
apps just  don't work properly anymore.

85
00:04:44,919 --> 00:04:46,349
Yeah, everything kind of locks up.

86
00:04:46,349 --> 00:04:50,009
Your phone is just a little black
brick without a good Wi Fi connection.

87
00:04:50,789 --> 00:04:53,669
And so that got me thinking,
like, well, why do we build

88
00:04:53,669 --> 00:04:54,869
things the way we build them?

89
00:04:54,869 --> 00:04:57,559
And the answer to some extent,
I think, was just that, you

90
00:04:57,559 --> 00:04:59,109
know, we told people to.

91
00:04:59,724 --> 00:04:59,964
Right.

92
00:04:59,964 --> 00:05:02,874
We made it easy to build apps for
the cloud, and then everybody did.

93
00:05:03,014 --> 00:05:03,444
Yeah.

94
00:05:03,865 --> 00:05:07,605
Yeah, and so at Heroku, I had
worked on our data services mostly.

95
00:05:07,605 --> 00:05:09,365
That was our Postgres service.

96
00:05:09,795 --> 00:05:13,455
And I started thinking about how
really the problem is that the data

97
00:05:13,465 --> 00:05:18,315
that you have for your application
doesn't actually live on your device.

98
00:05:18,315 --> 00:05:19,445
It lives on the server.

99
00:05:20,055 --> 00:05:23,425
And so I started thinking, surely
there's some way to get this data

100
00:05:23,445 --> 00:05:26,005
from the network down to the computer.

101
00:05:26,600 --> 00:05:27,370
And it's funny.

102
00:05:27,370 --> 00:05:31,150
You know, Johannes, you and I
met originally through Prisma

103
00:05:31,220 --> 00:05:34,060
and GraphQL and database schemas
and those kinds of things.

104
00:05:34,460 --> 00:05:36,890
And this always struck me as a
really adjacent problem, which is

105
00:05:36,890 --> 00:05:40,050
that fundamentally, on your server,
you're doing this process of taking

106
00:05:40,050 --> 00:05:44,040
data from a database and getting
it into your sort of API back end.

107
00:05:44,390 --> 00:05:47,300
And then you do a separate,
distinct process to get data from

108
00:05:47,300 --> 00:05:50,060
the API to the client, right?

109
00:05:50,100 --> 00:05:53,705
And then when it gets to the client,
you just kind of throw it away.

110
00:05:54,405 --> 00:05:58,465
And so I started thinking like,
well, maybe it would make a lot more

111
00:05:58,465 --> 00:06:02,345
sense if we just sort of synchronized
data between those points instead of

112
00:06:02,345 --> 00:06:03,885
fetching it on demand all the time.

113
00:06:04,165 --> 00:06:06,805
And in fact, that's sort of how
offline modes already worked.

114
00:06:06,895 --> 00:06:11,305
And so I started thinking more and
more about this and got involved with

115
00:06:11,445 --> 00:06:15,025
some great fellow researchers like
Martin Kleppmann, who's currently at

116
00:06:15,025 --> 00:06:18,535
TU Munich, but was at Cambridge at the
time and had just written a paper about.

117
00:06:19,010 --> 00:06:22,990
What are called JSON CRDTs, which is
like a technology for synchronizing

118
00:06:23,000 --> 00:06:25,950
changes between two documents
in a way where you didn't just

119
00:06:25,950 --> 00:06:27,450
have to clobber one or the other.

120
00:06:28,185 --> 00:06:31,515
And yeah, that one thing led to
another, and we've been working on

121
00:06:31,515 --> 00:06:33,205
the problem for about five years now.

122
00:06:33,425 --> 00:06:36,595
I think you've been telling me
about it  already many years ago.

123
00:06:37,025 --> 00:06:40,755
And initially I wasn't quite sure
it's like, Hey, is this about  only

124
00:06:40,805 --> 00:06:45,395
offline mode, but step by step I
realize, Oh, there's much more to it.

125
00:06:45,418 --> 00:06:49,728
And like, fundamentally this can
unlock much higher quality software

126
00:06:49,778 --> 00:06:53,798
and also not make it harder for me
as an application developer, but

127
00:06:53,798 --> 00:06:55,568
actually make things a lot simpler.

128
00:06:55,918 --> 00:06:57,758
We're maybe not fully there yet.

129
00:06:58,218 --> 00:07:00,778
But that's  a vision I totally buy into.

130
00:07:01,258 --> 00:07:07,025
So this is the path that has led you
to  think what becomes local first.

131
00:07:07,445 --> 00:07:09,405
Did you coin that term?

132
00:07:09,737 --> 00:07:14,007
So the term local first came
around in a call we had one day.

133
00:07:14,007 --> 00:07:14,427
I think...

134
00:07:15,072 --> 00:07:18,412
Folks have given me credit at the lab,
but it was definitely one of those

135
00:07:18,442 --> 00:07:22,602
open ended conversations where several
of us were kind of trying to find the

136
00:07:22,602 --> 00:07:24,682
right term for this for a long time.

137
00:07:24,682 --> 00:07:28,472
I'd actually planned to refer to
this as serverless technology,

138
00:07:28,472 --> 00:07:33,782
but then Amazon came out with this
so called serverless technology,

139
00:07:33,812 --> 00:07:36,302
which in fact was just all servers.

140
00:07:36,677 --> 00:07:39,947
So I found that sort of like
frustrating and slightly upsetting

141
00:07:39,957 --> 00:07:40,967
because it felt misleading.

142
00:07:41,357 --> 00:07:44,597
But we really like the idea of calling
it local first technology because

143
00:07:44,747 --> 00:07:48,297
the idea was to emphasize that it's
not about doing away with the cloud.

144
00:07:48,477 --> 00:07:49,787
You know, it's not really serverless.

145
00:07:50,247 --> 00:07:54,157
What we wanted to say was actually,
we just want to prioritize the user's

146
00:07:54,157 --> 00:07:58,477
experience on their device and make
that easy to deliver on high quality.

147
00:07:58,967 --> 00:08:00,737
Yeah, I like that a lot.

148
00:08:00,737 --> 00:08:05,227
You've been mentioning the story of
Listening to Rdio on the subway and that's

149
00:08:05,227 --> 00:08:09,544
not working, but from  an application
developer perspective what would you

150
00:08:09,544 --> 00:08:13,824
say were the frustrations that has
led you to think about local first.

151
00:08:14,779 --> 00:08:15,889
Yeah, I mean, it's a few things.

152
00:08:15,899 --> 00:08:20,189
One is if you just think about software
development as an app developer, it's

153
00:08:20,189 --> 00:08:23,009
sort of obscenely complicated, right?

154
00:08:23,009 --> 00:08:29,209
You've got To build a client app,
probably using Node and JavaScript

155
00:08:29,259 --> 00:08:34,679
and React and Vite and tailwind
and all these technologies.

156
00:08:35,484 --> 00:08:39,874
Then you have to build like the API
backend, which is its own separate kind

157
00:08:39,874 --> 00:08:46,984
of node app or part of your existing app
with all of its own sort of like JWTs

158
00:08:47,004 --> 00:08:51,854
and, you know, database sync technologies
and GraphQL and, you know, you're

159
00:08:52,014 --> 00:08:53,774
building out all that whole system.

160
00:08:54,104 --> 00:08:56,444
And then behind that, you actually
have your data layer, which is like.

161
00:08:56,494 --> 00:09:02,134
Postgres and  so you have like in kind
of the best case in the minimum case.

162
00:09:02,649 --> 00:09:05,689
You know, for of modern web dev,
you've got this three tier stack as

163
00:09:05,689 --> 00:09:08,629
they call it, but the reality is,
it's not just those three tiers.

164
00:09:08,629 --> 00:09:12,369
You also need like pager duty for
letting you know when things are down.

165
00:09:12,369 --> 00:09:15,099
And maybe you're using like a
bunch of weird Amazon services.

166
00:09:15,099 --> 00:09:17,149
You got a DynamoDB thing going on.

167
00:09:17,719 --> 00:09:21,069
Then, you know, No one's hosting
things on Heroku anymore.

168
00:09:21,069 --> 00:09:24,969
You got to put stuff up on, you know,
you need a Kubernetes cluster somewhere.

169
00:09:24,969 --> 00:09:26,829
And, you know, it's just, it's a mess.

170
00:09:27,119 --> 00:09:28,419
it's insanely complicated.

171
00:09:28,469 --> 00:09:33,999
So there's just like a lot of complexity
feels gratuitous for like making an

172
00:09:34,009 --> 00:09:35,589
app for your soccer team or something.

173
00:09:35,719 --> 00:09:38,849
And not even from a tooling
perspective, but just the minimal

174
00:09:38,859 --> 00:09:43,179
architectural footprint  is quite
a lot for often very simple apps.

175
00:09:43,959 --> 00:09:44,379
That's right.

176
00:09:44,439 --> 00:09:46,419
And then on top of that,
you have to pay for it all.

177
00:09:46,794 --> 00:09:47,124
Right.

178
00:09:47,694 --> 00:09:50,414
You know, maybe you're a YC startup,
you get some credits to get you

179
00:09:50,414 --> 00:09:52,894
started, but that's definitely
the drug dealer model, right?

180
00:09:52,924 --> 00:09:54,657
Like first one's free, right?

181
00:09:54,657 --> 00:09:58,467
And then, you know, I have personally
known a number of companies that died,

182
00:09:58,477 --> 00:10:05,517
even though they were, uh, their product
was growing rapidly, but just the cost

183
00:10:05,517 --> 00:10:10,547
of running their infrastructure was
too high to justify the system, right?

184
00:10:10,557 --> 00:10:14,667
Like they didn't see how they'd be able
to turn this thing into a Like a venture

185
00:10:14,667 --> 00:10:16,967
backed billion dollar valuation company.

186
00:10:16,967 --> 00:10:20,097
And so they couldn't get any money
to keep the lights on despite having

187
00:10:20,107 --> 00:10:21,437
a popular and growing product.

188
00:10:21,987 --> 00:10:22,937
So that's crazy.

189
00:10:23,927 --> 00:10:24,617
And then like.

190
00:10:24,992 --> 00:10:28,792
Even on top of all of that, like, let's
say that you've managed to, you know,

191
00:10:28,802 --> 00:10:32,922
raise enough money to hire an entire team
to be on call for you and you managed

192
00:10:32,932 --> 00:10:36,492
to, you know, build a product that you
can convince somebody will be a billion

193
00:10:36,492 --> 00:10:40,142
dollar, you know, valuation business at
some point and you learn all of those

194
00:10:40,142 --> 00:10:45,142
skills and you build all those systems
out and everything, you know, ultimately,

195
00:10:45,142 --> 00:10:47,002
it's still very fragile, right?

196
00:10:47,002 --> 00:10:51,902
In In time, as well as in space,
you know, we've all had all of these

197
00:10:51,912 --> 00:10:56,042
products now that we loved and used,
whether it's, you know, Google reader

198
00:10:56,042 --> 00:11:00,582
or dark sky or, you know, pick your
favorite favorite dead tech, you know,

199
00:11:00,582 --> 00:11:04,022
and these products go on the founders,
when they get acquired, they put up

200
00:11:04,022 --> 00:11:08,122
this blog post about what an incredible
journey building this product has been.

201
00:11:08,132 --> 00:11:10,922
And, you know, the incredible
journey that's happening is that

202
00:11:10,932 --> 00:11:14,642
your software with your data is going
away and you can't have it anymore.

203
00:11:15,007 --> 00:11:15,277
Right.

204
00:11:15,277 --> 00:11:16,257
They're being acquired.

205
00:11:16,257 --> 00:11:17,347
They're shutting everything down.

206
00:11:17,347 --> 00:11:20,177
And if you're lucky, you
know, as with Rdio you can

207
00:11:20,187 --> 00:11:21,827
download a bunch of JSON files.

208
00:11:22,147 --> 00:11:23,777
That's all that's left
for you as the user.

209
00:11:23,977 --> 00:11:28,517
And I just want to say, like, this is a
problem we created for ourselves, right?

210
00:11:28,517 --> 00:11:32,927
Like, I can go and download an old
Microsoft, you know, MS DOS copy of,

211
00:11:32,937 --> 00:11:37,797
like, WordPerfect or something from
the late 80s, and it'll still run.

212
00:11:38,237 --> 00:11:42,457
You know, I can get doom on a floppy
disk and it'll still run, but like

213
00:11:42,687 --> 00:11:46,567
software that came out for the cloud,
you know, it's just gone when it's gone.

214
00:11:46,567 --> 00:11:47,687
And that's it, right?

215
00:11:47,697 --> 00:11:53,897
This is, they call a certain period
of history, the dark ages, not, you

216
00:11:53,897 --> 00:11:58,947
know, formally because they were bad,
but because they're dark to us today,

217
00:11:58,967 --> 00:12:02,697
because We can't go back and look at
the records from them, they were lost.

218
00:12:02,957 --> 00:12:06,077
And so similarly, we have built
a dark age for technology.

219
00:12:06,377 --> 00:12:09,857
Not that it's bad, there are a lot of
things that are great, but that there

220
00:12:09,857 --> 00:12:12,907
won't be a record of our work here, right?

221
00:12:12,927 --> 00:12:14,997
Like the things that you and
I are building, the work that

222
00:12:14,997 --> 00:12:18,297
I did at Heroku, the apps that
we've made and put out there.

223
00:12:18,837 --> 00:12:23,747
Because they're not, they don't exist
outside of the one set of servers they

224
00:12:23,747 --> 00:12:28,427
run on, you know, when they go offline,
that, that's it they're gone forever.

225
00:12:28,987 --> 00:12:30,537
And I think that kind of sucks.

226
00:12:31,567 --> 00:12:32,837
Yeah, I fully agree.

227
00:12:32,887 --> 00:12:36,527
I mean, having gotten into software
development,  step by step,  I

228
00:12:36,557 --> 00:12:40,527
could take my first steps with
building a little thing with  HTML,

229
00:12:40,577 --> 00:12:43,667
CSS and step by step, you want to
make it more functional, more real.

230
00:12:43,887 --> 00:12:48,207
And then you start  pulling on that
thread, like all that complexity comes

231
00:12:48,587 --> 00:12:50,347
towards you and  it's never ending.

232
00:12:50,397 --> 00:12:55,767
So it's so much to learn, so much to
maintain, so much to pay for and operate.

233
00:12:56,107 --> 00:13:00,727
So I wish there was a simpler way to,
to build things and to run things.

234
00:13:00,737 --> 00:13:04,747
So maybe this is a good point
to ask, what is local first?

235
00:13:05,092 --> 00:13:06,312
What is Local First?

236
00:13:06,412 --> 00:13:11,069
local-first software is software
that runs on your computer and

237
00:13:11,079 --> 00:13:12,469
collaborates with other people.

238
00:13:12,989 --> 00:13:16,499
We think that the most important thing
about the cloud is collaboration.

239
00:13:16,499 --> 00:13:20,539
This ubiquitous, always accessible,
copy of your data from anywhere.

240
00:13:20,539 --> 00:13:23,039
You can send someone a link and
you're working together right away.

241
00:13:23,349 --> 00:13:24,939
Nothing to download, nothing to install.

242
00:13:25,589 --> 00:13:29,179
But the downside of the cloud is that
you don't actually have the software.

243
00:13:29,519 --> 00:13:34,789
And so what we think you should have is a
copy of the program and the data on your

244
00:13:34,789 --> 00:13:38,419
computer, but it should still be able
to collaborate with other people, right?

245
00:13:38,419 --> 00:13:41,559
We want the good parts of the
cloud combined with the good

246
00:13:41,559 --> 00:13:42,979
parts of the old way of building.

247
00:13:43,384 --> 00:13:48,624
And in a way right now we have
great collaboration tools like

248
00:13:48,964 --> 00:13:51,644
Google Drive and Figma, etc.

249
00:13:51,894 --> 00:13:54,264
But it's all by default
lives in the cloud.

250
00:13:54,594 --> 00:13:59,494
So you  suggesting let's have the cake
and eat it too, so that the software

251
00:13:59,554 --> 00:14:05,334
fully works on the client and we only use
the server for the absolutely necessary

252
00:14:05,334 --> 00:14:08,204
pieces but still have collaboration.

253
00:14:09,369 --> 00:14:09,819
That's right.

254
00:14:09,859 --> 00:14:14,119
And Doug Engelbart, you know,
a famous computer science

255
00:14:14,119 --> 00:14:20,399
researcher he talked about how
we can de- augment our intellect.

256
00:14:20,479 --> 00:14:22,569
We can make things worse for ourselves.

257
00:14:23,054 --> 00:14:27,054
And he demonstrated this really
poetically by taping a brick to a pencil

258
00:14:27,054 --> 00:14:28,434
and asking people to write with it.

259
00:14:29,203 --> 00:14:33,063
So I'm not here to say that there are
free lunches necessarily in solving these

260
00:14:33,063 --> 00:14:37,603
technical problems, but I do think that
we may have taped a few giant bricks

261
00:14:37,603 --> 00:14:41,903
to our pencils here, and that there's
a lot of unnecessary difficulty that

262
00:14:41,903 --> 00:14:46,993
we've introduced by picking architectures
that are not well suited to the task.

263
00:14:47,258 --> 00:14:49,408
These are in many cases,
great technologies.

264
00:14:49,438 --> 00:14:53,288
It's just that we're deploying the
same technology that we would use to

265
00:14:53,288 --> 00:14:57,961
build a billion person app to build a
10 person app or a million person app.

266
00:14:58,081 --> 00:15:00,691
And the requirements are
just radically different.

267
00:15:01,151 --> 00:15:08,927
Now, I think this sort of homogenization
of the technical stack is part of why

268
00:15:08,937 --> 00:15:10,417
we're in the position that we're in.

269
00:15:10,827 --> 00:15:13,127
Like Jonathan Edwards famously
said, you know, we were

270
00:15:13,137 --> 00:15:14,877
promised bicycles for the mind.

271
00:15:15,297 --> 00:15:18,524
But they gave us aircraft
carriers instead, right?

272
00:15:18,524 --> 00:15:22,264
So, so we're building aircraft
carriers when we need bicycles.

273
00:15:23,214 --> 00:15:25,334
That doesn't mean that the
aircraft carrier isn't useful.

274
00:15:25,504 --> 00:15:31,004
It's very useful if you need to project
force in the South Pacific as the U.

275
00:15:31,004 --> 00:15:31,154
S.

276
00:15:31,174 --> 00:15:34,644
Navy, but it's not terribly helpful
if you want to go get groceries.

277
00:15:35,599 --> 00:15:35,879
Right?

278
00:15:35,949 --> 00:15:37,169
It's the wrong tool for the job.

279
00:15:37,179 --> 00:15:40,009
And we're just trying to do
everything with one set of tools.

280
00:15:40,627 --> 00:15:44,167
So you've mentioned that it basically
should work fully  on our device

281
00:15:44,177 --> 00:15:48,397
without the server and the server
augments that software by giving

282
00:15:48,397 --> 00:15:52,587
it additional capabilities, such as
collaboration, maybe it also helps

283
00:15:52,597 --> 00:15:54,927
with automatic backup, et cetera.

284
00:15:55,277 --> 00:15:56,477
So, that.

285
00:15:56,927 --> 00:15:57,867
is very clear.

286
00:15:57,887 --> 00:16:01,877
However, it would not be super clear
yet how I would go from typically

287
00:16:01,877 --> 00:16:06,727
building a three tier web app to
building things in that model.

288
00:16:06,797 --> 00:16:11,607
My intuition would be maybe
adding tons of caching, et cetera.

289
00:16:11,947 --> 00:16:13,987
Would I still  have that server database?

290
00:16:14,007 --> 00:16:17,567
So what is the typical way
how I built local first apps?

291
00:16:17,982 --> 00:16:19,722
Yeah, you kind of have  two main problems.

292
00:16:19,722 --> 00:16:21,602
There's the program and the data, right?

293
00:16:21,602 --> 00:16:22,732
We'll just kind of boil it down.

294
00:16:23,132 --> 00:16:26,182
The program in some sense is
the easy problem to solve.

295
00:16:26,182 --> 00:16:31,227
So, you know, if you're on the web, what
you want is a PWA, progressive web app.

296
00:16:31,857 --> 00:16:34,257
You're going to use a service
worker to cache the code.

297
00:16:34,557 --> 00:16:37,477
You're going to try and run everything
in the browser, and you're going to

298
00:16:37,837 --> 00:16:39,667
keep it stored so it works offline.

299
00:16:40,187 --> 00:16:43,467
If you're on mobile, in many
cases you already build this way,

300
00:16:44,297 --> 00:16:44,667
Yeah.

301
00:16:45,097 --> 00:16:49,187
Like, everything that Apple
publishes first party, more or less.

302
00:16:49,852 --> 00:16:51,612
Is already local first, right?

303
00:16:51,612 --> 00:16:52,612
Like Apple notes.

304
00:16:52,622 --> 00:16:56,582
It's not like you ever pull out your
phone in the elevator to, like, make a

305
00:16:56,582 --> 00:16:58,222
note from a conversation you just had.

306
00:16:58,222 --> 00:16:59,572
And all you see is a little spinner.

307
00:16:59,602 --> 00:17:00,702
No, that's ridiculous, right?

308
00:17:01,092 --> 00:17:01,962
Like Apple knows,

309
00:17:02,554 --> 00:17:06,384
I think Apple notes is a great example
of  what an app should feel like, whereas

310
00:17:06,424 --> 00:17:10,654
I do a lot of times see that spinner on
the hallway where I don't have perfect

311
00:17:10,664 --> 00:17:12,634
internet connectivity in other apps.

312
00:17:13,369 --> 00:17:13,599
right?

313
00:17:13,659 --> 00:17:15,979
Because you're at somebody's office and
you know, want to make some notes about a

314
00:17:15,979 --> 00:17:18,179
conversation not on the WiFi or something.

315
00:17:18,179 --> 00:17:19,439
And you're like, Oh, God, I gotta

316
00:17:19,927 --> 00:17:21,077
wiFi password?

317
00:17:21,097 --> 00:17:22,697
Yeah, no, that's ridiculous.

318
00:17:22,757 --> 00:17:23,817
I'm just trying to take a note here.

319
00:17:24,157 --> 00:17:26,737
Okay, so, so you need to get
the program on the device.

320
00:17:26,757 --> 00:17:27,427
That's one.

321
00:17:27,547 --> 00:17:29,357
And then you need to get
the data on the device.

322
00:17:29,377 --> 00:17:29,987
That's too.

323
00:17:30,257 --> 00:17:31,697
So how do you get the data on the device?

324
00:17:32,427 --> 00:17:36,717
Well, in some very limited cases, you
just put the data into the program, right?

325
00:17:36,717 --> 00:17:40,477
So like, I don't know, maybe
it's a reference for a board

326
00:17:40,477 --> 00:17:41,647
game or something like that.

327
00:17:41,647 --> 00:17:44,917
You can just download the
data and leave it in the app.

328
00:17:45,207 --> 00:17:47,087
But of course, that's not
like the interesting case.

329
00:17:47,107 --> 00:17:51,637
A lot of apps, most apps, I think, you
know, you have user generated content.

330
00:17:51,647 --> 00:17:52,687
That's why you're there, right?

331
00:17:52,687 --> 00:17:55,407
It's a map, it's a note, it's
whatever you're there to do.

332
00:17:55,947 --> 00:17:57,897
And so in that case, what you need.

333
00:17:58,227 --> 00:18:02,467
Is some way to get data from the cloud
to the device and then back to the cloud.

334
00:18:02,777 --> 00:18:06,597
And the tricky part is you need to deal
with the fact that people can go offline.

335
00:18:07,636 --> 00:18:12,556
And so that data is basically some
data I might've previously created.

336
00:18:12,756 --> 00:18:16,326
For example, if it's the Apple
notes app, then maybe some notes

337
00:18:16,346 --> 00:18:18,336
I've created on my Macbook.

338
00:18:18,696 --> 00:18:23,026
I think we don't need to talk too much
about like how do you deliver the program.

339
00:18:23,106 --> 00:18:26,106
But the data aspect that
seems really tricky.

340
00:18:26,436 --> 00:18:29,176
So what are the problems that you've seen?

341
00:18:29,176 --> 00:18:33,746
And what are the current best practices or
different way how we can architect things?

342
00:18:34,366 --> 00:18:34,546
Yeah.

343
00:18:34,546 --> 00:18:37,206
And again, I like anchoring
this in , how did we get here?

344
00:18:37,206 --> 00:18:38,926
We've been downloading
data for a long time.

345
00:18:38,926 --> 00:18:40,876
You can get a CSV file off the Internet.

346
00:18:40,886 --> 00:18:43,596
You can email somebody
in Excel file, right?

347
00:18:43,596 --> 00:18:45,486
We kind of get that,
like, then you have it.

348
00:18:45,801 --> 00:18:48,141
You know, I can email you an
Excel file and then you can

349
00:18:48,141 --> 00:18:50,411
open it like no big deal, right?

350
00:18:50,451 --> 00:18:51,291
That seems easy.

351
00:18:51,801 --> 00:18:57,171
Similarly, like with my with my
story about the music app, you know,

352
00:18:57,171 --> 00:19:00,591
I could download those playlists
and just cash them on the device.

353
00:19:01,136 --> 00:19:03,016
And so that's like a kind
of a modest thing you were

354
00:19:03,016 --> 00:19:04,696
saying, just cache everything.

355
00:19:04,696 --> 00:19:05,056
Cool.

356
00:19:05,526 --> 00:19:05,806
Okay.

357
00:19:05,806 --> 00:19:09,406
As long as all you're doing
is reading, no big deal.

358
00:19:09,406 --> 00:19:09,926
That's fine.

359
00:19:10,426 --> 00:19:10,646
Right?

360
00:19:10,666 --> 00:19:11,426
That just works.

361
00:19:11,476 --> 00:19:11,686
Cool.

362
00:19:11,686 --> 00:19:12,526
We'll cache everything.

363
00:19:12,816 --> 00:19:16,756
The problem is that we also still want
to be able to work when we're offline.

364
00:19:17,746 --> 00:19:17,966
Right?

365
00:19:18,186 --> 00:19:23,806
one our tenants is you should never, ever
be stopped from doing what you want to do.

366
00:19:24,526 --> 00:19:27,866
By the availability or lack of
availability of another computer.

367
00:19:28,326 --> 00:19:31,766
And I would say this is maybe also
where you can draw a line between.

368
00:19:32,121 --> 00:19:36,471
Current, not yet local-first software
that's not entirely useless in an

369
00:19:36,471 --> 00:19:40,741
offline scenario if it caches things
a lot, so at least I can read it.

370
00:19:41,161 --> 00:19:45,021
But to go from there to that,
it allows you to still do

371
00:19:45,021 --> 00:19:46,731
the job completely offline.

372
00:19:47,001 --> 00:19:52,111
I think this is sort of like a barrier
that is incredibly hard to overcome with

373
00:19:52,111 --> 00:19:54,851
like your more like typical three tier app

374
00:19:55,066 --> 00:19:55,816
optimistic,

375
00:19:56,373 --> 00:19:57,203
of caching.

376
00:19:57,321 --> 00:19:58,281
yeah, exactly.

377
00:19:58,311 --> 00:20:02,371
And it's not only that, but, like, it's
just complicated to think about, right?

378
00:20:02,371 --> 00:20:04,581
Like, there's a lot of subtle problems.

379
00:20:04,621 --> 00:20:07,861
Oh, if you know, you click the
OK and then it goes green right

380
00:20:07,861 --> 00:20:10,361
away, but really you're running
the fetch in the back end and

381
00:20:11,256 --> 00:20:11,546
have an

382
00:20:11,946 --> 00:20:13,796
post request failed.

383
00:20:13,966 --> 00:20:16,016
now we've already told
the user that it works.

384
00:20:16,036 --> 00:20:19,306
Okay, now we need to
like raise an exception.

385
00:20:19,426 --> 00:20:21,696
Let's make sure that we
check if we're online first.

386
00:20:21,696 --> 00:20:23,726
Oh, but the browser
thought we were online.

387
00:20:23,726 --> 00:20:26,196
But now it's just, it's a
nightmare as let's not do

388
00:20:26,396 --> 00:20:31,526
I've seen many times that basically like
shows you indicates, Oh, this was great.

389
00:20:31,836 --> 00:20:35,926
And then you see like a little spinner,
a pop up, something has gone wrong.

390
00:20:36,306 --> 00:20:37,056
Please reload the

391
00:20:37,286 --> 00:20:38,656
Refresh the browser.

392
00:20:38,846 --> 00:20:39,676
You've lost all your work.

393
00:20:39,686 --> 00:20:44,376
One of my all time least favorite
messages is on Google Docs.

394
00:20:44,376 --> 00:20:47,226
Sometimes if you work on a document,
like while you're on a flight,

395
00:20:47,256 --> 00:20:51,256
even though you've downloaded it,
remember to add the extension, cached

396
00:20:51,256 --> 00:20:54,796
it before you got on the plane so
that it would be available offline.

397
00:20:55,106 --> 00:20:57,816
And then you edit the document on
the flight and then you land and

398
00:20:57,916 --> 00:21:01,486
you come online and it says, we're
sorry, this document has changed

399
00:21:01,496 --> 00:21:02,936
too much while you were offline.

400
00:21:04,606 --> 00:21:10,076
We're now resetting you to the cloud
state and then all your data is gone.

401
00:21:10,746 --> 00:21:13,446
That's only happened to me once
or twice, but man, that hurt.

402
00:21:14,743 --> 00:21:19,553
What we do is we can, you know, if
it's just you working again, there's

403
00:21:19,553 --> 00:21:20,943
not really any problem here, right?

404
00:21:20,943 --> 00:21:22,823
Like I can edit the data.

405
00:21:22,843 --> 00:21:24,913
And then just when I come
online, we upload it.

406
00:21:24,913 --> 00:21:27,683
The real challenge is if you have
two different things, editing

407
00:21:27,683 --> 00:21:30,933
the data, and then you need
to merge their changes, right?

408
00:21:30,933 --> 00:21:34,013
So like I added a track to the playlist.

409
00:21:34,468 --> 00:21:37,568
And, you know, Spotify added
a track to the playlist.

410
00:21:38,478 --> 00:21:40,148
Okay now we have a conflict.

411
00:21:40,198 --> 00:21:42,238
Conflict is the technical
term we're going to use here.

412
00:21:42,948 --> 00:21:43,988
And so that's the hard thing.

413
00:21:43,998 --> 00:21:46,608
And lots of different systems
have approached this in different

414
00:21:46,608 --> 00:21:47,658
ways over the years, right?

415
00:21:47,658 --> 00:21:51,858
Like, Git gives you the ability
to merge conflicts as long as you

416
00:21:51,858 --> 00:21:57,188
don't have edits to the same file
or the same line in the file, right?

417
00:21:57,238 --> 00:22:01,448
CouchDB and PouchDB, you know, they
use what's called last writer wins.

418
00:22:01,448 --> 00:22:02,608
And so it's whichever.

419
00:22:03,153 --> 00:22:06,443
The, you know, all the systems agree
that whichever the last one was will

420
00:22:06,443 --> 00:22:08,903
overwrite now, which one was last.

421
00:22:09,293 --> 00:22:11,513
Okay, now we start to get into,
like, interesting distributed

422
00:22:11,513 --> 00:22:14,473
systems questions because you can't
trust the clocks on the computers.

423
00:22:15,473 --> 00:22:17,513
So, is it the last 1 to the server?

424
00:22:18,043 --> 00:22:20,003
Does there have to be a
central server that decides?

425
00:22:20,003 --> 00:22:22,153
Can we get rid of that
central server, Johannes?

426
00:22:22,603 --> 00:22:23,133
Can we?

427
00:22:23,265 --> 00:22:23,985
spoiler!

428
00:22:24,055 --> 00:22:24,925
Yes, we can!

429
00:22:25,985 --> 00:22:26,495
Sort of.

430
00:22:26,505 --> 00:22:26,895
Sort of.

431
00:22:26,895 --> 00:22:28,075
We'll come back to that later.

432
00:22:28,475 --> 00:22:29,145
That makes sense.

433
00:22:29,145 --> 00:22:34,575
If the software runs on our devices
and if the data is also in our devices,

434
00:22:34,605 --> 00:22:40,375
now the server is kind of demoted in
a way  no longer necessarily has to

435
00:22:40,375 --> 00:22:42,705
play that absolutely central role.

436
00:22:43,110 --> 00:22:46,760
If something goes wrong, the client
can just forget everything and get

437
00:22:46,770 --> 00:22:48,340
everything again from the server.

438
00:22:48,520 --> 00:22:52,910
But that's exactly the step where we
want to go beyond to  have the work that

439
00:22:52,920 --> 00:22:57,980
we do and the clients to actually trust
that and then collaborate with others.

440
00:22:58,500 --> 00:22:58,870
that's right.

441
00:22:58,880 --> 00:23:01,660
And I think the beauty of this model,
and we talked earlier about wanting

442
00:23:01,660 --> 00:23:03,540
to make software simpler, right?

443
00:23:03,550 --> 00:23:07,810
A lot of the complexity of the model
that we have today comes from having all

444
00:23:07,810 --> 00:23:12,355
these different systems and programming
languages and Like different computers

445
00:23:12,355 --> 00:23:15,195
involved in literally every task, right?

446
00:23:15,215 --> 00:23:20,205
Like if I tick a box in a standard
web app, I've got my computer, which

447
00:23:20,205 --> 00:23:23,585
then sends a request to the API
server, which then does a right to

448
00:23:23,585 --> 00:23:26,435
the database, which then needs to
propagate that back to my computer.

449
00:23:26,435 --> 00:23:29,275
So like, like best case theoretical.

450
00:23:29,690 --> 00:23:31,280
We've got three systems involved.

451
00:23:31,590 --> 00:23:36,160
Practically, though, there's also like
API gateways and like, you know, request

452
00:23:36,160 --> 00:23:40,780
routers and like all this other stuff
is happening along the way, PG proxy

453
00:23:40,890 --> 00:23:45,300
bouncer connection bouncers and all
this like extra hidden complexity on top

454
00:23:45,300 --> 00:23:47,610
of the sort of notional three servers.

455
00:23:48,240 --> 00:23:51,070
Whereas if you can move that so
that you know, yeah, you tick

456
00:23:51,070 --> 00:23:52,300
the box and it writes it locally.

457
00:23:54,145 --> 00:23:54,505
That's it.

458
00:23:54,505 --> 00:23:56,125
You're done right now.

459
00:23:56,125 --> 00:23:58,805
The problem is, well, how do I let
other people know that I took the box?

460
00:23:59,105 --> 00:24:00,715
And so what we're trying to do is set up.

461
00:24:00,725 --> 00:24:02,335
We call this synchronization, right?

462
00:24:02,335 --> 00:24:05,645
So we want to synchronize the state
that you have in your local device

463
00:24:06,205 --> 00:24:09,115
to other computers, whether that
servers in the cloud or other people

464
00:24:09,115 --> 00:24:10,165
who you're collaborating with.

465
00:24:10,905 --> 00:24:14,155
And so what we're doing is we're kind of
changing the relationship where instead

466
00:24:14,155 --> 00:24:16,715
of the server mediating what's happening.

467
00:24:18,285 --> 00:24:18,545
Right.

468
00:24:18,545 --> 00:24:21,585
The client decides what it's doing,
and then it lets the server know,

469
00:24:21,585 --> 00:24:22,785
like, Hey, I made this change.

470
00:24:22,815 --> 00:24:24,785
And, you know, we can
do that incrementally.

471
00:24:25,025 --> 00:24:28,355
And in fact, what we can do is record
all the edits that are happening on your

472
00:24:28,355 --> 00:24:32,415
local machine and then just basically
send a log of that to the server.

473
00:24:32,925 --> 00:24:36,145
And then similarly, the server
can send you a log of any other

474
00:24:36,145 --> 00:24:37,835
edits that other people have made.

475
00:24:38,215 --> 00:24:40,315
And now you have, in some sense,
a much simpler problem, which is

476
00:24:40,315 --> 00:24:43,525
just like, okay, well, I've got all
these different sort of changes.

477
00:24:43,525 --> 00:24:44,785
We have a change log, basically.

478
00:24:44,785 --> 00:24:48,065
And all we have to do is figure out how
to put that together so that it works.

479
00:24:48,535 --> 00:24:51,045
So I think there's a lot to unpack there.

480
00:24:51,095 --> 00:24:55,055
So I'd like to understand
how can you actually do that?

481
00:24:55,055 --> 00:25:00,435
But before going into that I'm also
wondering whether this works well for

482
00:25:00,525 --> 00:25:04,035
some kind of applications, but not
maybe for some other applications.

483
00:25:04,035 --> 00:25:08,285
So I can very well imagine how
this works for like Apple notes.

484
00:25:08,805 --> 00:25:11,685
I could imagine how this works for like a.

485
00:25:11,940 --> 00:25:17,130
More complex note taking system, maybe
all the way to the scale of Notion.

486
00:25:17,520 --> 00:25:20,960
What I'm wondering though, whether
there's like some cutoff point where

487
00:25:20,990 --> 00:25:23,160
this is no longer a good approach.

488
00:25:23,440 --> 00:25:28,230
So if I imagine building something
like Facebook is that still a good fit?

489
00:25:28,550 --> 00:25:29,930
For local-first software.

490
00:25:29,950 --> 00:25:34,590
Is there kind of like a line in the sand
where you say, maybe theoretically still

491
00:25:34,590 --> 00:25:36,890
possible, but absolutely not a good idea.

492
00:25:37,350 --> 00:25:40,690
What is good fit for local-first
software and what isn't?

493
00:25:41,410 --> 00:25:41,600
Yeah.

494
00:25:41,600 --> 00:25:45,210
So the strength of local-first
software is when users should have

495
00:25:45,210 --> 00:25:47,400
control over their data, right?

496
00:25:48,465 --> 00:25:51,895
And when the devices at the edge need
to be able to operate independently,

497
00:25:51,895 --> 00:25:53,405
local first offers a great fit.

498
00:25:54,035 --> 00:25:58,209
Probably not a great fit for
an ATM, aTM just deciding when

499
00:25:58,209 --> 00:25:59,769
it's offline to spit out money.

500
00:26:00,024 --> 00:26:02,714
You know, without any way to let
other nodes know what it's doing.

501
00:26:03,137 --> 00:26:07,207
When the users have a lot of agency and
authorship over the data, local-first

502
00:26:07,227 --> 00:26:08,377
software makes a ton of sense.

503
00:26:08,577 --> 00:26:11,947
If you're trying to manage an external
resource, like cash in a bank account

504
00:26:12,037 --> 00:26:16,467
or a meeting room booking or something
like that, then it makes less sense.

505
00:26:16,897 --> 00:26:20,957
I think social media is an
interesting  middle ground.

506
00:26:20,967 --> 00:26:22,567
I think there's a lot of benefits.

507
00:26:23,297 --> 00:26:27,647
to giving users control over their
data and an agency over their data.

508
00:26:27,677 --> 00:26:30,017
But there's interesting
scale and indexing problems.

509
00:26:30,397 --> 00:26:33,697
So I can imagine, in fact,
there are social networks

510
00:26:33,697 --> 00:26:35,337
that are totally local first.

511
00:26:35,347 --> 00:26:37,227
A great example of one
is called scuttlebutt

512
00:26:37,597 --> 00:26:39,257
and that's a local first social network.

513
00:26:39,697 --> 00:26:42,497
But you know, it comes with a
bunch of architecture trade offs.

514
00:26:42,517 --> 00:26:44,307
It's designed for offline use.

515
00:26:44,307 --> 00:26:46,347
And so that means when you
join scuttlebutt, or at least

516
00:26:46,802 --> 00:26:50,312
When I joined Scuttlebutt, you
had to download like 10 gigs

517
00:26:50,732 --> 00:26:51,332
Wow

518
00:26:51,477 --> 00:26:55,877
sailboats and like, you know, social
media posts that you will never

519
00:26:55,877 --> 00:26:59,007
read just to be able to get sort
of bootstrapped into the system.

520
00:27:00,257 --> 00:27:03,577
don't think that's a necessary
consequence of local for software.

521
00:27:03,907 --> 00:27:07,167
design that they chose to prioritize,
which is like you should be able

522
00:27:07,167 --> 00:27:08,447
to have the whole enchilada.

523
00:27:09,487 --> 00:27:13,497
But yeah, I think again, right,
like, I guess another useful thing

524
00:27:13,497 --> 00:27:17,847
to consider is like how often will
users engage with the same data?

525
00:27:19,327 --> 00:27:24,137
So, like, Wikipedia, probably not a
great local first app in some sense.

526
00:27:24,892 --> 00:27:27,512
Though I'm told Patrick Collison
built an offline Wikipedia

527
00:27:27,512 --> 00:27:28,772
as one of his first ventures.

528
00:27:29,432 --> 00:27:31,102
so, you know, I guess
there's a use for it.

529
00:27:31,572 --> 00:27:35,272
But, you know, if you only go to an
article once and then you read it and

530
00:27:35,272 --> 00:27:38,852
then you never need it again, and that's
like a random access pattern and we

531
00:27:38,852 --> 00:27:41,112
can't know what you're going to want
to read, then it's probably not a great

532
00:27:41,112 --> 00:27:42,512
fit for local-first software, right?

533
00:27:42,512 --> 00:27:44,852
Like, you're not editing, you're
only reading, and you're not

534
00:27:44,892 --> 00:27:45,932
going back to the same data.

535
00:27:46,452 --> 00:27:51,082
On the other hand, like, a recipe book
kind of the inverse of that, which

536
00:27:51,082 --> 00:27:55,622
is like, kitchens often have a lot
of, like, metal and RF interference.

537
00:27:55,622 --> 00:27:57,832
Transcribed So even though you're
fetching data, you might want to

538
00:27:57,842 --> 00:28:01,082
have the recipe, you want to be able
back say, what did I make last year?

539
00:28:01,087 --> 00:28:04,287
might be your favorite recipe
and you might have a little note

540
00:28:04,327 --> 00:28:05,637
that you've scribbled on it.

541
00:28:06,162 --> 00:28:08,912
absolutely, scribbling in the
margins of your recipe books

542
00:28:08,912 --> 00:28:11,712
is a time honored tradition in,
like, every household, I think.

543
00:28:12,132 --> 00:28:16,022
And so, right, like, this is where
it comes back to that question,

544
00:28:16,022 --> 00:28:19,552
which is, like, is a user taking data
for themself and then they can have

545
00:28:19,562 --> 00:28:21,012
authorship over it going forward?

546
00:28:21,482 --> 00:28:22,442
It's probably a good fit.

547
00:28:22,894 --> 00:28:26,954
the more kind of like trust, like
control and trust, I think are

548
00:28:27,004 --> 00:28:32,274
related here and  the less you can
trust all the participants in your

549
00:28:32,274 --> 00:28:36,664
system, the harder it probably will
be to build in this local first way.

550
00:28:37,099 --> 00:28:41,199
Since you need to mediate  what
is typically referred to as  auth

551
00:28:41,589 --> 00:28:44,259
and your typical three tier app.

552
00:28:44,649 --> 00:28:48,329
This needs to be thought of
probably quite differently when

553
00:28:48,329 --> 00:28:49,849
you build local first apps.

554
00:28:50,444 --> 00:28:54,004
I think this is a bigger
conversation for another day.

555
00:28:54,639 --> 00:29:02,139
I believe that local-first
software will provide a much higher

556
00:29:02,689 --> 00:29:09,169
standard of privacy, security and
authentication than a cloud service can,

557
00:29:10,359 --> 00:29:15,419
I think there's a whole bunch of new
best practices that we need to figure out

558
00:29:15,479 --> 00:29:17,521
that might not be fully discovered yet.

559
00:29:17,541 --> 00:29:20,851
yeah, it's definitely an open
area of work that I'm not here to

560
00:29:20,851 --> 00:29:22,041
tell you that problem is solved.

561
00:29:22,041 --> 00:29:25,081
I'm here to tell you that, like,
the potential, I think, is huge

562
00:29:25,081 --> 00:29:28,321
for this, but the reality is
we're a long way from having,

563
00:29:28,386 --> 00:29:29,346
And that's perfect.

564
00:29:29,436 --> 00:29:33,636
that's what I want to help with this
podcast  give an outlet to discuss

565
00:29:33,666 --> 00:29:37,906
those sort of particular areas,
such as  what does authentication

566
00:29:38,096 --> 00:29:40,006
look like in a local first way?

567
00:29:40,046 --> 00:29:42,766
And I think something that
makes the local first world

568
00:29:42,776 --> 00:29:44,366
already so rich  are those like.

569
00:29:44,736 --> 00:29:49,336
Early products that are being built in
this way where we can share and learn from

570
00:29:49,336 --> 00:29:52,036
their experiences and their experiments.

571
00:29:52,086 --> 00:29:56,376
So I'm really looking forward to
deep dives on those various topics.

572
00:29:57,316 --> 00:29:58,506
tons of people doing great work.

573
00:29:58,516 --> 00:30:01,363
Of course, blue skies out there
doing it in more of what you'd call a

574
00:30:01,363 --> 00:30:03,796
federated way, but they're definitely
thinking about these problems.

575
00:30:03,796 --> 00:30:05,276
And there's lots of
people building products.

576
00:30:05,276 --> 00:30:07,156
I can't wait to talk to
them about this stuff.

577
00:30:07,526 --> 00:30:10,266
So going a step back again.

578
00:30:10,296 --> 00:30:15,736
When you say synchronization, I'm
thinking the Dropbox icon back in the

579
00:30:15,736 --> 00:30:18,056
days when I was using Dropbox a lot.

580
00:30:18,086 --> 00:30:19,886
So that does synchronization.

581
00:30:19,896 --> 00:30:23,006
I think a lot of people are
still familiar with that.

582
00:30:23,356 --> 00:30:26,646
Is that kind of like the mental
model, how I think about it?

583
00:30:26,756 --> 00:30:29,001
Git also has a notion of.

584
00:30:29,151 --> 00:30:35,141
Synchronizing, if a bit more explicit
with push and pull how would I do that

585
00:30:35,151 --> 00:30:40,741
for my data where I think about my
data, maybe more in terms of SQL tables.

586
00:30:41,111 --> 00:30:47,376
So how do I translate that very
intuitive model of syncing to the

587
00:30:47,576 --> 00:30:49,586
more harsh realities of my app,

588
00:30:50,024 --> 00:30:55,394
This is a great flashlight to shine on
like how the world has changed, right?

589
00:30:55,394 --> 00:30:59,804
So if you go and look at
Dropbox, what does Dropbox sync?

590
00:31:00,094 --> 00:31:01,924
It syncs files.

591
00:31:02,814 --> 00:31:04,734
What is a git repo on your machine?

592
00:31:05,364 --> 00:31:08,014
A git repo is a bunch of files.

593
00:31:08,384 --> 00:31:14,194
And then git and Dropbox both do something
special behind the scenes to get those

594
00:31:14,194 --> 00:31:16,174
files other places or from other places.

595
00:31:16,174 --> 00:31:16,409
Okay.

596
00:31:16,809 --> 00:31:17,999
What is a Google Doc?

597
00:31:18,794 --> 00:31:22,044
You have a Google Doc on your
computer, you don't actually have it.

598
00:31:22,434 --> 00:31:24,394
You're just looking at it, right?

599
00:31:24,414 --> 00:31:27,224
And that's why Google can throw away
all your data because there have

600
00:31:27,224 --> 00:31:29,184
been too many edits by other people.

601
00:31:29,514 --> 00:31:32,094
Nevermind spending three
hours on a flight, rewriting

602
00:31:32,094 --> 00:31:33,734
the stupid blog post, right?

603
00:31:33,734 --> 00:31:36,014
Cause it's, you didn't,
I didn't have the doc.

604
00:31:36,054 --> 00:31:37,044
I had a cache.

605
00:31:37,064 --> 00:31:37,934
I had a copy.

606
00:31:37,934 --> 00:31:38,804
I had a view.

607
00:31:39,224 --> 00:31:44,219
And because somebody else had edited
it, the actual doc, the place had

608
00:31:44,219 --> 00:31:47,089
changed and mine was now trash.

609
00:31:47,139 --> 00:31:49,239
. Google Docs are places.

610
00:31:49,719 --> 00:31:53,119
And I think this is like a really
interesting kind of duality, right?

611
00:31:53,119 --> 00:31:56,004
Because we want both
Properties for our documents.

612
00:31:56,174 --> 00:31:58,914
I want to be able to send a
link to someone so that they

613
00:31:58,914 --> 00:32:00,234
can edit a document with me.

614
00:32:00,524 --> 00:32:00,744
Right?

615
00:32:00,744 --> 00:32:01,814
That feels like a place.

616
00:32:02,174 --> 00:32:05,704
But I also want to be able to save
a copy and  email it around or

617
00:32:05,714 --> 00:32:08,244
have it on my computer and look
at it and know that it's mine.

618
00:32:08,644 --> 00:32:08,894
Right?

619
00:32:08,894 --> 00:32:13,314
So we want properties of both
this kind of like object like

620
00:32:13,324 --> 00:32:15,054
experience that we get from files.

621
00:32:15,339 --> 00:32:17,769
And the place like experience
we get from cloud documents.

622
00:32:18,009 --> 00:32:20,509
And I think that's where we get
into like a real fundamental

623
00:32:20,669 --> 00:32:21,719
tension between the two.

624
00:32:22,760 --> 00:32:27,730
Do you feel any sort of software that
we use on a daily basis is getting

625
00:32:27,790 --> 00:32:32,520
the closest to what you think could
be a good resolution of the tension?

626
00:32:33,909 --> 00:32:39,919
I think there are lots of companies
that have made incremental progress.

627
00:32:40,249 --> 00:32:42,689
Just to kind of, you know,
speak to some exemplars.

628
00:32:42,729 --> 00:32:48,759
I mean, obviously, I think the basic idea
behind an app generally, I think it's

629
00:32:48,759 --> 00:32:52,439
kind of problematic, which is it's taking
your data and putting it into their app.

630
00:32:52,439 --> 00:32:54,769
So you can't access somewhere,
access it anywhere else.

631
00:32:55,069 --> 00:32:56,769
Great example, again, is Apple Notes.

632
00:32:58,099 --> 00:33:04,469
Plain text notes, more or less, but you
can't open them in VS code or notepad or

633
00:33:04,469 --> 00:33:06,259
anything else or Dropbox notes, right?

634
00:33:06,259 --> 00:33:12,199
Like, we've managed to turn text notes
into closed proprietary formats that are

635
00:33:12,199 --> 00:33:13,899
specific to a single piece of software.

636
00:33:14,179 --> 00:33:15,119
That's sort of a bummer.

637
00:33:15,129 --> 00:33:17,029
You can't sync your
Apple Notes with Dropbox.

638
00:33:18,069 --> 00:33:21,729
But okay, I still think though
that, like, within this world

639
00:33:21,789 --> 00:33:26,099
of files versus You know, things
versus places, files versus links.

640
00:33:26,799 --> 00:33:28,469
Apple notes is like a
nice middle ground, right?

641
00:33:28,469 --> 00:33:31,149
Like you can make a note, it always
works offline, but you can share

642
00:33:31,149 --> 00:33:33,579
them with other people and see the
edits and get updates from people.

643
00:33:33,919 --> 00:33:34,799
So that's really cool.

644
00:33:35,249 --> 00:33:38,029
I think Figma is doing really
interesting things with like,

645
00:33:38,439 --> 00:33:41,279
branches and decentralized workflows.

646
00:33:41,739 --> 00:33:46,019
If you ever talk to people who work in
a large org that uses Figma, You know,

647
00:33:46,019 --> 00:33:50,689
there's this problem, which is that
like when you're working on a design in

648
00:33:50,689 --> 00:33:55,319
the early stages, you don't want other
people to look at your work, right?

649
00:33:55,319 --> 00:33:58,569
You're they don't want someone hopping
in and going, I don't like that color.

650
00:33:58,599 --> 00:34:00,259
It's like, yeah, I'm not done.

651
00:34:01,059 --> 00:34:02,289
back later, right?

652
00:34:02,629 --> 00:34:04,739
You want that creative
privacy where you can explore.

653
00:34:04,739 --> 00:34:08,219
And so people have found all these
creative ways to build that in Figma.

654
00:34:08,219 --> 00:34:11,009
And I think there's somewhat
cognizant of that organizationally.

655
00:34:11,449 --> 00:34:13,639
So I think that's like
a good example of yeah.

656
00:34:14,129 --> 00:34:18,049
Like trying to plumb some of those
depths, I think, though, for the most

657
00:34:18,059 --> 00:34:21,109
part, I mean, you know, we could give
a bit of credit to Google Docs, right?

658
00:34:21,129 --> 00:34:25,379
Like, yes, it requires a browser
extension and like literally half the

659
00:34:25,389 --> 00:34:27,679
time that you at least I get on a flight.

660
00:34:27,699 --> 00:34:31,119
I realized that although I had the browser
extension plug installed, it was in

661
00:34:31,119 --> 00:34:34,869
the wrong profile, or I didn't remember
to cash the document or whatever, but

662
00:34:34,869 --> 00:34:39,229
you can at least get some semblance of
that offline support from Google Docs.

663
00:34:40,069 --> 00:34:43,729
And of course, you know, Git is an
exemplar as well in terms of, like,

664
00:34:43,739 --> 00:34:46,509
Git plus GitHub gives you something.

665
00:34:46,769 --> 00:34:47,569
It's clunky.

666
00:34:47,619 --> 00:34:51,309
I'm not here to tell you Git's a great
user experience, but, you know, Git

667
00:34:51,349 --> 00:34:54,469
gives you this ability to work kind
of in both worlds where you can share

668
00:34:54,469 --> 00:34:58,339
links to files through GitHub, but you
can have a full copy of the repository

669
00:34:58,339 --> 00:34:59,419
with its history on your machine.

670
00:35:00,634 --> 00:35:01,024
Right.

671
00:35:01,114 --> 00:35:01,494
Yes.

672
00:35:01,534 --> 00:35:06,324
I think there's  a lot to be explored
from a user experience perspective,

673
00:35:06,344 --> 00:35:10,674
like patterns that fit the domain
of the software patterns that

674
00:35:10,694 --> 00:35:13,184
users intuitively can work with.

675
00:35:13,714 --> 00:35:17,614
But I think in terms of how we actually
building that there's probably still

676
00:35:17,644 --> 00:35:22,994
a long way to go and think it's
super, super fortunate that there are

677
00:35:23,074 --> 00:35:25,724
companies already pushing forward.

678
00:35:25,914 --> 00:35:31,604
there whether it being Figma or Google
with Google Docs or  even Notion who I

679
00:35:31,634 --> 00:35:36,394
think is like not super sophisticated
in terms of syncing is yet a good

680
00:35:36,394 --> 00:35:41,024
example of like how far you can get
while building collaborative software

681
00:35:41,044 --> 00:35:45,924
that is not super fine granular in
terms of  its syncing resolution.

682
00:35:46,629 --> 00:35:51,639
So I think syncing will be a continuous
topic both in terms of user experience.

683
00:35:51,639 --> 00:35:55,939
And then when you actually get to the
implementation, when you're saying

684
00:35:55,959 --> 00:36:03,759
syncing I've already seen the term CRDT
quite a bit associated with local first.

685
00:36:04,104 --> 00:36:07,404
Can you briefly touch on what CRDTs are?

686
00:36:07,404 --> 00:36:10,324
We probably don't have enough
time to fully go into it.

687
00:36:10,834 --> 00:36:11,554
Maybe you can,

688
00:36:11,964 --> 00:36:13,844
let's give a very high level primer.

689
00:36:13,844 --> 00:36:16,214
I think this is a topic that
needs a deeper dive, but

690
00:36:16,214 --> 00:36:17,574
we'll give the quick intro.

691
00:36:18,024 --> 00:36:22,914
So the idea behind the CRDT is
that it stands for a conflict

692
00:36:22,914 --> 00:36:26,134
free replicated data type.

693
00:36:28,254 --> 00:36:29,394
data type is pretty easy.

694
00:36:30,074 --> 00:36:31,524
There are lots of different CRDTs.

695
00:36:31,534 --> 00:36:34,644
You can have a set, you can have
an array, you can have a counter.

696
00:36:35,404 --> 00:36:38,014
We work on one that's
basically like a JSON file.

697
00:36:38,034 --> 00:36:38,304
Right?

698
00:36:38,304 --> 00:36:41,034
So it has sets and arrays and
counters and maps and things

699
00:36:41,064 --> 00:36:45,854
and when you say data type, this is now
a thing that I'm using to build my app.

700
00:36:45,854 --> 00:36:50,314
So in the same way, if I build a
JavaScript app and I would use a map

701
00:36:50,334 --> 00:36:56,794
or set an array, now I would use one of
those CRDTs as foundation for my data.

702
00:36:57,079 --> 00:36:58,239
Why are you doing that?

703
00:36:58,269 --> 00:37:00,029
Well, because it's replicated.

704
00:37:00,089 --> 00:37:01,149
What does means?

705
00:37:01,149 --> 00:37:03,679
It means you can take that data
type and you can send it to a

706
00:37:03,679 --> 00:37:04,759
bunch of different computers.

707
00:37:05,329 --> 00:37:06,139
All right, cool.

708
00:37:06,194 --> 00:37:08,844
typical JavaScript map can't do that.

709
00:37:09,529 --> 00:37:12,739
Yeah, I mean, you can call toJSON
and then post it somewhere.

710
00:37:12,989 --> 00:37:17,049
And that leads us to the last part of
the description, which is conflict free.

711
00:37:17,349 --> 00:37:19,559
And that's where the heavy work gets done.

712
00:37:20,449 --> 00:37:23,599
So replicating your data is
not that hard as long as you

713
00:37:23,599 --> 00:37:24,649
don't care what happens to it.

714
00:37:24,699 --> 00:37:27,789
You could just, I don't know, open
your window and start shouting,

715
00:37:27,799 --> 00:37:29,269
you know, byte codes at the window.

716
00:37:29,549 --> 00:37:32,069
Technically, you're replicating it,
I guess, if anybody's listening.

717
00:37:32,499 --> 00:37:35,939
But you know, the conflict free
part, that's where it gets tricky.

718
00:37:35,939 --> 00:37:41,749
How do you make sure that if two
people both edit the document, One,

719
00:37:41,759 --> 00:37:46,929
that you can merge the changes, but
two, that nothing's lost, right?

720
00:37:47,269 --> 00:37:51,239
Like, it's really easy to merge data if
you just say, well, I'm going to throw,

721
00:37:51,239 --> 00:37:53,629
always throw away your data and keep mine.

722
00:37:54,079 --> 00:37:56,339
But that's not a very
useful strategy, right?

723
00:37:56,729 --> 00:38:00,289
So the whole idea behind CRDTs
is lots of different approaches.

724
00:38:00,704 --> 00:38:02,914
Tons of different implementations.

725
00:38:02,994 --> 00:38:06,144
It's a very active area of research
and there's lots of great ideas

726
00:38:06,144 --> 00:38:07,844
still unfolding out there right now.

727
00:38:08,284 --> 00:38:12,004
And it's really simple conceptually
though, which is like, if two people

728
00:38:12,014 --> 00:38:16,024
edit a thing, you should be able to
merge their edits together and both

729
00:38:16,024 --> 00:38:20,884
get the same answer without having to
go to recourse to a central authority.

730
00:38:21,811 --> 00:38:26,081
That seems like a very interesting
area that I want to learn more about.

731
00:38:26,111 --> 00:38:30,341
When thinking about CRDTs, there are a few
technologies that come to mind, whether

732
00:38:30,341 --> 00:38:35,511
that's being Yjs by Kevin Jans, who's been
working on this already for many years,

733
00:38:35,801 --> 00:38:40,061
then you all been working on auto merge
. So I would love to learn a lot more

734
00:38:40,071 --> 00:38:45,081
about those, but right now we'll shelve
it away and say, okay, CRDTs is a great

735
00:38:45,081 --> 00:38:47,631
strategy if you need to implement syncing.

736
00:38:48,171 --> 00:38:48,461
Is that

737
00:38:48,536 --> 00:38:53,181
Yeah, it is, and I think there's a
couple of, I'm not a big believer

738
00:38:53,181 --> 00:38:56,511
in silver bullets or kind of like
magical thinking with technology.

739
00:38:56,761 --> 00:38:58,701
There's a set of tradeoffs here, right?

740
00:38:58,741 --> 00:39:01,911
Like, what happens when
you have a conflict in git?

741
00:39:01,911 --> 00:39:06,941
Well, you're busting open your text editor
and looking for a bunch of less than signs

742
00:39:06,941 --> 00:39:09,921
in a row and hoping you found them all
before you push the stupid commit again.

743
00:39:10,521 --> 00:39:15,031
You know, similarly, CRDTs don't
generally have that problem, but

744
00:39:15,031 --> 00:39:16,721
you can still have conflicts, right?

745
00:39:16,741 --> 00:39:21,851
Like if you and I both edit the title of
a document, You know, the CRDT isn't going

746
00:39:21,851 --> 00:39:23,721
to be able to know which one is right.

747
00:39:24,021 --> 00:39:28,521
So there's interesting, just like,
challenges here that go beyond,

748
00:39:28,721 --> 00:39:31,551
abstract computer science problems.

749
00:39:31,611 --> 00:39:33,131
This is a really fundamental problem.

750
00:39:33,341 --> 00:39:36,751
The computer can't know what
the title should be, right?

751
00:39:36,781 --> 00:39:40,841
And in the central cloud model, what
happens is, like, one of us will find

752
00:39:40,841 --> 00:39:42,921
out when we go to write that we lost.

753
00:39:42,921 --> 00:39:45,271
And so you know the
problem happens right away.

754
00:39:45,601 --> 00:39:50,611
And so what makes CRDTs interesting from
like a user experience design problem is

755
00:39:50,611 --> 00:39:56,381
that you can have conflicts discovered
a long way away from where they're

756
00:39:56,401 --> 00:39:58,901
created, either in space or in time.

757
00:39:59,371 --> 00:40:03,001
And so that actually has serious
user experience consequences.

758
00:40:03,391 --> 00:40:05,371
This can also happen to you and get right.

759
00:40:05,391 --> 00:40:08,851
Like all of us developers
listening here know what it's like.

760
00:40:09,056 --> 00:40:11,616
To, like, try and merge a long
running branch and realize that

761
00:40:11,646 --> 00:40:14,836
somebody else has, like, completely
rewritten a file you edited and

762
00:40:14,836 --> 00:40:17,146
you're like, oh no, what do I do?

763
00:40:17,186 --> 00:40:20,296
Do I just throw my entire week
of working away and start over?

764
00:40:20,296 --> 00:40:21,196
Or do I, like,

765
00:40:21,311 --> 00:40:22,601
There's no free lunch here.

766
00:40:22,631 --> 00:40:26,421
So it's semantically diverges a
lot or changes a lot, then  the

767
00:40:26,421 --> 00:40:28,171
user still needs to help out.

768
00:40:28,411 --> 00:40:32,841
And similarly, the CRDT can't actually
recognize all the conflicts, right?

769
00:40:32,911 --> 00:40:36,151
The technical conflicts we can catch.

770
00:40:36,726 --> 00:40:40,106
But again, if you sort of think
about software, Git is kind of

771
00:40:40,106 --> 00:40:41,856
like a bad CRDT in some ways.

772
00:40:42,426 --> 00:40:46,306
Even if we edit different files,
that doesn't mean the tests will

773
00:40:46,306 --> 00:40:47,926
pass or the software will be useful.

774
00:40:48,536 --> 00:40:51,316
I may have renamed a
function that you were using.

775
00:40:51,316 --> 00:40:54,886
Both can commit cleanly, but then
when we try and run the tests, it

776
00:40:54,936 --> 00:40:56,136
won't even parse and it crashes.

777
00:40:56,856 --> 00:41:00,336
We can think about all those things, and
I think that's the,  design side of the

778
00:41:00,336 --> 00:41:03,376
problem, and then, there's lots of neat
stuff to talk about on the implementation

779
00:41:03,376 --> 00:41:05,636
side, but we can on from that for now.

780
00:41:05,856 --> 00:41:06,896
We'll back to those later.

781
00:41:06,976 --> 00:41:11,746
Yeah, so going beyond syncing and
CRDTs, obviously that's a very

782
00:41:11,746 --> 00:41:15,906
important aspect, syncing in general
for building local-first software,

783
00:41:15,906 --> 00:41:20,176
as it's one of the pillars, like the
software should work on my device,

784
00:41:20,446 --> 00:41:22,246
and we should be able to collaborate.

785
00:41:22,506 --> 00:41:23,836
So if we come back to the.

786
00:41:24,076 --> 00:41:25,716
the software should run on my device.

787
00:41:25,746 --> 00:41:29,526
Which sort of problems does a
developer who's typically rather

788
00:41:29,536 --> 00:41:34,076
building that  three tier web app,
what sort of new problems  does the

789
00:41:34,106 --> 00:41:38,076
developer now need to think about or
maybe think about differently aside

790
00:41:38,076 --> 00:41:41,996
from syncing if you want to build
your next app in a local first way.

791
00:41:42,691 --> 00:41:44,331
The biggest one is architectural.

792
00:41:44,701 --> 00:41:48,201
When you grow up in this
environment of you know, the

793
00:41:48,201 --> 00:41:49,781
database is the source of truth.

794
00:41:49,781 --> 00:41:53,351
And then things sort of roll out, you
know, now you have different problems.

795
00:41:53,351 --> 00:41:57,941
Like, how do I make sure that I have the
data, you know, when my user is offline?

796
00:41:57,971 --> 00:42:00,551
Can I make sure that I've fetched
everything they need so that

797
00:42:00,551 --> 00:42:02,141
they know before they go offline?

798
00:42:02,151 --> 00:42:03,351
Like, yes, you're up to date.

799
00:42:04,211 --> 00:42:09,161
Similarly, you know, if you
can be partially online, right?

800
00:42:09,161 --> 00:42:12,241
Like, maybe you're online and
you can talk to the sync server.

801
00:42:12,946 --> 00:42:14,326
But somebody else can't.

802
00:42:15,086 --> 00:42:18,456
So, you know, how can you know that
you're seeing what other people

803
00:42:18,456 --> 00:42:21,866
are seeing that you're seeing the
things somebody else has sent, right?

804
00:42:21,876 --> 00:42:24,696
I like to give examples from the
field when we talk about this stuff.

805
00:42:24,966 --> 00:42:29,116
Facebook Messenger has like a really
simple version of this problem, you

806
00:42:29,116 --> 00:42:31,776
can still reply to a message when
you're offline with your phone, but

807
00:42:31,776 --> 00:42:34,346
you don't get the little checkbox
that says, Yep, that's been sent.

808
00:42:35,396 --> 00:42:38,466
And it's not until somebody else
takes the phone out and looks at it

809
00:42:38,496 --> 00:42:42,756
and the little, you know, miniature
avatar icon drops below the message

810
00:42:42,756 --> 00:42:44,116
that you know that they've seen it.

811
00:42:45,426 --> 00:42:48,556
What does that mean for source code?

812
00:42:49,286 --> 00:42:51,376
Or like a text document.

813
00:42:51,486 --> 00:42:54,836
I mean, we can't just move the avatar
to the bottom of the page, right?

814
00:42:54,836 --> 00:42:57,906
So there's like really interesting
challenges here around kind of,

815
00:42:57,986 --> 00:43:01,566
thinking a little differently about
how you build your app, right?

816
00:43:01,566 --> 00:43:04,446
And similarly, just because you
have the data locally or could

817
00:43:04,456 --> 00:43:07,486
have the data locally doesn't mean
that it's going to load quickly.

818
00:43:08,136 --> 00:43:12,266
If you store everything as like a
long log of edits in an indexed DB,

819
00:43:12,266 --> 00:43:14,796
it could take you longer to load than
if you were fetching it from the web.

820
00:43:15,686 --> 00:43:17,576
So we need to be very
thoughtful about these things.

821
00:43:17,576 --> 00:43:23,741
But the result of Using this approach
has one really killer benefit that I

822
00:43:23,741 --> 00:43:28,511
just still delight in every day, which
is that, you know, there's the old thing

823
00:43:28,521 --> 00:43:30,591
about, you know, it ran on my machine.

824
00:43:30,611 --> 00:43:31,801
Well, we'll ship your machine.

825
00:43:31,801 --> 00:43:34,701
And that's how Docker was born, right?

826
00:43:35,101 --> 00:43:38,431
Like, it's sort of like that, though,
with local-first software, like, if

827
00:43:38,431 --> 00:43:41,251
it works on your machine, like, that's
the target deployment environment.

828
00:43:41,251 --> 00:43:42,541
You have the whole thing.

829
00:43:43,481 --> 00:43:43,981
So you're done.

830
00:43:44,461 --> 00:43:44,851
Right?

831
00:43:45,011 --> 00:43:47,701
Like, as long as you have a sync
server somewhere, you're finished.

832
00:43:48,101 --> 00:43:49,601
And actually, maybe this is a good moment.

833
00:43:49,601 --> 00:43:51,491
Can I talk a little bit
about peer to peer for a sec?

834
00:43:51,721 --> 00:43:52,051
Please.

835
00:43:52,051 --> 00:43:52,391
Yes.

836
00:43:53,121 --> 00:43:57,751
So, I think one misconception I hear
from people is like, Oh, local first.

837
00:43:57,821 --> 00:44:00,571
That means you're anti cloud
and you don't like servers.

838
00:44:01,511 --> 00:44:02,111
Not at all.

839
00:44:02,701 --> 00:44:09,371
Like, peer to peer technologies are
interesting and there have been You

840
00:44:09,371 --> 00:44:14,661
know, use cases where they were really
vital to achieving users aims, like, you

841
00:44:14,661 --> 00:44:21,411
know, when you want to download an entire
album full of Linux ISOs, you know, then

842
00:44:21,411 --> 00:44:24,391
BitTorrent is, like, really good, and
you can see why having central servers

843
00:44:24,391 --> 00:44:30,921
would be a problem for that, but in the
case of most software, you know, one,

844
00:44:31,171 --> 00:44:35,381
peer to peer systems actually don't work
very well in a lot of network conditions.

845
00:44:35,381 --> 00:44:39,486
You can, you know, you can run BitTorrent
on your home network  with a little

846
00:44:39,486 --> 00:44:44,226
bit of work or a VPN, but at the coffee
shop or places like that, those peer

847
00:44:44,226 --> 00:44:46,886
to peer systems really struggle because
the network tends to be configured in

848
00:44:46,886 --> 00:44:48,476
a way that doesn't allow them to work.

849
00:44:48,906 --> 00:44:50,016
But more than that, right?

850
00:44:50,036 --> 00:44:54,366
Like, if you and I are collaborating
on a peer to peer system, right?

851
00:44:54,366 --> 00:44:57,476
Like, I'm on a laptop most of the time.

852
00:44:58,106 --> 00:45:02,996
I don't want my work to disappear
completely just because I close the lid,

853
00:45:03,165 --> 00:45:04,695
We want servers.

854
00:45:04,735 --> 00:45:05,745
We want them

855
00:45:07,540 --> 00:45:10,150
mean, they literally should serve us.

856
00:45:10,530 --> 00:45:12,710
They right, not us serving them, right?

857
00:45:12,710 --> 00:45:16,910
We're trying to make the server
serve us rather than vice versa.

858
00:45:17,970 --> 00:45:18,420
Love it.

859
00:45:18,450 --> 00:45:18,990
That's great.

860
00:45:19,480 --> 00:45:23,520
And so, yeah, the big difference here
in this model is that you still want

861
00:45:23,520 --> 00:45:25,940
servers, but their responsibility is just.

862
00:45:26,430 --> 00:45:28,170
to host data and distribute it.

863
00:45:29,210 --> 00:45:31,650
And so, you know, yeah, you want it.

864
00:45:31,680 --> 00:45:34,420
It needs to be online for things
to be successful because peer to

865
00:45:34,420 --> 00:45:36,100
peer systems don't really work.

866
00:45:36,520 --> 00:45:41,650
I have spent many years trying to
like adopt peer to peer architecture

867
00:45:41,860 --> 00:45:44,540
before kind of finally giving in
and embracing this perspective.

868
00:45:45,080 --> 00:45:47,690
And then even if they do work, they
don't solve the problem, which is

869
00:45:47,690 --> 00:45:50,590
that in fact, you want your data
to be online even when you're not

870
00:45:51,070 --> 00:45:51,540
Right.

871
00:45:52,030 --> 00:45:52,330
You know,

872
00:45:52,400 --> 00:45:54,420
there's an interesting role it can play.

873
00:45:54,420 --> 00:45:59,010
I know a few folks who haven't
given up yet on peer to peer.

874
00:45:59,010 --> 00:46:03,420
And maybe in the cases where it does work,
it can be an optional part of the process.

875
00:46:03,585 --> 00:46:07,815
Of  a technology stack,  let's say
you're in a smart home setting where you

876
00:46:07,825 --> 00:46:11,305
can assumptions about software works.

877
00:46:11,520 --> 00:46:19,180
Well, peer to peer software is great and
can work really well, but it, I have not

878
00:46:19,200 --> 00:46:26,960
seen a design or implementation of peer
to peer systems that are like really

879
00:46:26,960 --> 00:46:33,090
robust in all network environments and
where you don't just actually have a few

880
00:46:33,110 --> 00:46:36,140
centralized servers hiding off stage.

881
00:46:36,685 --> 00:46:39,425
While you're saying peer to peer,
but actually, you know, 20 percent of

882
00:46:39,425 --> 00:46:44,105
traffic is going to some server like
a great example here is WebRTC, right?

883
00:46:44,185 --> 00:46:46,585
If you're familiar with WebRTC,
people think of it as like this

884
00:46:46,595 --> 00:46:50,375
peer to peer system built into the
browser, but it's not for two reasons.

885
00:46:50,685 --> 00:46:51,165
First.

886
00:46:51,980 --> 00:46:56,140
While it is true that WebRTC allows two
computers to talk directly to each other,

887
00:46:56,750 --> 00:47:00,000
in order for them to find out about
each other to have that conversation,

888
00:47:00,380 --> 00:47:02,100
you need a server to introduce them.

889
00:47:03,450 --> 00:47:09,200
The second is that, and opinions vary
about the prevalence of this, but I have

890
00:47:09,200 --> 00:47:14,490
seen credible reports that are sort of
on the order of 20 percent of WebRTC

891
00:47:14,520 --> 00:47:17,800
connections, cannot be made peer to peer.

892
00:47:18,320 --> 00:47:22,550
And are instead sent through what's
called a turn server, which is just relay

893
00:47:22,880 --> 00:47:24,440
that just bounces the traffic for you.

894
00:47:25,665 --> 00:47:28,805
And like, that's not to say WebRTC is bad.

895
00:47:28,805 --> 00:47:29,875
I mean, it's super useful.

896
00:47:29,875 --> 00:47:33,935
We use it every day in our,
like, video conferencing lives.

897
00:47:34,135 --> 00:47:37,425
But that, it's not
really like peer to peer.

898
00:47:37,465 --> 00:47:42,645
It's like client server with a peer
to peer fast path when it's available.

899
00:47:42,897 --> 00:47:44,977
I think there's lots
to be explored as well.

900
00:47:44,977 --> 00:47:47,357
That's more like on the networking side.

901
00:47:47,367 --> 00:47:51,087
And I think depending on for some
use cases, like . Let's say you

902
00:47:51,087 --> 00:47:55,457
build software for a warehouse or
maybe a cruise ship or something.

903
00:47:55,747 --> 00:47:58,457
I think there, there might be
real use cases, and I'm really

904
00:47:58,642 --> 00:47:59,742
you have control...

905
00:47:59,787 --> 00:48:00,947
are exploring it.

906
00:48:01,412 --> 00:48:05,412
Yeah, if you have control over the
network, you totally can and actually

907
00:48:05,422 --> 00:48:10,312
our friends at ditto where former lab
collaborator Ray McKelvey works have

908
00:48:10,322 --> 00:48:14,592
built a really great business building
local-first software using a different

909
00:48:14,592 --> 00:48:20,062
kind of CRDT than the one we use for
airplanes and like fast food restaurants.

910
00:48:20,092 --> 00:48:24,852
They have like real scaled out
production, industrial deployments

911
00:48:24,852 --> 00:48:26,692
of this technology in the field.

912
00:48:26,712 --> 00:48:29,072
And by all accounts, you know,
it's working really well.

913
00:48:29,543 --> 00:48:34,603
So if you Google Local First right now,
you might come across the blog post

914
00:48:34,603 --> 00:48:39,833
and essay that you've been a co author
of  where you first introduce the ideas

915
00:48:39,903 --> 00:48:45,103
of Local First, and as part of it, you
have those seven ideals of Local First.

916
00:48:45,323 --> 00:48:48,903
So I think this would be enough to,
fill an entire episode on to really

917
00:48:48,903 --> 00:48:54,103
do each ideal justice, but maybe
you can just Summarize those seven

918
00:48:54,103 --> 00:48:56,273
ideals and what they mean for you.

919
00:48:57,078 --> 00:48:57,328
Yeah.

920
00:48:57,328 --> 00:49:01,198
Well, we've talked a bunch already
about how building local-first

921
00:49:01,218 --> 00:49:02,768
software is good for developers, right?

922
00:49:02,798 --> 00:49:05,168
Like, your distribution costs are better.

923
00:49:05,168 --> 00:49:06,748
Your on call experience is better.

924
00:49:06,748 --> 00:49:08,768
Your software is less
complicated, hopefully.

925
00:49:09,348 --> 00:49:13,168
But the original motivation behind
developing the ideas of local first was

926
00:49:13,168 --> 00:49:18,128
really focused on kind of user experience
and  not in the sort of  what corner

927
00:49:18,128 --> 00:49:23,358
radius should the buttons be or what shade
of green for the call to action, but like

928
00:49:23,358 --> 00:49:27,928
the real core experience that the user has
a person who's consuming your software.

929
00:49:28,438 --> 00:49:32,858
And so we identified with Martin
Kleppmann and Adam Wiggins and

930
00:49:32,858 --> 00:49:35,268
Mark McGranagan seven ideals.

931
00:49:35,583 --> 00:49:39,783
That we think local-first software
should aspire to the first one is no

932
00:49:39,783 --> 00:49:47,813
spinners right next frame or your money
back like you should never go to open

933
00:49:47,813 --> 00:49:50,863
something and just see like a spinner
because your network connection is

934
00:49:50,863 --> 00:49:54,893
bad or whatever else like that's just
it's inexcusable we have the fastest

935
00:49:54,893 --> 00:49:58,363
computers in history with the biggest
drives ever in the most bandwidth like

936
00:49:58,363 --> 00:50:02,723
it's just ludicrous that our own personal
data would not be available to us.

937
00:50:03,673 --> 00:50:06,313
Number two your work is
not trapped on one device.

938
00:50:06,313 --> 00:50:11,693
No one wants to be in a world where like
you dropped your phone,  over a cliff

939
00:50:11,693 --> 00:50:14,743
or off a ledge or whatever and suddenly
your data is all gone with it, right?

940
00:50:14,743 --> 00:50:18,083
You left your laptop on the train
and now you've lost your life's work.

941
00:50:18,103 --> 00:50:18,943
No, we don't want that.

942
00:50:19,193 --> 00:50:21,623
So your work should be able to
synchronize across all your devices

943
00:50:21,623 --> 00:50:23,473
and be available on every device.

944
00:50:24,433 --> 00:50:26,873
Simultaneously with this idea
of not having spinners, right?

945
00:50:26,873 --> 00:50:29,303
The idea is we want all seven of
these things to be true together.

946
00:50:30,443 --> 00:50:32,093
Number three is that
the network is optional.

947
00:50:32,513 --> 00:50:35,893
As we've discussed, like, you often find
yourself in places where the network

948
00:50:36,283 --> 00:50:40,673
either is not available because of
technical reasons, or just because,

949
00:50:41,103 --> 00:50:42,803
you know, you want to be offline.

950
00:50:43,208 --> 00:50:43,478
Right.

951
00:50:43,478 --> 00:50:45,638
There's something to be said for
making that choice, turning off

952
00:50:45,638 --> 00:50:48,908
the Wi Fi signal, staying focused,
and still being able to work.

953
00:50:49,878 --> 00:50:53,048
We still insist on seamless
collaboration with your colleagues.

954
00:50:53,048 --> 00:50:55,378
That's number four, right?

955
00:50:56,008 --> 00:50:59,608
It's, if it's not collaborative,
it's local only, not local first.

956
00:51:00,898 --> 00:51:04,198
Another one that I think is
really important is this notion,

957
00:51:04,278 --> 00:51:05,858
number five, the long now.

958
00:51:07,618 --> 00:51:12,488
I can get on a single micro SD card.

959
00:51:13,153 --> 00:51:16,583
Like, every game that was ever
released for Super Nintendo.

960
00:51:16,883 --> 00:51:19,093
And those will work a
hundred years from now.

961
00:51:20,733 --> 00:51:23,493
Like, how much of the software
that you've built in your career

962
00:51:23,493 --> 00:51:25,193
will work a hundred years from now?

963
00:51:25,493 --> 00:51:27,723
How much of it will still be
around ten years from now?

964
00:51:28,403 --> 00:51:31,873
For many of us, so much of
our work  just evaporates.

965
00:51:31,873 --> 00:51:37,063
And it's not just for  the vanity
of wanting to see your work survive.

966
00:51:37,443 --> 00:51:40,893
When you're talking to
people, writing books, or...

967
00:51:41,363 --> 00:51:44,423
You know, who have built their
careers around like a long term

968
00:51:44,423 --> 00:51:48,293
project, you know, it could take 10
years to do the research for a book.

969
00:51:48,293 --> 00:51:52,503
How many cloud services that were
around 10 years ago are still around?

970
00:51:52,513 --> 00:51:55,303
Or how many of that are around
today will be around in 10 years.

971
00:51:55,868 --> 00:51:58,658
You know, you can't control who's
going to get acquired or shut down.

972
00:51:59,388 --> 00:52:00,448
So I think that's a big part of it.

973
00:52:01,438 --> 00:52:03,758
Number six is security
and privacy by default.

974
00:52:04,308 --> 00:52:09,118
You know, why is the default that when
I use software, the product managers at

975
00:52:09,118 --> 00:52:13,128
the company or the support people can
just read my data whenever they want?

976
00:52:13,568 --> 00:52:15,498
I mean, they don't.

977
00:52:15,548 --> 00:52:16,328
I hope they don't.

978
00:52:16,528 --> 00:52:17,218
They most...

979
00:52:17,558 --> 00:52:18,698
Places say they won't,

980
00:52:19,723 --> 00:52:20,313
Right.

981
00:52:20,588 --> 00:52:23,548
but you know, they, they could, right.

982
00:52:23,618 --> 00:52:24,588
That's pretty messed up.

983
00:52:25,598 --> 00:52:29,228
And then number seven, ultimately,
you know, we want the users to

984
00:52:29,228 --> 00:52:31,198
retain ownership and control.

985
00:52:31,798 --> 00:52:32,008
Right.

986
00:52:32,028 --> 00:52:35,528
And that's in some sense, kind of
a distillation and restating of

987
00:52:35,528 --> 00:52:36,828
some of the other points, but like.

988
00:52:38,433 --> 00:52:41,003
You know, if someone can take it
away from you, it's not yours.

989
00:52:41,003 --> 00:52:44,183
We want you to be able to have
the software to make decisions

990
00:52:44,183 --> 00:52:45,363
about when you update it.

991
00:52:45,393 --> 00:52:49,163
If you update it, who you share
your data with, when you share

992
00:52:49,163 --> 00:52:52,083
your data with them and to put
those tools into the user's hands.

993
00:52:52,083 --> 00:52:55,093
We want them to have that feeling.

994
00:52:55,373 --> 00:53:02,913
It's a genuine fact of having the thing
and having agency and ownership over.

995
00:53:03,490 --> 00:53:04,810
those are the seven ideals.

996
00:53:04,860 --> 00:53:08,110
I think it dovetails with a lot
of the developer benefits, right?

997
00:53:08,110 --> 00:53:11,950
Like, sort of the same underlying
decisions that make things

998
00:53:11,950 --> 00:53:14,570
easier for developers also
can improve things for users.

999
00:53:15,120 --> 00:53:16,290
But those are the seven ideals.

1000
00:53:17,075 --> 00:53:21,205
I would say from a product perspective
and from the end user perspective, I think

1001
00:53:21,205 --> 00:53:23,045
there's nothing controversial about it.

1002
00:53:23,375 --> 00:53:28,880
I think like almost all developers who
build apps for the cloud today would

1003
00:53:28,880 --> 00:53:33,130
probably still say, yes, those would
be great characteristics for our apps.

1004
00:53:33,490 --> 00:53:38,530
It's just hard to build apps like
in a cloud first way that have

1005
00:53:38,540 --> 00:53:39,960
all of those characteristics.

1006
00:53:39,960 --> 00:53:44,520
So I think this is why we need a bit of
a different model, how to build software.

1007
00:53:44,620 --> 00:53:47,800
And, those from a user
perspective are amazing.

1008
00:53:47,830 --> 00:53:50,570
And  from a developer
perspective, everything becoming

1009
00:53:50,740 --> 00:53:52,710
simpler sounds incredible.

1010
00:53:53,750 --> 00:53:59,840
Zooming out a bit, I love all the ideas
of Local First, and so this is not the

1011
00:53:59,870 --> 00:54:05,160
topic of today's  show like, I'm also,
for the last two years, working on a

1012
00:54:05,200 --> 00:54:11,885
Local First app myself, but, Pretending
I'd be two years earlier and just trying

1013
00:54:11,895 --> 00:54:14,025
to make sense of what is local first?

1014
00:54:14,095 --> 00:54:15,195
Is that for me?

1015
00:54:15,325 --> 00:54:16,785
How do I go about it?

1016
00:54:17,115 --> 00:54:21,095
Let's say I'm at the beginning of
my journey and I'd be asking you as

1017
00:54:21,095 --> 00:54:25,625
a fellow builder for advice, like,
Hey, Is local first ready for me

1018
00:54:25,625 --> 00:54:27,845
to  build my next app with it today?

1019
00:54:28,225 --> 00:54:31,865
And if so what does my
typical path look like?

1020
00:54:31,925 --> 00:54:34,335
Is there like a Ruby on
Rails for it already?

1021
00:54:34,575 --> 00:54:36,135
Is this a good fit for me?

1022
00:54:36,165 --> 00:54:39,555
Do I rather have to be like
an adventurous explorer?

1023
00:54:39,920 --> 00:54:42,920
Or can I already go into
this with a mindset of  what

1024
00:54:42,920 --> 00:54:44,280
is the most popular stack?

1025
00:54:44,300 --> 00:54:46,170
And that's also what I got to adopt here,

1026
00:54:47,050 --> 00:54:48,800
So we're recording this in  2023.

1027
00:54:49,836 --> 00:54:55,516
And today I would say building
a local first web app is likely

1028
00:54:55,516 --> 00:54:59,826
to require inventing something
at some point along the way.

1029
00:55:00,266 --> 00:55:03,896
Like this is not like just pushing
stuff to Netlify and following

1030
00:55:04,356 --> 00:55:05,696
posts off stack overflow.

1031
00:55:05,776 --> 00:55:09,326
This is a new thing and you're going
to have to figure some things out

1032
00:55:09,696 --> 00:55:13,706
and  I hope someday that this is as
easy as falling off a log, right?

1033
00:55:13,756 --> 00:55:18,466
Like at Heroku, we used to always say
make the right thing the easy thing and

1034
00:55:18,466 --> 00:55:19,846
make the easy thing the right thing.

1035
00:55:20,296 --> 00:55:24,506
And so if we can do that, if we can get
there together as a community, then, you

1036
00:55:24,506 --> 00:55:28,066
know, Hopefully when people find this
podcast a few years from now, they're

1037
00:55:28,066 --> 00:55:29,896
like, wow, we've come a long way.

1038
00:55:30,506 --> 00:55:33,776
But today I think, you know,
what I would recommend is like,

1039
00:55:33,786 --> 00:55:36,036
you can build a react app.

1040
00:55:36,966 --> 00:55:42,506
You can use a CRDT like, Yjs or
auto merge are probably the most

1041
00:55:42,506 --> 00:55:43,886
mainstream choices right now.

1042
00:55:44,439 --> 00:55:46,539
But there are some technologies that I can

1043
00:55:46,614 --> 00:55:47,104
Oh yeah.

1044
00:55:47,564 --> 00:55:48,384
And there's a Vulkan.

1045
00:55:48,384 --> 00:55:49,294
io.

1046
00:55:49,334 --> 00:55:50,694
There's ElectricSQL.

1047
00:55:50,714 --> 00:55:54,184
There's like a ton of people
coming out and trying things.

1048
00:55:54,184 --> 00:55:58,864
And depending on what looks good to you
you should try one and see how far you

1049
00:55:59,069 --> 00:56:03,269
So there's basically an ecosystem of
tooling already for those use cases.

1050
00:56:03,269 --> 00:56:05,029
there's always a bit of like, it depends.

1051
00:56:05,029 --> 00:56:08,369
So one might better for  your
use case than another.

1052
00:56:08,719 --> 00:56:13,569
But think what saying is like, I need
to invent maybe something along the way.

1053
00:56:13,829 --> 00:56:17,529
Maybe I need to do end to end
encryption, or maybe I need to do

1054
00:56:17,809 --> 00:56:19,849
permission control in a certain way.

1055
00:56:20,044 --> 00:56:23,824
Where none of the available
tools yet do exactly what I need.

1056
00:56:23,904 --> 00:56:26,534
And this is where I need
to get my own hands dirty,

1057
00:56:26,949 --> 00:56:29,659
Yeah, you'll probably need to
figure out how to deal with

1058
00:56:30,169 --> 00:56:32,239
some of those offline use cases.

1059
00:56:32,239 --> 00:56:34,659
You're going to have to decide
who you want to give this data to.

1060
00:56:34,659 --> 00:56:37,549
I think that's one that
everybody kind of wants different

1061
00:56:37,559 --> 00:56:39,129
things when we talk to people.

1062
00:56:39,169 --> 00:56:41,239
And I think eventually
some standards will emerge.

1063
00:56:41,239 --> 00:56:42,589
There'll be probably
two or three patterns.

1064
00:56:42,589 --> 00:56:45,799
Most people adopt, but at the
moment, because everybody's asking

1065
00:56:45,799 --> 00:56:48,089
for different things, people
are all making different things.

1066
00:56:49,259 --> 00:56:53,669
But I think that's a that sort of ACLs and
access permissions is an area you should

1067
00:56:53,669 --> 00:56:55,479
expect to spend some time thinking about.

1068
00:56:55,949 --> 00:57:02,349
But like, I gotta say, it feels
amazing to just stand up an app.

1069
00:57:02,869 --> 00:57:08,159
In a short matter of time pointed at some
kind of a sync server and then just be,

1070
00:57:08,689 --> 00:57:10,349
you know, working on it with other people.

1071
00:57:10,419 --> 00:57:15,299
And I hope everybody will take a
take the time to at least have that

1072
00:57:15,299 --> 00:57:18,429
experience to try building something
small, whether it's with automerge or Y.

1073
00:57:18,429 --> 00:57:18,609
J.

1074
00:57:18,609 --> 00:57:18,889
S.

1075
00:57:18,889 --> 00:57:20,919
or ElectricSQL or anything else.

1076
00:57:21,439 --> 00:57:24,779
And that experience, it's just.

1077
00:57:25,339 --> 00:57:30,619
It's so eye opening for me as somebody who
spent all these years building these big

1078
00:57:30,629 --> 00:57:36,709
complicated web apps for the cloud to just
say actually, it can be pretty simple.

1079
00:57:37,039 --> 00:57:39,979
And when it is simple, it feels great.

1080
00:57:40,259 --> 00:57:43,119
You feel like you have like, like wings.

1081
00:57:43,129 --> 00:57:46,419
You're just able to move so fast,
you're able to get so much done.

1082
00:57:46,419 --> 00:57:48,389
And it's like someone's taking
the brick off the pencil.

1083
00:57:48,389 --> 00:57:52,109
You just, like, you don't even realize
how much hassle you're putting up

1084
00:57:52,109 --> 00:57:53,779
with every day until it goes away.

1085
00:57:54,016 --> 00:57:58,446
So maybe after someone's listening
to this, maybe on your next weekend,

1086
00:57:58,786 --> 00:58:03,436
give it a little try, like build a app
you want it to build all along, maybe

1087
00:58:03,476 --> 00:58:08,706
React app, like throw in automerge,
throw in Yjs, see how far you'll get.

1088
00:58:09,056 --> 00:58:13,316
And I think the promise is
really that users, your end users

1089
00:58:13,696 --> 00:58:15,426
will get much better software.

1090
00:58:15,746 --> 00:58:19,146
And for you as an app developer,
your life becomes a lot simpler.

1091
00:58:19,156 --> 00:58:23,106
You can take off that, that big
brick and just enjoy drawing

1092
00:58:23,116 --> 00:58:24,516
and writing with your pencil.

1093
00:58:24,916 --> 00:58:26,606
That, that sounds super exciting.

1094
00:58:26,636 --> 00:58:31,696
And like having seen the ecosystem now
for the last two years evolve, I think we

1095
00:58:31,696 --> 00:58:34,126
have already come quite, quite a long way.

1096
00:58:34,126 --> 00:58:37,856
Now there is a real ecosystem
and you don't need to reinvent

1097
00:58:37,916 --> 00:58:39,336
everything by yourself.

1098
00:58:39,776 --> 00:58:44,996
If someone's like looking for some
references or some inspiration, can you

1099
00:58:44,996 --> 00:58:50,156
point to like any sort of software that
is already local first, or I guess like

1100
00:58:50,366 --> 00:58:52,106
local first is a bit of a spectrum.

1101
00:58:52,116 --> 00:58:57,676
Some apps might be more local first
than others, but is there like some

1102
00:58:57,676 --> 00:59:04,036
software that people already use today
that, that is directionally local first

1103
00:59:04,046 --> 00:59:05,926
that you can orient yourself around?

1104
00:59:06,886 --> 00:59:10,946
Just looking at the core set of apps on
your phone is like a nice starting point.

1105
00:59:11,446 --> 00:59:14,726
For web apps, there's things going
back all the way to like ether pad.

1106
00:59:15,201 --> 00:59:15,471
Right.

1107
00:59:15,471 --> 00:59:17,341
Where you have offline collaboration.

1108
00:59:17,961 --> 00:59:20,951
And then  if you want to try
and build your own experience

1109
00:59:21,001 --> 00:59:23,821
automerge.org/docs/quickstart.

1110
00:59:24,306 --> 00:59:27,666
You know, you can get up and, you know,
experience that feeling of building

1111
00:59:27,666 --> 00:59:29,056
local-first software for yourself.

1112
00:59:29,744 --> 00:59:35,194
I think  most apps that we  from a user
perspective, see as working fast or

1113
00:59:35,224 --> 00:59:40,344
that you also trust to use them  while
you're traveling on a plane, on a train.

1114
00:59:40,644 --> 00:59:44,824
I think they are all probably, even
though they don't have a local first

1115
00:59:44,824 --> 00:59:49,684
label yet on the software box, they
are probably already more local first.

1116
00:59:49,899 --> 00:59:53,999
And yeah, this is, I think,
whoever's trying to build something

1117
00:59:54,029 --> 00:59:57,639
next if you get to experience that
for yourself, I think that's the

1118
00:59:57,639 --> 00:59:59,349
easiest way to convince yourself.

1119
00:59:59,379 --> 01:00:03,429
I'm thinking of some software that
I think that I use on a daily basis,

1120
01:00:04,399 --> 01:00:08,124
whether like, whether it's like,
something like, Linear or something

1121
01:00:08,124 --> 01:00:12,084
like superhuman, those sort of apps,
while I'm not sure whether they were

1122
01:00:12,414 --> 01:00:17,224
from the inception, meant to be local
first, I think they've directionally

1123
01:00:17,224 --> 01:00:21,659
evolved in a way that is more and more
local first, there's probably still like

1124
01:00:21,869 --> 01:00:27,129
servers heavily involved, but in terms
of that client is getting a lot smarter.

1125
01:00:27,159 --> 01:00:29,949
I think that's already an
important step in that direction.

1126
01:00:30,304 --> 01:00:33,254
And that's certainly why
those apps feel great.

1127
01:00:34,554 --> 01:00:34,994
Amen.

1128
01:00:36,034 --> 01:00:41,574
So maybe before wrapping up, what are
some topics  within Local First  that are

1129
01:00:41,584 --> 01:00:46,044
very top of mind for you right now that
you spend a lot of time thinking about

1130
01:00:46,364 --> 01:00:50,611
and where you hope that  we'll be a lot
further along in one or two years time?

1131
01:00:51,221 --> 01:00:51,931
Ooh.

1132
01:00:52,431 --> 01:00:57,201
I think for me, the biggest design
questions right now are around

1133
01:00:57,211 --> 01:01:00,071
versioning and version control.

1134
01:01:00,581 --> 01:01:03,861
One of the things we've found as we've
studied local-first software and talked

1135
01:01:03,871 --> 01:01:10,261
to writers and creators is that, um,
this idea of the cloud as like, Sort

1136
01:01:10,261 --> 01:01:14,131
of the panopticon where anyone can
watch you work is like really deeply

1137
01:01:14,131 --> 01:01:18,821
uncomfortable to a lot of people and
so exploring these ideas of creative

1138
01:01:18,821 --> 01:01:22,181
privacy and the ability to work the way
software developers work, which is  you

1139
01:01:22,181 --> 01:01:24,031
work private until you're ready to share.

1140
01:01:24,391 --> 01:01:28,050
I'm really eager to explore
those ideas and bring those.

1141
01:01:28,501 --> 01:01:30,991
To the rest of the world, your
Google Docs, you should be able

1142
01:01:30,991 --> 01:01:32,821
to work in that same offline way.

1143
01:01:33,257 --> 01:01:34,157
So I think that whole...

1144
01:01:34,372 --> 01:01:38,792
Question about like bringing together
version control in new ways is a big one.

1145
01:01:39,502 --> 01:01:44,212
Authentication, authorization,
access control, sharing

1146
01:01:44,232 --> 01:01:45,742
permissions, that kind of stuff.

1147
01:01:45,762 --> 01:01:47,582
I think it's actually
quite closely related.

1148
01:01:47,612 --> 01:01:50,062
I think that's an area we're going
to see a lot of progress around.

1149
01:01:50,592 --> 01:01:54,442
I think the app models are going
to continue to evolve, right?

1150
01:01:54,472 --> 01:01:54,812
Like.

1151
01:01:55,292 --> 01:02:01,042
Auto merge is document based, electric SQL
is database based and  Riffle is SQLite.

1152
01:02:01,282 --> 01:02:02,322
Both are actually right.

1153
01:02:02,342 --> 01:02:06,872
I don't think it's one or the other, but I
think exploring kind of that relationship

1154
01:02:06,892 --> 01:02:08,462
there is going to be a big area.

1155
01:02:08,822 --> 01:02:11,582
I think there's a lot of stuff
around security and encryption,

1156
01:02:11,582 --> 01:02:13,902
end to end encryption that's
going to unfold and with it.

1157
01:02:14,337 --> 01:02:15,947
What's that what's that quote?

1158
01:02:16,017 --> 01:02:18,797
I think it was Leah Kistner,
which is , cryptography is a

1159
01:02:19,217 --> 01:02:23,227
technique for turning many problems
into key management problems.

1160
01:02:23,310 --> 01:02:26,000
so I think we're going to see a lot
of that over the next few years.

1161
01:02:26,620 --> 01:02:28,140
I think that's just scraping the surface.

1162
01:02:28,140 --> 01:02:31,210
And I think all of this though
will also intersect with like

1163
01:02:31,210 --> 01:02:32,690
application development models.

1164
01:02:33,260 --> 01:02:37,080
Just thinking about other kind of
intersecting things, another big part of

1165
01:02:37,090 --> 01:02:42,790
where we're still relatively immature is
deciding what to sync and when to sync it,

1166
01:02:43,110 --> 01:02:46,380
There's this motto we have at Ink
and Switch, which is like, results on

1167
01:02:46,380 --> 01:02:48,000
the next frame are your money back.

1168
01:02:48,000 --> 01:02:52,080
We want everything you do to run at
a hundred hertz, none of this like a

1169
01:02:52,290 --> 01:02:55,560
hundred millisecond round time to the
server, and then you get to paint.

1170
01:02:55,830 --> 01:02:59,250
No, like when you interact with the
system, you should see the response

1171
01:02:59,250 --> 01:03:00,960
the next time your screen refreshes.

1172
01:03:01,410 --> 01:03:04,500
So that means on a hundred hertz screen,
you got 10 milliseconds to do everything.

1173
01:03:04,910 --> 01:03:08,950
And so if the server is 50
milliseconds away is too late,

1174
01:03:08,950 --> 01:03:10,420
you can't ask the server, right?

1175
01:03:10,420 --> 01:03:12,220
If you want to have things by
the next data, that means you

1176
01:03:12,220 --> 01:03:15,700
need to out there already get the
data before the user even asks

1177
01:03:15,735 --> 01:03:20,915
That has big implications on your
data architecture on like performance,

1178
01:03:20,950 --> 01:03:22,180
So many Yeah.

1179
01:03:22,200 --> 01:03:23,280
Things need to be in memory.

1180
01:03:23,290 --> 01:03:24,670
How do you manage memory use?

1181
01:03:24,930 --> 01:03:27,490
What about like low bandwidth connections?

1182
01:03:27,740 --> 01:03:31,450
So yeah, I think that whole area of
like sync optimization and background

1183
01:03:31,450 --> 01:03:33,280
sync and so on is really important.

1184
01:03:33,330 --> 01:03:37,556
And it's an area that have thought
about, but we haven't seen a ton of

1185
01:03:37,556 --> 01:03:41,980
progress on implementations yet, because
until you actually have enough users

1186
01:03:41,980 --> 01:03:44,260
and enough usage to really drive that,

1187
01:03:44,597 --> 01:03:48,707
Really interesting topics to dive
deeper on in future episodes as well.

1188
01:03:48,977 --> 01:03:52,807
There is one topic that also stands
out to me that I think we're not there

1189
01:03:52,807 --> 01:03:57,917
yet which is cross app collaboration
or cross app interoperability.

1190
01:03:57,937 --> 01:03:59,267
So as we're.

1191
01:03:59,547 --> 01:04:03,097
Steering in the direction where we
have like more and more AI in our

1192
01:04:03,097 --> 01:04:08,207
lives and all of those AIs so far are
looking also that they run on like

1193
01:04:08,217 --> 01:04:10,457
somewhere's remote server, et cetera.

1194
01:04:10,457 --> 01:04:15,197
And now we're going to feed more
and more of our data into those I

1195
01:04:15,237 --> 01:04:19,857
would love to see a world where like
the AIs can also similar, like the.

1196
01:04:20,152 --> 01:04:23,582
Like the programs that we're
building also run on our devices.

1197
01:04:23,632 --> 01:04:26,802
Now we need to make our
data available to those.

1198
01:04:27,112 --> 01:04:31,332
Have those programs and those AIs
collaborate between each other.

1199
01:04:31,682 --> 01:04:36,032
So in the same ways, like all
the stuff I have in my own head.

1200
01:04:36,247 --> 01:04:40,997
From conversations with you, from
conversations with others, my mind is

1201
01:04:40,997 --> 01:04:45,077
like able to, all of those different
interactions I have are almost like

1202
01:04:45,097 --> 01:04:50,607
little apps and they naturally can
collaborate yet my contacts app that runs

1203
01:04:50,607 --> 01:04:56,127
on my machine and my email app, unless
they're from Apple and does integrate it,

1204
01:04:56,417 --> 01:05:01,217
otherwise they can't like, what does that
integration story between apps, et cetera?

1205
01:05:01,507 --> 01:05:02,567
What does that look like?

1206
01:05:02,567 --> 01:05:04,997
And I think the foundation for that is.

1207
01:05:05,207 --> 01:05:07,547
The data needs to be on the device.

1208
01:05:07,907 --> 01:05:13,297
And now we need to build something on
top that makes it easier to interoperate.

1209
01:05:13,667 --> 01:05:15,367
That data is shared across apps.

1210
01:05:15,367 --> 01:05:17,867
That's a whole topic that I'm
also really excited about.

1211
01:05:18,277 --> 01:05:22,717
So we call that malleable software
at Income Switch, and it's a very

1212
01:05:22,717 --> 01:05:24,457
active area of research for us.

1213
01:05:24,462 --> 01:05:29,387
We've just published a paper called Embark
Today as of this recording about that

1214
01:05:29,387 --> 01:05:34,567
https://inkandswitch.com/embark where we
talk exactly about some of these problems.

1215
01:05:35,327 --> 01:05:39,777
One really cool thing about auto
merges design that I haven't seen

1216
01:05:39,777 --> 01:05:46,167
in other systems is that  the grain
of the system means that any apps

1217
01:05:46,167 --> 01:05:48,697
which share a backup sync server.

1218
01:05:49,442 --> 01:05:52,582
can load each other's data as long
as they know how to interpret it.

1219
01:05:53,432 --> 01:05:56,432
And, you know, it's a little bit like
sharing a SQL database, but without

1220
01:05:56,432 --> 01:05:59,402
all the problems of sharing a SQL
database, because the database is not

1221
01:05:59,402 --> 01:06:02,702
like the shared resource that you have
to worry about people hammering, right?

1222
01:06:02,902 --> 01:06:05,942
you can just put data in a sync server
and then anything can query it out.

1223
01:06:06,672 --> 01:06:09,022
And so, I got to say, it's awesome.

1224
01:06:09,082 --> 01:06:10,142
I use it all the time.

1225
01:06:10,162 --> 01:06:13,062
When I break something, I can open
it up in another app and fix it.

1226
01:06:13,422 --> 01:06:16,342
You know, I have a whole suite of
little apps that are local first

1227
01:06:16,352 --> 01:06:17,872
that collaborate on our data now.

1228
01:06:17,872 --> 01:06:20,702
And yeah, well, we'll say more
about that sometime in the future

1229
01:06:20,702 --> 01:06:22,313
when we have something to say.

1230
01:06:22,586 --> 01:06:27,686
Peter, thank you so much for sharing
all of that about Local First with us.

1231
01:06:28,096 --> 01:06:32,716
I think this is the beginning of a
much, much longer journey where I want

1232
01:06:32,716 --> 01:06:36,886
to hear a lot more different voices,
like people building apps with Local

1233
01:06:36,886 --> 01:06:42,056
First, people building tools to help
other developers build Local First apps.

1234
01:06:42,426 --> 01:06:45,786
All the things we've just  barely
touched the surface here today.

1235
01:06:46,156 --> 01:06:48,996
So thank you so much for coming on
the show and I'm looking forward

1236
01:06:48,996 --> 01:06:50,356
to having you back hopefully soon.

1237
01:06:50,981 --> 01:06:51,331
Yeah.

1238
01:06:51,391 --> 01:06:52,101
It was a lot of fun.

1239
01:06:52,291 --> 01:06:52,461
Take

1240
01:06:52,676 --> 01:06:53,076
Awesome

1241
01:06:53,506 --> 01:06:56,156
Thank you for listening to
the Local First FM podcast.

1242
01:06:56,376 --> 01:07:00,576
If you've enjoyed this episode and haven't
done so already, please subscribe and

1243
01:07:00,576 --> 01:07:02,376
leave a review wherever you're listening.

1244
01:07:03,146 --> 01:07:06,016
Please also consider telling your
friends about it, if you think they

1245
01:07:06,016 --> 01:07:07,536
could be interested in Local First.

1246
01:07:08,386 --> 01:07:12,036
Thank you again to Expo and Crab
Nebula for supporting this podcast.

1247
01:07:12,306 --> 01:07:13,106
See you next time.