-
Notifications
You must be signed in to change notification settings - Fork 0
/
envelope-mongo.html
267 lines (228 loc) · 7.15 KB
/
envelope-mongo.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
<!DOCTYPE html>
<html>
<head>
<title>Envelope & MongoDB</title>
<meta charset='utf-8'>
<script src='http://html5slides.googlecode.com/svn/trunk/slides.js'></script>
</head>
<style>
body {
background: white url(images/background.png) repeat !important;
}
.slides.template-default > article:not(.nobackground):not(.biglogo) {
background: white url(images/small_logo.png) 710px 625px no-repeat !important;
}
.slides.template-default article.biglogo {
background: white url(images/big_logo.png) 50% 50% no-repeat !important;
}
.slides.template-default article p img {
border-radius: 50px;
vertical-align: middle;
}
</style>
<body style='display: none'>
<section class='slides layout-regular template-default'>
<article class='biglogo'>
</article>
<article>
<h1>
Envelope
<br>
& MongoDB
</h1>
<p>
Seth Vargo
<br>
Nov 28, 2012
</p>
</article>
<article>
<img src='images/iteration2-mail.png' width='780'>
</article>
<article>
<h3>Envelope 1.0</h3>
<img src='images/technologies.png' width='750' style='margin-left: 5px; margin-top: 25px;'>
</article>
<article>
<h3>Envelope 1.0</h3>
<img src='images/architecture.png' width='780' style='margin-top: 115px;'>
</article>
<article>
<h3>Envelope 1.0</h3>
<img src='images/erd.png' width='550' style='margin-left: 125px; margin-top: 25px;'>
</article>
<article>
<h3>Envelope 1.0 - Facts</h3>
<ul class='build'>
<li>19 Unique Tables</li>
<li>23 STI Tables</li>
<li>44 Relations</li>
<li>~3 Tables/Query</li>
</ul>
<ul class='build'>
<li>300+ Seconds Loading 1000 Messages</li>
<li>31 Queries to Load Home Page</li>
<li>~2.43s Response Time</li>
<li>.78-.88 Database Load</li>
<li>CPU Cycles Through the Roof!</li>
</ul>
</article>
<article>
<h3>Envelope 1.0 - Testing</h3>
<ul class='build'>
<li>268 Tests</li>
<li>8 Minute Unit Tests</li>
<li>"Create the Universe" for a single test</li>
<li><strike>Guard</strike></li>
<li>☹</li>
</ul>
<ul class='build'>
<li>"100%" Test Coverage</li>
</ul>
</article>
<article class='nobackground'>
<q>Don't tell Prof H, but we stopped writing tests because they took too long to run!</q>
</article>
<article>
<h3>Envelope 1.0 - Testing</h3>
<ul>
<li>188 Tests</li>
<li>8 Minute Unit Tests</li>
<li>"Create the Universe" for a single test</li>
<li><strike>Guard</strike></li>
<li>☹</li>
</ul>
<ul>
<li><strike>"100%" Test Coverage</strike></li>
<li>"73%" Test Coverage</li>
</ul>
</article>
<article>
<q>Let's Use JSON</q>
<div class='author'>
Seth Vargo (→)
</div>
</article>
<article>
<h1>Envelope 2.0</h1>
</article>
<article class='nobackground'>
<img class='centered' src='images/javascript.png' style='margin-top: 175px;'>
</article>
<article class='nobackground'>
<img class='centered' src='images/elasticsearch.png' style='margin-top: 215px;'>
</article>
<article class='nobackground'>
<img class='centered' src='images/mongo.png' style='margin-top: 175px;'>
</article>
<article class='nobackground'>
<img class='centered' src='images/sidekiq.png' style='margin-top: 175px;'>
</article>
<article>
<h3>Data Flow</h3>
<img class='centered' src='images/pre-json.png' style='margin-top: 15px;'>
</article>
<article>
<h3>Data Flow</h3>
<img class='centered' src='images/json.png' style='margin-top: 15px;'>
</article>
<article class='smaller'>
<h3>message.json</h3>
<pre>
{
"_id":"50b3f12fa3bbccf2b4000440",
"ancestry":null,
"ancestry_depth":0,
"created_at":"2012-11-26T22:46:07Z",
"flags":["notjunk", "seen"],
"full_html_part":null,
"full_text_part":null,
"html_part":"...",
"labels":[...],
"mailbox_id":"50b3f0d9a3bbcc6091000005",
"message_id":"50b3f01162c32_1161b3fe8bf482000769de@optic.wv.cc.cmu.edu.mail",
"participants":[...],
"raw":"...",
"timestamp":"2012-11-26T22:41:21+00:00",
"uid":7694,
"updated_at":"2012-11-27T00:40:57Z"
}</pre>
<div class='build'>
<h2>First-Class Citizen</h2>
</div>
</article>
<article>
<h1>Why?</h1>
<ul>
<li>No Data Transformations</li>
<li>Less Marshalling</li>
<li>Single Protocol</li>
<li>Easy Conversion to Ruby Hashes</li>
<li><strong>It's all JSON!</strong></li>
</ul>
</article>
<article>
<h3>Why Mongo?</h3>
<ul class='build'>
<li>JSON (BSON)</li>
<li>Fast Dumps</li>
<li>No Serialization</li>
<li>Iterative</li>
<li>No Migrations</li>
<li>Document Orientated</li>
<li>Natural Fit</li>
</ul>
</article>
<article>
<h3>Envelope 2.0 - Facts</h3>
<ul class='build'>
<li>6 Unique Collections</li>
<li>0 STI Tables</li>
<li>4 Relations</li>
<li>1 Collection/Query</li>
</ul>
<ul class='build'>
<li>~8 Seconds Loading 1000 Messages</li>
<li>~40 Seconds Loading 1000 Messages w/Attachments</li>
<li>2 Queries to Load Home Page</li>
<li>~0.81s Response Time</li>
<li>.13-.17 Database Load</li>
<li><strong>Runs on a Macbook Air!</strong></li>
</ul>
</article>
<article>
<h3>Envelope 2.0 - Testing</h3>
<ul class='build'>
<li>213 Tests</li>
<li>11 <strong>Second</strong> Unit Tests (How?)</li>
<li>Isolation and Idempotentency</li>
<li>Guard</li>
</ul>
</article>
<article>
<img src='images/tests.png' style='margin-top: 260px;'>
</article>
<article class='nobackground'>
<p class='vertical-align'>
<img src='https://secure.gravatar.com/avatar/d040c79f5965e2057678c43d4f475e5e?s=75'>
Dominic Cerminara (@domcerminara)
</p>
<p class='vertical-align'>
<img src='https://secure.gravatar.com/avatar/d177328660541ccf3f717ed98f07c208?s=75'>
Elizabeth Li (@elizabethtli)
</p>
<p class='vertical-align'>
<img src='https://secure.gravatar.com/avatar/87f282c6c2cdad13100dffe8c1daf77d?s=75'>
Seth Vargo (@sethvargo)
</p>
<p class='vertical-align'>
<img src='https://secure.gravatar.com/avatar/b9c97722623d36e42f6c7624bd6b4abc?s=75'>
Xun Wang (@xunniw)
</p>
<h2>getenvelope.com</h2>
</article>
<article class='biglogo'>
</article>
</section>
</body>
</html>