node.js가 웹 서버라고 말할 수 있습니까?
웹 프레임 워크와 웹 서버가 헷갈리는 것을 발견했습니다.
Apache is a web server.
Tornado is a web server written in Python.
Nginx is a web server written in C
Zend is a web framework in php
Flask/Bottle is a web framework in Python
RoR is a web framework written in Ruby
Express is a web framework written in JS under Node.JS
node.js가 웹 서버라고 말할 수 있습니까 ??? 웹 서버 / 프레임 워크가 너무 혼란 스럽습니다.
어떻게 든 node.js가 웹 프레임 워크가 아닌 웹 서버 (Express가 그렇습니다)라면, 왜 우리는 유용한 연습에서 전체 node.js를 Nginx 서버 위에 올려야할까요 ?? SO에 대한 질문
누가 도와 드릴까요 ???
전부
웹 서버
웹 서버는 인터넷을 통해 액세스 할 수있는 콘텐츠를 전달하는 데 도움이되는 하드웨어 (컴퓨터) 또는 소프트웨어 (컴퓨터 응용 프로그램)를 참조 할 수 있습니다. 1
웹 서버의 주요 기능은 요청시 웹 페이지를 클라이언트에 전달하는 것입니다. 이는 HTML 문서 및 이미지, 스타일 시트 및 스크립트와 같이 문서에 포함될 수있는 추가 콘텐츠의 전달을 의미합니다.
웹 서버는 인터넷에서 클라이언트 / 사용자에게 요청 / 페이지를 전달하기위한 기본입니다.
웹 프레임 워크
웹 애플리케이션 프레임 워크는 동적 웹 사이트, 웹 애플리케이션 및 웹 서비스의 개발을 지원하도록 설계된 소프트웨어 프레임 워크입니다. 프레임 워크는 웹 개발에서 수행되는 일반적인 활동과 관련된 오버 헤드를 줄이는 것을 목표로합니다. 예를 들어 많은 프레임 워크는 데이터베이스 액세스, 템플릿 프레임 워크 및 세션 관리를위한 라이브러리를 제공하며 종종 코드 재사용을 촉진합니다.
웹 프레임 워크는 웹 서버를 사용하여 클라이언트에 요청을 전달하지만 웹 서버는 아닙니다.
Node.js
Node.js는 빠르고 확장 가능한 네트워크 애플리케이션을 쉽게 빌드하기 위해 Chrome의 JavaScript 런타임에 구축 된 플랫폼입니다. Node.js는 이벤트 중심의 비 차단 I / O 모델을 사용하여 분산 장치에서 실행되는 데이터 집약적 인 실시간 애플리케이션에 완벽하고 가볍고 효율적입니다.
그러나 다시 CLI 앱을 만들 수도 있으므로 처음과 같이 브라우저에서가 아닌 Javascript 프로그래밍 언어 를 사용하여 서버 (컴퓨터)에서 실행할 자바 스크립트 프로그램을 작성하는 플랫폼으로 더보아야한다고 생각합니다 . 나는 당신이 그것을 볼 수 있다고 생각합니까 Javascript++
??
node.js의 첫 페이지에서 볼 수 있듯이 node.js로 웹 서버를 작성할 수도 있습니다. 처음에 Ryan은 프로젝트의 안정성 때문에 Nginx 를 node.js 앞에 놓을 수 있다고 말했습니다 . 이 프로젝트는 여전히 꽤 어리다. Nginx는 node.js가 충돌하는 동안 계속 실행되는 검증 된 웹 서버입니다. 그런 다음 다시 많은 사용자가 node.js를 사용합니다.
Node.js 는 런타임 환경 또는 런타임 엔진 이라고 말하고 싶습니다 .
아마도 지금까지 찾은 최고의 정의는 Rob Gravelle의 "An Intro to Node.js" 라는 제목의 기사에서 나왔습니다 .
Node.js는 서버 측 JavaScript를 사용하여 네트워크 애플리케이션을 빌드하기위한 부분 런타임 환경 및 부분 라이브러리입니다. Chrome의 JavaScript 런타임 엔진을 사용하여 브라우저 샌드 박스없이 직접 JS 코드를 실행합니다.
또한 PCMAG.COM 백과 사전은 "런타임 엔진"에 대한 다음 정의 를 제공합니다 .
특정 응용 프로그램이 컴퓨터에서 실행하는 데 의존하는 소프트웨어입니다. 응용 프로그램을 실행하려면 런타임 엔진이 컴퓨터에서 실행되고 있어야합니다. 응용 프로그램에 필요한 공통 루틴 및 기능을 제공하며 일반적으로 중간 중간 언어로 된 프로그램을 기계 언어로 변환합니다.
또한 "런타임 시스템"이라는 제목 의 Wikipedia 기사 는 다음과 같이 선언합니다.
런타임 시스템 (런타임 시스템, 런타임 환경 또는 런타임이라고도 함)은 언어가 컴파일 된 언어인지, 해석 된 언어인지, 포함 된 도메인 특정 언어인지 또는 API를 통해 호출되는지 여부에 관계없이 컴퓨터 언어의 기본 동작을 구현합니다. pthreads와 같습니다.
... 런타임 시스템은 화면에 텍스트를 그리거나 인터넷에 연결하는 등의 작업 동작을 구현할 수 있습니다. 또한 일반적으로 운영 체제에서 제공하는 서비스의 복잡성이나 변형을 숨기는 추상화 계층 역할을합니다.
음, Node.js와 같은 런타임 환경 (또는 소프트웨어 플랫폼)이 있습니까? JRE가 그러한 환경의 좋은 예라고 생각합니다. Node.js와 JRE-공통점이 많습니다. 이들은 모두 (일종의) 가상 머신, 클래스 라이브러리 및 CLI 애플리케이션을 포함한 다양한 유형의 애플리케이션을 구현하는 프레임 워크를 가지고 있습니다.
질문으로 돌아가서 Node.js가 웹 서버라고 말할 수 있습니까? "JRE"에 대한 "Node.js"를 변경하고 JRE가 웹 서버인지 대답 해 봅시다. 내 대답은 아니오 야.
우리가 말할 수있는 것은 Node.js가 웹 서버를 구현하는 데 사용할 수있는 런타임 환경이라는 것입니다. 글쎄요, 제 의견입니다.
노드가 웹 서버라고 말하는 것은 javacript가 브라우저 내에서만 실행될 수 있다고 말하는 것과 같습니다. 그렇게 말할 수 있지만 다른 많은 작업도 수행 할 수 있습니다.
NodeJS
- [자바 스크립트 런타임 환경 (Chrome v8 엔진) + 노드 라이브러리 / API]
- 웹 서버를 만들 수 있으며 응용 프로그램 서버로도 설명 할 수 있습니다.
표현하다
- 웹 프레임 워크 (nodejs의 웹 서버를 사용하여 파일 제공)
Nginx
- 웹 서버
프로덕션에서 대부분의 사람들은 노드 서버 앞에서 Nginx를 프록시 서버로 사용하여 정적 파일 및 캐싱, 라우팅 등과 같은 기타 다양한 요소를 제공합니다.
node.js를 HTTP 서버, WebSocket 서버 또는 사용자 정의 프로토콜 등으로 사용할 수있는 패키지를 사용하여 서버 프레임 워크로 분류합니다.
node.js 서버 앞에 nginx를 배치하는 이유는 서버 애플리케이션을 실행하는 여러 머신에서 HTTP로드 밸런싱 및 리버스 프록시를위한 것입니다.
Web server is something that serves its clients through internet over protocols and Web Framework is something like which we call as compiler. It consists of all the required libraries, syntax rules, etc.
And node.js is a framework!!
I think the problem is that the terminology of "web server" or "web application server" is dominated by the JEE world, and products, that are not as modularized as today's Javascript world of frameworks, which in turn can be combined more or less freely.
I see no reason why a technology, that can serve complex applications over the web, should not be called a web server, or web application server!
If you combine, let's say Nuxt as a frontend, with Feathers as a backend - you'll have a backend serving a REST API and a server-side rendered UI!
Of course, you could (mis)use that to serve static content - then I'd call it a web server, or you could use it to make and serve a full application - then I'd call it a web application server.
It's the combined features or qualities that sum up to serve a purpose - right? - Features like stability, scalability and such are IMHO something that will be added to those technologies, over time. For now, they're pretty new still.
No it's a runtime environment... so it is not a web server yet it does not need one to run. So probably this is why it could be confusing. It can run standalone without needing any webserver because it is a runtime itself but again it is not a webserver.
How I feel your pain !
Like many, I found it hard to get to the essence of Node.js because most people only write/talk about the part of Node that they find useful - and the part they find interesting is usually a secondary benefit of Node rather than its primary purpose. I must say that I think it's mad for people to say that Node is just a JavaScript runtime. Node's use of JavaScript - and its selection of the V8 runtime - are simply means to an end, the best tools for the problem that Node's developers wanted to solve.
Node's primary purpose was to make the management of user events in a web app more efficient. So Node is overwhelmingly used on the back end of a web app. Event management demands that something is listening at the server machine for these events. So a http server must be set up to route each event to its appropriate handler script. Node uses JavaScript for event handling because JavaScript has callback functions: this allows one task to be suspended until the result of a dependent task is returned. Not many other languages have this feature and those that do may not have as efficient an interpreter as Google's V8 runtime. Most web developers know JavaScript so there's no additional language learning with Node. What's more, having callback functions allows the putting of all user tasks on a single thread without having explicit blocking applied to tasks demanding access to the database or file system. And this is what leads to the superior executional efficiency of Node under heavy concurrent use - which was the primary purpose for its development.
To help Node users quickly write back end code, Node's developers also organized the NPM (Node Package Manager) repositary: this is an open source, user-driven set of script packages for various standard and custom functions. All Node projects allow importation of NPM packages into a project via the established npm install command.
User requests handled via Node will be things like register/login/logout/form field validation and various database queries needed by the web app will be sent to the Node port. Other types of user request, e.g. to display another webpage, download CSS/JS/images, etc, could be sent to Node also. But these are not normally be sent to the Node port but will continue to be sent by the browser to the default port(s) on the server machine where the web server will handle them.
So, in practice, Node is normally a server but one that only replaces some of the functions of the web server program. Other uses of Node simply exploit one or other of its features, e.g. the V8 engine. But these are really just by-product uses of Node.
참고URL : https://stackoverflow.com/questions/9462356/can-we-say-node-js-is-a-web-server
'Development Tip' 카테고리의 다른 글
데이터베이스 스키마 변경 후 LINQ to SQL 클래스를 업데이트하는 가장 좋은 방법 (0) | 2020.10.19 |
---|---|
Android에서 Simple HTTP 클라이언트를 어떻게 사용합니까? (0) | 2020.10.19 |
git pull --rebase와 git pull --ff-only의 차이점 (0) | 2020.10.19 |
Git이 더 현대적인 SHA를 사용하지 않는 이유는 무엇입니까? (0) | 2020.10.19 |
C 비 차단 키보드 입력 (0) | 2020.10.19 |