-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
935 lines (591 loc) · 17 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
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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css">
<title>here, have some node</title>
</head>
<body>
<textarea id="source">
layout: true
class: huge-title, inverse, center, middle
---
#so tell me again why we're not using node.js?
???
`P` for presenter mode.
`C` to open a cloned window.
Go S.L.O.W.
---
layout: false
class: middle
# jordan rousseau
## [@jvrousseau](http://twitter.com/jvrousseau)
### [rousseau.io](http://rousseau.io)
### [github.com/jvrousseau](http://github.com/jvrousseau)
![](img/jordan-fam.jpeg)
???
I write code and hang out with my family
---
layout: false
class: middle, center
![](img/doc-laura.jpg)
---
layout: false
class: middle
## [@weatherdectech](http://twitter.com/weatherdectech)
## founded in 2000
## 90+ employees and growing
## south research campus at ou
![Weather Decision Technologies](img/wdt_logo.png)
???
we build systems and applications for websites/enterprises/foriegn governemnts
---
#where do we use node in production?
- 3 full stack web applications
- 3 event driven applications
- 1 static image generator
- 2 high load apis
- 3 or 4 applications in the pipeline
???
Ecommerce Site, Consumer Weather Site, Enterprise User Portal
Connect to rabbitmq and dissimenate events (lightning, watch warning, wdt meteorologist alerts)
create a map with weather data
real-time lightning using cassandra running on elastic load balancer
package management api
---
layout: false
##what I will attempt to do
- explain how wdt (the web team) made the decision to node
- show off a quick prototype application
- go through some common problems
- show off some tools for running node in production
- show some tools that we use for ci/cd
- _not_ completely trash other languages
???
while it may seem i am trashing a language, this is what we found works for our company
There will always be a need for other languages, I will attempt to step through that fine line
---
layout: false
class: huge-title, inverse, center, middle
start a conversation
???
at least give it a chance
---
layout: false
class: center, middle
# caveat
![](img/cat.gif)
???
I'm here doing what I love to do and telling you about it.
I'm lucky enough to be doing this but I by no means am an expert at any of this
I am learning as I go
---
layout: false
class: middle
###_i bet on javascript a long time ago, and alas, like english — it’s everywhere._
-@ded
???
Dustin Diaz - JavaScript Design Patterns
As much as it's maligned, JavaScript is everywhere, and it will not go away for a long time.
You can either choose to give it up (like TJ in farewell node) and move over to another language, or embrace it and improve it
---
layout: false
class: huge-title, inverse, center, middle
i live in javascript
???
past 2 years the team has written javascript
we have legacy stuff to support, but javascript is where we are for the majority of the day
---
layout: false
class: center, middle
# actionscript
![](img/alice-facepalm.jpg)
???
prior to that the team wrote client-side actionscript
Just like any other language, it was serviceable, but now looking back on it, we held on for way too long
---
layout: false
class: huge-title, inverse, center, middle
what changed?
---
layout: false
class: center, middle
# flash is dead
![](img/pingpong.gif)
???
told this over and over, but i just didn't want to believe it
going back into a 'history' lesson for just a little bit
---
.left-column[
### apple
]
.right-column[
- hostile to flash on the web
- thoughts on flash (april 2010)
- no flash on apple devices
- flash no longer pre-installed with mac (october 2011)
]
---
.left-column[
### apple
### google
]
.right-column[
- incremental updates to javascript maps
- complete abandonment of flash maps
- javacsript api v3 released (june 2010)
- flash maps api deprecation (september 2011)
- charge for google maps usage (november 2011)
]
---
.left-column[
### apple
### google
### adobe
]
.right-column[
- slowly started to move away from flash for web development
- adobe max conference priorities (october 2011)
- flex put out to open source pasture -- not the good kind (november 2011)
- "_we will continue making significant contributions to open web technologies like webkit & jquery..._"
]
---
.left-column[
### apple
### google
### adobe
### html5
]
.right-column[
- marketing
- client requests
- marketing
- client requests
- buzzwords
- did i mention marketing?
]
???
So we started to develop in JavaScript.
TBH I hated it. The reason why? I was doing it wrong...
---
layout: false
class: center, middle
# self-preservation
![](img/raccoon.gif)
---
layout: false
class: huge-title, inverse, center, middle
what about server-side?
(pertaining to wdt)
???
content warning: i will be talking bad about languages, but this is how you have to make a decision
this is where the talk should have begun
---
.left-column[
### php
]
.right-column[
- legacy code kept from upgrading php versions
- frameworks are bloated
- when have you ever seen pretty php code?
- complex error reporting. no stack traces by default or for fatal errors.
- package management?
- best option: try to use zend framework
- when you work with php for 2+ years...you start to really hate it
- a good read [php: a fractal of bad design](http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/)
]
???
the entire team knows php, but a new framework would be a learning curve
project structure can turn to mush
new PHP is good...yes, but still a learning curve from old crappy php frameworks and code
---
.left-column[
### php
]
.right-column[
###_php is nothing but exceptions, and it is not okay when wrestling the language takes more effort than actually writing your program. my tools should not create net positive work for me to do._
-@eevee
]
---
.left-column[
### php
### python
]
.right-column[
- python 3 update is killing python
- pip is good, but only for python 2.x
- cost time/money to port applications + dependencies to python 3
- learning curve for creating apis from frameworks (flask)
- one more good read [python 3 is killing python](https://medium.com/@thezerobit/python-3-is-killing-python-5d2ad703365d)
]
???
team kind of knows python
other development teams use python a whole lot
new apis in python using flask
---
.left-column[
### php
### python
]
.right-column[
###_people either continue to write software in python 2 or they pick another language that did not shoot itself in the face._
-@thezerobit
]
???
Stephen A. Goss
---
.left-column[
### php
### python
### .net
]
.right-column[
- approaching zero .net knowledge
- abstraction to the real code
- company stack is lamp + py -- nearly impossible to add .net stack
- _...designed to tightly integrate with and seamlessly extend the microsoft stack in extremely powerful but ultimately incremental ways_
- another good read [ceo friday: why we don’t hire .net programmers](http://blog.expensify.com/2011/03/25/ceo-friday-why-we-dont-hire-net-programmers/)
]
???
i mention .net not because it was a real consideration for us, but because enterprises in OKC are completely married to it.
if you are building websites, do you really need ASP .net to write your APIs?
What is the limits? Are you staying because of preformance or comfort?
Do you throw massives amount of hardware at a load problem?
Entertaining piece RE: CEO Friday. They are hiring .net for windows application development
---
.left-column[
### php
### python
### .net
]
.right-column[
###_.net is designed to extend, not disrupt_
-@quinthar
]
???
David Barrett - CEO of expensify
]
---
.left-column[
### why no?
]
.right-column[
- any language has its problems
- highlighting only negative without context only fuels the fire language wars
- any language has its merits
- cost/benefit of language should always be calculated
- find out if the negatives will outweigh the positives of a specific language
- trolling other languages does not help
]
???
when you are trying to switch, how do you convince someone to not use the current language?
there is too much bullshit with developers trashing other languages
---
.left-column[
### why no?
### why yes?
]
.right-column[
- any change from widely used language to a new one needs to be explained
- there is _always_ a cost with changing core languages
- you will never convince anyone by saying, _but...but...company-y uses language-x_
- really understand why you and your team would want to switch to a new language
- considering return on investment and costs surrounding a learning curve (this will make management happy)
]
???
now lets talk about the positives...how do you talk up a language and convince someone to try it
attention would absolutely be lost by saying "but its a cool language"
developer enjoyment should be considered also. A happy developer is always more productive
---
.left-column[
### why no?
### why yes?
### why node?
]
.right-column[
- the node community is incredible - help is a tweet away/examples are everywhere
- package management is the best that's out there
- less context switching for developing both server and client-side
- dry application programming is almost forced upon you
- browserify reinforces the usability across server/client
- a web developer with zero node experience will acclimate herself/himself if she/he has known javascript from web development
]
???
joyent developer sites
DRY - don't repeat yourself
share code between front and back of a web application
---
.left-column[
### why no?
### why yes?
### why node?
]
.right-column[
###_2 new hires this week (diff teams in my org), got acclimated to code base and checked in first commit in < 4 hrs. in 2011 this took weeks._
-@billwscott
]
???
Bill Scott - PayPal
---
.left-column[
### why no?
### why yes?
### why node?
### how?
]
.right-column[
- get permission (or not) to build a prototype of a small portion of a legacy application
- make sure prototype is written well.
- show off prototype
- ???
- profit
]
???
This should show two things.
1) how fast a prototype can be built (with a small amount of code)
2) how fast and stable a nodejs application can be.
---
layout: false
class: middle
#nodejs.org example
```
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
```
---
layout: false
#prototype
- knex.js
- bookshelf.js
- hapi.js
- joi
- lout
???
knex will bootstrap the entire database and seed the database with sample data
bookshelf is an ORM we will use this to create all the models to our api
hapi is a server framework
- you might know this as the walmart framework. Handled all mobile traffic on black friday with a small amount of hardware
joi is a schema validation framework
lout is a hapi documentation generator
---
layout: false
class: center, middle
# demo time!!!
![](img/anna-excited.gif)
---
layout: false
class: center, middle
#code found here:
#[http://git.io/WJDa5Q](http://git.io/WJDa5Q)
---
layout: false
class: center, middle
# success!!!
![](img/babies-dance.jpg)
---
layout: false
class: center, middle
# success...
![](img/merida-ohno.gif)
???
when the rubber meets the road, you will need to push through the errors in development
don't be afraid of starting over
if you find something better...STOP...and use it (more cost up front, but return on investment will be HUGE)
---
layout: false
class: huge-title, inverse, center, middle
#problems
(they are going to happen)
???
don't let it discourage you
it's not nodes fault...it is most likely your understanding of node
don't question your decision on the issues you run into...deal with them and improve your code
first node app - huge bug with mysql connections...we had a connection leak...once max_connections hit....application was unresponsive
test database had a whole lot more max_connections and a shorter ttl...
---
layout: false
##common nodejs problems
- handling event loops/callback hell
- memory leaks
- handling errors
- maxing out cpu
- network i/o bounds
- database connections/queries
???
ugly code is not maintainable, and it's very easy to write ugly javascript code
what you write affects the server. you can take something down very quick with node just as much as you can with other languages
node is not a silver bullet
you can do stupid stuff in node
breaking servers will make you a better developer
monitor the shit out of your application!
---
#as a developer you will need to
- develop
- deploy
- handle scale
- monitor
- clean up your messes
- plus a whole lot more
???
prototyping anything can fall into production, so create well defined and well written prototypes
tools to help - node-load (for loadtesting)
- chrome dev tools (memory profiler)
- testing frameworks -- we use mocha
- test
- handle all sorts of errors, user/server/unrecoverable
- log as much as possible!
Your application should be able to handle a decent amount of load on its own.
load balancing and scaling with hardware might be necessary
---
layout: false
class: huge-title, inverse, center, middle
better application monitoring and deployment
---
layout: false
##node application deployment
- unlike php you can't drop files on an server with apache and you're good
- as close to 100% uptime as possible
- use the available cores of the machine
- have some good logging
- scriptable monitoring
- ```forever start app.js``` is not the greatest solution
???
forever was serviceable at the beginning
had to grow up and find something more robust
it's very important to really focus on how to have 0s downtime.
With forever with watch, you would still have blips
---
layout: false
class: huge-title, inverse, center, middle
#pm2
???
Karl Kirch did a lightning talk on this at OKCjs and SpringBeta after we started using this
---
layout: false
##pm2
- built-in load balancer (cluster module)
- script daemonization
- 0s downtime reload
- generate startup scripts
- pause or stop unstable processes easily
- monitor in console
- combined logging
---
layout: false
class: center, middle
# another demo!!!
![](img/demo-time.gif)
---
layout: false
class: huge-title, inverse, center, middle
ci/cd
???
This is true for any language, but you should really find ways to inject Continuous Integration/Deployment to your workflow
---
layout: false
##what do we use?
- grunt
- jenkins
- nexus
- npm-lite
???
There are plenty of other things you can use
---
layout: false
.left-column[
### grunt
]
.right-column[
- task runner
- build and minify javascript
- lint code
- automate all the things!
]
---
layout: false
.left-column[
### grunt
### jenkins
]
.right-column[
- building/testing software projects continuously
- on push to server, build
- deploy to server
- save to repo manager
]
---
layout: false
.left-column[
### grunt
### jenkins
### nexus
]
.right-column[
- repository manager
- artifact management
- can save a tarball
- npm install *tarball* works
- ```nexus-domain/service/local/artifact/maven/content?g=group-name&a=package-name&v=X.X.X&r=node-pkg&e=tgz```
]
---
layout: false
.left-column[
### grunt
### jenkins
### nexus
### npm-lite
]
.right-column[
- written by [@idevinclark](http://twitter.com/idevinclark)
- uses nexus api to shorten nexus artifact requests
- takes in semver ranges
- ```npm.wdtinc.com/project-name/X.X.X```
- first wdt application written in hapi.js
]
---
layout: false
#movement towards stable node environment and deployment
- from git clone/pull && forever start app.js to automated deployment
- testing with mocha/chai
- using orm to create a more robust and stable model
- migrate applications from express to hapi
- utilize npm-lite to take advantage of semver ranges
- use pm2 to load balance requests across cores on a server
???
you're probably not going to start out in this perfect world.
bite off small chunks and start building workflows to your company's need
lots of tools out there to help you out.
don't always pick the first tool you find!
---
layout: false
class: huge-title, inverse, center, middle
you don't have to know node
(just jump in)
???
if you know a little bit of javascript and want to build something in node, it's pretty staightforward
---
layout: false
class: middle
#questions?
##[jrousseau@wdtinc.com](mailto:jrousseau@wdtinc.com)
###[@jvrousseau](http://twitter.com/jvrousseau)
###slides: [rousseau.io/thunderplains-node](http://rousseau.io/thunderplains-node)
</textarea>
<script src="remark.min.js" type="text/javascript"></script>
<script type="text/javascript">
var hljs = remark.highlighter.engine;
</script>
<!--<script src="js/remark.language.js" type="text/javascript"></script>-->
<script type="text/javascript">
var slideshow = remark.create({
ratio: '4:3',
highlightStyle: 'tomorrow',
highlightLanguage: 'remark'
});
</script>
</body>
</html>