[Hello world]nodejs helloworld chaesuwon
Transcript of [Hello world]nodejs helloworld chaesuwon
![Page 1: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/1.jpg)
ⓒ 2012����������� ������������������ ����������� ������������������ ����������� ������������������ NHN����������� ������������������ CORPORATION
node.js����������� ������������������
채수원����������� ������������������
기술혁신센터/오픈퍼블리싱팀����������� ������������������
NHN����������� ������������������
Server����������� ������������������ Side����������� ������������������ Javascript����������� ������������������ ����������� ������������������
![Page 2: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/2.jpg)
- 오픈����������� ������������������ 퍼블리싱����������� ������������������ 팀/����������� ������������������ nForge����������� ������������������ 개발����������� ������������������
- OctoberSkyJs����������� ������������������ (aka����������� ������������������ nodejskr.org)����������� ������������������ 운영자����������� ������������������
- blog.doortts.com����������� ������������������
About����������� ������������������ me����������� ������������������
- ???����������� ������������������ (...?)����������� ������������������
node.js를����������� ������������������ 하게����������� ������������������ 된����������� ������������������ 계기����������� ������������������
![Page 3: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/3.jpg)
- node.js����������� ������������������ 가����������� ������������������ 뭔가?����������� ������������������
- 쓸만한가?����������� ������������������
- 경험담����������� ������������������
- 논란과����������� ������������������ 사례들����������� ������������������
발표에서����������� ������������������ 주고����������� ������������������ 싶은����������� ������������������ 것����������� ������������������
![Page 4: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/4.jpg)
Node.js
![Page 5: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/5.jpg)
5����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
Ryah����������� ������������������ Dahl����������� ������������������
![Page 6: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/6.jpg)
6����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" 2009.1
http://four.livejournal.com/943068.html����������� ������������������
![Page 7: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/7.jpg)
7����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" 2009.2
![Page 8: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/8.jpg)
8����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" 2009.5
![Page 9: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/9.jpg)
9����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" 2009.6
![Page 10: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/10.jpg)
10����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
3년 뒤…
![Page 11: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/11.jpg)
11����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" 10000개!
![Page 12: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/12.jpg)
12����������� ������������������ /����������� ������������������ Node.js����������� ������������������
node.js����������� ������������������ 학습에����������� ������������������ 대해����������� ������������������
" node.js " concepts " modules
" core module, file modules
" npm
" javascript
" v8
![Page 13: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/13.jpg)
13����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
그래서,����������� ������������������ Node.js는����������� ������������������ 무엇인가?����������� ������������������ http://blog.doortts.com/214����������� ������������������
![Page 14: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/14.jpg)
14����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
![Page 15: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/15.jpg)
15����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" 특징 " Single Threaded " Event Loop " Non blocking I/O
![Page 16: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/16.jpg)
16����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Benchmark����������� ������������������
![Page 17: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/17.jpg)
17����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Event����������� ������������������ Loop����������� ������������������ vs����������� ������������������ Thread����������� ������������������
![Page 18: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/18.jpg)
18����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" Simple Server var����������� ������������������ http����������� ������������������ =����������� ������������������ require('http');����������� ������������������ var����������� ������������������ PORT����������� ������������������ =����������� ������������������ 3000;����������� ������������������ ����������� ������������������ var����������� ������������������ server����������� ������������������ =����������� ������������������ http.createServer(function����������� ������������������ (req,����������� ������������������ res)����������� ������������������ {����������� ������������������ ����������� ������������������ ����������� ������������������ res.writeHead(200,����������� ������������������ {'Content-Type':����������� ������������������ 'text/plain'});����������� ������������������ ����������� ������������������ ����������� ������������������ res.end('Hello����������� ������������������ World\n');����������� ������������������ })����������� ������������������ ����������� ������������������ server.listen(PORT,����������� ������������������ '127.0.0.1');����������� ������������������ console.log('Server����������� ������������������ running����������� ������������������ at����������� ������������������ http://127.0.0.1:'+PORT);����������� ������������������
![Page 19: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/19.jpg)
19����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
=> blocking => Non-blocking
" Programming Style
![Page 20: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/20.jpg)
20����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" Design Goal " 어떤 함수도 I/O를 직접 수행해선 안 된다. " 디스크나 네트워크, 혹은 다른 프로세스로부터 정보를 받으려면 반드시 callback이 있어야 한다.
" 예) b = a(); <= non I/O a( function(b) { … });
![Page 21: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/21.jpg)
21����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" Design Goal " 단순한 라이선스
" MIT/BSD, openssl 만 apache alike 자체 라이선스
" 플랫폼 독립적이다 " 의존성이 적음
![Page 22: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/22.jpg)
22����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Node.js����������� ������������������
" Architecture
해설����������� ������������������ 문서����������� ������������������ 보기����������� ������������������ -����������� ������������������ http://blog.doortts.com/253����������� ������������������
![Page 23: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/23.jpg)
23����������� ������������������ /����������� ������������������ Node.js����������� ������������������
배운 점들
![Page 24: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/24.jpg)
24����������� ������������������ /����������� ������������������ Node.js����������� ������������������
장점����������� ������������������
" One unified Language
" javascript
" 극단적인 코드 재활용
" Server-side / front-end
" 다양한 모듈들이 이미 존재
![Page 25: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/25.jpg)
25����������� ������������������ /����������� ������������������ Node.js����������� ������������������
오해����������� ������������������
" 접근이 쉬운 쪽은?
" 서버사이드 개발자? 프론트앤드 개발자?
" 개발 생산성?
![Page 26: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/26.jpg)
26����������� ������������������ /����������� ������������������ Node.js����������� ������������������
어려운 점들����������� ������������������
" Javascript
" Language Spec " ECMA Script 3, 5
" Language defects " (0.1 + 0.2) == 0.3
" var n = [4, 8, 15, 16, 23, 42]
" n.sort()
" Closure와 scope처리
![Page 27: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/27.jpg)
27����������� ������������������ /����������� ������������������ Node.js����������� ������������������
어려운 점들����������� ������������������
" Node.js
" v 0.6.18 " 계속 변경 중
" 윈도우즈 환경 지원 부족
" 모듈의 춘추전국시대 " 어느 라인을 잡아야 하나..
![Page 28: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/28.jpg)
28����������� ������������������ /����������� ������������������ Node.js����������� ������������������
그럼에도����������� ������������������ 쓰는����������� ������������������ 이유는?����������� ������������������
" 극단적인 성능
" 다양한 모듈을 통한 손쉬운(?) 개발
" 많은 개발자들이 (미친듯이) 뛰어들고 있음
" 미래에 대한 준비
" 안드로이드/아이폰의 교훈
![Page 29: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/29.jpg)
29����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Usage����������� ������������������
" 언제 쓸까?
" 오픈소스를 이용할 수 있는 경우
" 수레바퀴 재발명을 안하겠다
" 어디에 쓰면 좋을까?
" CPU 집중적이지 않고 I/O 집중적인 업무
![Page 30: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/30.jpg)
30����������� ������������������ /����������� ������������������ Node.js����������� ������������������
논란����������� ������������������
" Single Thread
" Multi-core CPU
" CPU 집중적인 업무
" 출신이 무관이라…
" Vert.x
![Page 31: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/31.jpg)
31����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Q&A
![Page 32: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/32.jpg)
32����������� ������������������ /����������� ������������������ Node.js����������� ������������������
one more tip!
![Page 33: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/33.jpg)
33����������� ������������������ /����������� ������������������ Node.js����������� ������������������
Lessons����������� ������������������ Learned����������� ������������������
" 테스트를 반드시, 꼭 만들 것!
" see demo
" 콜백을 잘 가려 쓸 것!
" Use callback for I/O functions only
" Be careful ‘Timing Problems’
" Don’t use stupid ‘Blocking callback’ " 왜?
![Page 34: [Hello world]nodejs helloworld chaesuwon](https://reader034.fdocuments.us/reader034/viewer/2022042715/55a101741a28ab4b768b4571/html5/thumbnails/34.jpg)
34����������� ������������������ /����������� ������������������ Node.js����������� ������������������
사례 소개����������� ������������������
" 해외
" Linked-in - Mobile service
" Yahoo Cocktails " eBay ql.io
" Cloud9 IDE
" Projects, Applications, and Companies Using Node " https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-
Using-Node
" 국내
" ???