어디서 어디까지 정리를 해야할지 모르겠어서 방황하고 있습니다.

 

1. 일단 node.js란 무엇일까요.

요즘 많이 사용한다던데 어떤 카테고리에 드는 아이인지, 프레임웍인지 Ruby on rails같은 것인지 nginx같은 웹서버인지 헷갈리는데요. 일단 WEB, WAS를 얘기하면서 같이 등장하는 일이 많습니다. 인터넷 환경에서 서비스를 제공해주는 WEB-WAS와 비슷한 역할을 하는 javascript 언어를 사용할 수 있는 엔진이라고 보시면 될 것 같습니다.

 홈페이지에서 얘기하는 node.js의 정의는 아래와 같습니다.

"Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices."

 

2. 왜 굳이 만들게 되었나.

 웹페이지에서 사진을 업로드할 때 사진이 업로드되는 동안 사용자가 얼마나 업로드가 처리되고 있는지를 알려면 별도로 요청을 보내야 하고, 동일한 connection을 사용해서는 해당 요청은 업로드가 끝날 때까지는 처리되지 못합니다. IO가 필요한 요청을 보내면서 업로드가 얼마나 되고있는지와 같은 다른 요청을 함께 처리하고 싶다면 좀 더 쉬운 방법은 없을지, 여러 요청을 함께 처리할 수는 없을까를 고민하다가 만들게 되었다고 합니다. (http://siliconangle.com/blog/2013/04/01/the-birth-of-node-where-did-it-come-from-creator-ryan-dahl-shares-the-history/)

“Node was originally born out of this problem — how can you handle two things at the same time? Non-blocking sockets is one way. Node is more or less the idea, or exploring the idea: what if everything was non-blocking? What if you never waited for any IO to happen?”

 

3. 특징?

 위에서도 얘기한 것처럼  non-blocking, single thread을 기반으로 한 javascript 기반의 웹 서비스 용 엔진입니다.

 non-blocking을 사용하기 때문에 CPU를 크게 필요로 하지 않는 처리를 기존 WEB-WAS에 비해 빠르게 처리할 수 있습니다.

 기존의 WEB-WAS 시스템이 front-end에서 javascript, css, html 등을 사용하고 back-end(server-side)에서 java를 사용해 왔던 것에 비교해 front-end와 back-end 모두 javascript를 사용합니다. chrome의 V8 엔진을 javascript interpreter로 사용하고 있습니다.

 

4. References

  Groupon, Paypal, e-bay 등에서 사용하고 있습니다.