-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
418 lines (328 loc) · 8.21 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<!DOCTYPE html>
<html>
<head>
<title>How we built DevTube</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body, .remark-slide-content {
color: white;
font-family: 'Droid Serif';
background-color: black !important;
}
.logo img {
width: 300px;
}
.firebase {
background-color: #0099E9 !important;
}
.fire {
position: absolute;
}
.fastr img {
width: 100%;
}
.invert {
background-color: white !important;
color: black;
}
.es {
color: black;
background-color: #f7df1e !important;
}
.remark-slide-scaler { -webkit-box-shadow: 0 !important; box-shadow: none !important; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.strike {
text-decoration: line-through
}
h1 strong {
background-color: #2980b9;
padding: 0.2em;
}
.danger h1 strong {
background-color: #ff2400;
padding: 0.2em;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
</style>
</head>
<body>
<textarea id="source">
class: center, middle
# HOW WE BUILT **DEV.TUBE**
---
class: center, middle
# ?
---
background-image:url(cats.png)
background-size: contain
???
Well, it's actually more...
---
### - Open source (github.com/watch-devtube)
--
### - Channel curation via GitHub (github.com/watch-devtube/contrib)
--
### - All data is mutable
???
your name is mistyped by a conf organiser
--
### - No marketing videos
--
### - Subscribe by channel/tag/speaker
--
### - Better ranking (bit.ly/how_we_rank)
--
### - Better UX and search (thanks to community)
---
class: center, middle
# **1 000 000** views
---
background-image:url(domain.png)
background-size: contain
---
background-image:url(eduards_spain.jpg)
background-size: contain
---
background-image:url(andrey.jpg)
background-size: contain
---
class: center, middle
# .strike[MVP] BVP in June
???
- it tooks us 2 months
- far from perfect
--
## Barely Viable Product
???
- wanted to develop longer, but...
---
background-image: url(spike.png)
background-size: contain
---
background-image: url(henrik.png)
background-size: contain
---
background-image: url(hackernews.png)
background-size: contain
---
background-image: url(producthunt.png)
background-size: contain
???
- habrahabr
- popular magazines
---
background-image: url(twitter.png)
background-size: contain
???
to understand what happened next, let me show our tech stack
---
class: center, middle
## Front-End
---
class: invert
background-image: url(vue.png)
background-size: contain
???
- simple, easy to understand, easy to start with
- routing and state management
---
class: es, center, middle
# ES6 with Babel
---
class: invert
background-image: url(bulma.png)
background-size: contain
???
- no javascript
- super nice
---
class: firebase
background-image: url(firebase.png)
background-size: contain
???
- authentication (github, twitter, google)
- firestore, document storage as a service (subscriptions, favorites, watched)
- Pay as go you. Limits are generous. We go and don't pay.
---
class: center, middle
## Back-End
---
class: invert
background-image: url(algolia.png)
background-size: contain
???
- Serverless, SaaS algolia (~elastic search as a service)
- Algolia had OSS plan and, according to our convo, I understood it's free for OSS. No limits.
--
.fire[![](fire.png)]
???
- And then everything went on fire... Limits!
---
class: center, middle
# **Free is a lie.**
### youtube.com/watch?v=ldhHkVjLe7A
---
### @eduardsi: We are victims of our popularity. Need 5M free records to survive. PLEASE!
--
### @algolia: We won't be able to give you 5M operations for free. The 300k operations you have is already more than what we usually give for open-source. I'll bump it to 400k so you can enjoy your Hacker News ride, but I won't be able to do much more unfortunately. What I can do though is to hook you up with our sales team if you'd like.
???
shit, exactly what we need now. dealing with sales.
--
### @eduardsi: OK. Please send me the quote.
???
- at this point it was clear we can't afford it and have to run away.
- but we had to pretend that we are a prospective customer. Saying "no" might have kill us.
--
# no reply up to now
---
class: center, middle
background-image: url(instasearch.png)
background-size: contain
# **Vendor-lock in**
???
nice Vue.js widgets. I don't to build UI! :-)
---
class: center, middle
# **#1 Debouncing**
### (vuejs-tips.github.io/v-debounce)
---
class: center, middle
# **#2 LRU caching**
### (github.com/isaacs/node-lru-cache)
???
Least recently used
---
background-image: url(fastrVersion.png)
background-size: contain
???
- can't change UI. but
- intercept Algolia requests and mimic responses on our backend.
---
class: center, middle
# express.js + Google Cloud Functions
???
- no time and money for managing servers.
- GCF reached GA only in July, 2018. Now it's less stable than in BETA :))
---
class: center, middle
# Why not AWS?
???
- Native Express.js API support vs. API gateway magic
- Easy to use, no access rights magic
- No PhD in computer science (with flexibility comes cost)
---
# What can replace Algolia in long-term?
--
### - Elasticsearch
???
- self-hosted (servers)
- managed ($$$)
--
### - Elasticsearch
--
### - Lunr.js (github.com/olivernn/lunr.js) + Loki.js (github.com/techfort/LokiJS)
---
class: center, middle
# 56,000 indexed videos = **1.8GB of RAM**
---
background-image:url(maxmemory.png)
background-size: contain
---
class: center, middle
# Serverless, in-memory, cheap full-text search
### (github.com/watch-devtube/commons/blob/master/lib/Fastr.ts)
???
look ma, no servers! code + data is deployed as single lambda fn.
---
class: center, middle
# Seriously, no servers?
???
Well, ok, there is one.
---
class: center, middle
# **Nginx**
???
- glue custom domain with cloud functions.
- cheaper than Google Cloud LB
- f1-micro instance, less memory than Raspberry PI and only once CPU
- handling huge traffic and no busy at all : )
---
class: center, middle, danger
# **Cold starts**
???
- 5-10 seconds
- solution: progress bar
- solution: CDN for static files
- solution: split functions into smaller functions
- solution: keep functions warm
---
class: center, middle, danger
# **Downtimes**
???
- no zero downtime deployments in GCF
- aws wins here
- we implemented blue-green. We have 2 versions, then check if app is alive, then switch nginx.
---
class: center, middle, danger
# **Case-by-case test automation**
???
- we do not have the luxury of time to auto-test everything.
- we started testing more when things stabilized (to avoid regressions).
- autotest things that it's hard / annoying / expensive to tests manually (ranking)
- autotest critical scenarios (e.g. where bugs can lead to data corruption)
- No test env, so we deploy and TiP
- focus on MTTD / MTTR (errors go to Slack, PingDom)
---
class: center, middle
# **How much does it cost?**
???
- burn rate 20$
- 300$ from Google
- zero ops cost (serverless!).
- dev time, but have amazing contributors, including famous IT peeps. See –
---
background-image: url(leaderboard.png)
background-size: contain
???
we give karma for data contributions.
---
class: center, middle
# Anything else?
---
class: logo
### - Profits?
???
a lot of requests from ad providers.
--
### - Who'll pay for infrastructure?
???
we. it's not our primary business. it's for conference.
--
### - Logo?
![](devtubelogo.svg)
![](troll.jpg)
---
class: center, middle
# Thank you!
### @codingandrey @eduardsi
???
Hope you'll join in, so we can make the best tech video hub together!
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create({
ratio: '16:9',
slideNumberFormat: function (current, total) {
return ''
}
});
</script>
</body>
</html>