-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
383 lines (353 loc) · 10.2 KB
/
index.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>The Twelve-Factor App</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/monokai.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<style>
.code {
background-color: black;
color: gray;
border-radius: 10px;
padding: 4px;
}
.reveal section img {
background:none;
border:none;
box-shadow:none;
}
.fragment.current-visible.visible:not(.current-fragment) {
display: none;
height:0px;
line-height: 0px;
font-size: 0px;
}
table, tr, th, td {
border: 1px solid white;
text-align: center !important;
}
th {
font-weight: bold !important;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1> The Twelve-Factor App </h1>
</section>
<section style="text-align: left;">
<div style="display: flex; align-items: center; justify-content: flex-start;">
<img src="graphics/me.png" alt="" height="150px" style="padding: 15px;">
<h2 style="padding: 15px;">Anton Sankov</h2>
</div>
<br>
<span style="text-align: left;">
Member of Technical Staff @ <span style="font-weight: bold;">VMware Carbon Black</span> <br>
Core Team Member @ <span style="font-weight: bold;">Kiwi TCMS</span> <br> <br>
</span>
<div style="display: flex; align-items: center; justify-content: flex-end;">
<div>
<div>
<img style="vertical-align:middle" src="graphics/twitter.png" alt="" height="40px">
a_sankov
</div>
<div style="display: flex; justify-content: flex-end;">
<img style="vertical-align:middle; padding-right: 10px;" src="graphics/github.png" alt="" height="40px">
asankov
</div>
</div>
</div>
</section>
<section>
<h1> Twelve factors? </h1> <br>
12 simple rules for writing microservices
<br><br>
<a href="http://12factor.net" target="blank">12factor.net</a>
<aside class="notes">
Methodology for writing microservices.
Came out from Heroku in 2011.
Aged well, microservices development can benefit from them.
</aside>
</section>
<section>
<section>
<h1>
I. Codebase
</h1>
One codebase, many deploys
<aside class="notes">
One codebase, tracked in version controller and deployed to all of the environments that you have.
</aside>
</section>
<section>
<img src="graphics/codebase.png" alt=""/>
<aside class="notes">
One codebase to all environments.
Everything environment specific should be separated from the codebase.
Mono-repo vs. multi-repo.
</aside>
</section>
<section>
<h2>Multi-repo vs. mono-repo</h2><br>
<img src="graphics/multi-mono-repo.png" alt=""/>
</section>
</section>
<section>
<section>
<h1>
II. Dependencies
</h1>
Explicitly declared and isolated
<aside class="notes">
Dependency manifest.
Tools. Golang?
</aside>
</section>
<section>
<img src="graphics/dependencies.png" alt=""/>
<aside class="notes">
Don't depend on anything externally.
</aside>
</section>
</section>
<section>
<section>
<h1>
III. Config
</h1>
Stored in environment
<aside class="notes">
Config comes from environment.
Environment should source the config.
App should read the config.
Many tools to do the job.
</aside>
</section>
<section>
<img src="graphics/config.png" alt=""/>
</section>
</section>
<section>
<section>
<h1>
IV. Backing services
</h1>
Treated as resources
<aside class="notes">
Backing services - everything the app consumes over the network.
Usually, a lot of those.
Treat equally.
</aside>
</section>
<section>
<img src="graphics/backing.png" alt=""/>
</section>
<section data-transition="fade-in slide-out">
<img src="graphics/backing2.png" alt=""/>
</section>
</section>
<section>
<section>
<h1>
V. Build, release, run
</h1>
Strictly separated build and run stages
</section>
<section>
<h2> Build<span style="opacity:10%">, release, run</span></h2>
<br>
<img src="graphics/dependencies.png" alt=""/>
</section>
<section>
<h2><span style="opacity:10%">Build, </span>release<span style="opacity:10%">, run</span></h2>
<br>
<img src="graphics/release.png" alt=""/>
</section>
<section>
<h2><span style="opacity:10%">Build, release, </span>run</h2>
<br>
<img src="graphics/run.png" alt=""/>
</section>
</section>
<section>
<h1> Easy? </h1>
</section>
<section>
<section>
<h1>
VI. Port binding
</h1>
Self-contained app, exposing service on a port
</section>
<section>
<h4> Running your application locally </h4>
<img src="graphics/port-binding-local.png" alt="">
<h4> Running your application in the cloud </h4>
<img src="graphics/port-binding-cloud.png" alt="">
</section>
</section>
<section>
<section>
<h1>
VII. Processes
</h1>
Execute the app as one or many stateless processes
</section>
<section>
<img src="graphics/processes.png"/>
</section>
</section>
<section>
<section>
<h1>
VIII. Concurrency
</h1>
Scale out via the process model
</section>
<section>
<img src="graphics/concurrency1.png"/>
</section>
<section>
<img src="graphics/concurrency2.png"/>
</section>
</section>
<section>
<section>
<h1>
IX. Disposability
</h1>
Fast startup and graceful shutdown
</section>
</section>
<section>
<section>
<h1>
X. Dev/prod parity
</h1>
Keep environments as similar as possible
</section>
<section>
<h3>
Ex.1: Use the same DB back-end across environments
</h3>
<br>
<table>
<tr>
<th> Dev </th>
<th> Stage </th>
<th> Prod </th>
<th></th>
</tr>
<tr>
<td> SQLite </td>
<td> SQLite </td>
<td> PostgreSQL </td>
<td> ❌</td>
</tr>
<tr>
<td> PostgreSQL</td>
<td> PostgreSQL</td>
<td> PostgreSQL </td>
<td> ✅ </td>
</tr>
</table>
</section>
<section>
<h3>Ex.2: Don't mock 3rd party services in test environments</h3>
</section>
</section>
<section>
<section>
<h1>
XI. Logs
</h1>
Treat logs as event streams
</section>
<section>
<img src="graphics/logs.png"/>
</section>
</section>
<section>
<section>
<h1>
XII. Admin processes
</h1>
Run admin/managaments tasks as one-off processes
</section>
<section>
<h3>
Ex.: Don't do DB migrations by hand.
</h3>
<img src="graphics/admin-wrong.png" alt="">
</section>
<section>
<img src="graphics/admin-right.png" alt="">
</section>
</section>
<section>
<section>
<h1>Summary</h1>
<br>
<h3> Be explicit </h3>
<h3> Decouple </h3>
<h3> Don't make assumptions </h3>
</section>
<section>
<h1>Takeaways</h1>
<br>
<h3> Portability </h3>
<h3> Scalability </h3>
<h3> Cloud readiness </h3>
</section>
</section>
<section>
<div>
<h1>THANK YOU!</h1>
<br>
<div style="display: flex; align-items: center; justify-content: space-between; font-size: 30px;">
<span>
<a href="https://asankov.org/twelve-factor-app">asankov.org/twelve-factor-app</a>
</span>
<span>
<div>
Anton Sankov,
</div>
Member of Technical Staff at VMware Carbon Black
</span>
</div>
</div>
</section>
</div>
</div>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
hash: true,
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true }
]
});
</script>
</body>
</html>