Di chuyển tệp nodejs

Nút. js tỏa sáng trong các ứng dụng web thời gian thực sử dụng công nghệ đẩy qua WebSocket. Các kết nối hai chiều, thời gian thực của nút—nơi mỗi máy khách và máy chủ có thể bắt đầu giao tiếp—cho phép trao đổi dữ liệu tự do hơn

Qua

Tomislav Capan

Tomislav là Kiến trúc sư giải pháp, nhà phát triển và tư vấn kỹ thuật được AWS chứng nhận với hơn 10 năm kinh nghiệm. Tomislav có bằng thạc sĩ về máy tính

ĐĂNG LẠI

ĐĂNG LẠI

Đọc bản tiếng Tây Ban Nha

Di chuyển tệp nodejs
của bài viết này do Isabella Rolz dịch

Ghi chú của biên tập viên. Phiên bản tiếng Anh của bài viết này đã được cập nhật vào ngày 10/03/2022 bởi nhóm biên tập của chúng tôi. Nó đã được sửa đổi để bao gồm các nguồn gần đây và phù hợp với các tiêu chuẩn biên tập hiện tại của chúng tôi

Sự phổ biến của JavaScript đã kéo theo rất nhiều thay đổi. Những điều chúng ta làm trên web ngày nay thật khó tưởng tượng chỉ vài năm trước

Trước khi chúng tôi tìm hiểu về Node. js (“Node”), hãy xem xét việc áp dụng JavaScript trên toàn bộ ngăn xếp để thống nhất ngôn ngữ và định dạng dữ liệu (JSON), sẽ tạo điều kiện thuận lợi cho việc sử dụng lại tài nguyên của nhà phát triển một cách tối ưu. Vì đây là một lợi ích của JavaScript hơn là Node. js cụ thể, chúng tôi sẽ không giải thích thêm

Với tất cả những ưu điểm của mình, Node. js đóng một vai trò quan trọng trong kho công nghệ của nhiều công ty nổi tiếng, những người phụ thuộc vào lợi ích độc đáo của nó. nút này. js giải quyết cách nhận ra những lợi thế này và lý do tại sao bạn có thể—hoặc có thể không—sử dụng Node. js

nút là gì. js?

Nút. js bao gồm công cụ JavaScript V8 của Google, lớp trừu tượng nền tảng libUV và thư viện cốt lõi được viết bằng JavaScript. Ngoài ra, Nút. js dựa trên ngăn xếp web mở (HTML, CSS và JS) và hoạt động trên cổng tiêu chuẩn 80

Nút. js cung cấp cho các nhà phát triển một công cụ toàn diện để làm việc trong mô hình I/O không chặn, hướng sự kiện. Ryan Dahl, người tạo ra Nút. js được “lấy cảm hứng từ các ứng dụng như Gmail” và—trong việc tạo Node. js—nhằm mục đích tạo các trang web thời gian thực với khả năng đẩy

Sau hơn 20 năm web không trạng thái dựa trên mô hình phản hồi yêu cầu không trạng thái, cuối cùng chúng ta cũng có các ứng dụng web với kết nối hai chiều, thời gian thực

Tại sao nên sử dụng nút. js?

Nút. js tỏa sáng trong các ứng dụng web thời gian thực sử dụng công nghệ đẩy qua WebSocket. Sau hơn 20 năm web không trạng thái dựa trên mô hình phản hồi yêu cầu không trạng thái, cuối cùng chúng ta cũng có các ứng dụng web với kết nối hai chiều, thời gian thực, trong đó cả máy khách và máy chủ đều có thể bắt đầu giao tiếp, cho phép chúng trao đổi dữ liệu tự do hơn. Điều này hoàn toàn trái ngược với mô hình phản hồi web điển hình, nơi khách hàng luôn bắt đầu giao tiếp

Người ta có thể lập luận rằng chúng ta đã có công nghệ này trong nhiều năm dưới dạng Flash và Java Applet. Tuy nhiên, trên thực tế, đó chỉ là những môi trường hộp cát sử dụng web làm giao thức vận chuyển để gửi đến máy khách. Ngoài ra, các Applet Flash và Java được chạy độc lập và thường hoạt động trên các cổng không chuẩn, có thể yêu cầu thêm quyền

Nút như thế nào. js Công việc?

Node thực sự tỏa sáng trong việc xây dựng các ứng dụng mạng nhanh, có khả năng mở rộng. Điều này là do khả năng xử lý một số lượng lớn các kết nối đồng thời với thông lượng cao

Nút. js sử dụng I/O không chặn, theo sự kiện để duy trì trọng lượng nhẹ và hiệu quả khi đối mặt với các ứng dụng thời gian thực sử dụng nhiều dữ liệu chạy trên các thiết bị phân tán

Nút. js là một nền tảng đáp ứng một nhu cầu cụ thể và hiểu điều này là vô cùng cần thiết. Ví dụ, bạn sẽ không sử dụng Node. js để thực hiện các hoạt động sử dụng nhiều CPU. Gần như tất cả các lợi thế của Node sẽ bị hủy bỏ nếu nó được sử dụng để tính toán nặng

Nút. js là một nền tảng đáp ứng nhu cầu cụ thể. Nó không phải là viên đạn bạc hay nền tảng sẽ thống trị thế giới phát triển web

tiếng riu ríu

Làm thế nào nút. js hoạt động bí mật thật thú vị. So với các kỹ thuật phục vụ web truyền thống trong đó mỗi kết nối (yêu cầu) tạo ra một luồng mới (chiếm RAM hệ thống và cuối cùng sử dụng tối đa dung lượng RAM có sẵn), Node. js hoạt động trên một luồng đơn, sử dụng lệnh gọi I/O không chặn. Điều này cho phép Node hỗ trợ hàng chục nghìn kết nối đồng thời được tổ chức trong vòng lặp sự kiện

Traditional vs. Node.js Server Thread

Theo bài viết năm 2011 của Michael Abernethy “Node là gì. js?”, lấy một chuỗi có bộ nhớ 2 MB đi kèm, chạy trên hệ thống có RAM 8 GB và cung cấp tối đa theo lý thuyết là 4.000 kết nối đồng thời. Thêm vào đó là chi phí chuyển đổi ngữ cảnh giữa các luồng và bạn sẽ có một kịch bản phổ biến trong các kỹ thuật phục vụ web truyền thống. Nút. js avoids all this, achieving high scalability levels

There is, of course, the question of sharing a single thread among all client requests, a potential pitfall of writing Node. js applications

First, heavy computation could choke up Node’s single thread and cause problems for all clients, as incoming requests are blocked until said computation is completed

Second, developers need to be vigilant and prevent exceptions from bubbling up to the core (top) Node. js event loop, as this would cause the Node. js instance to terminate, effectively crashing the program

To prevent the flow of exceptions, we pass errors back to the caller as callback parameters (instead of “throwing,” as we do in some other environments). If an unhandled exception manages to surface, we can use the Forever module or external tools such as upstart and monit and just upstart to monitor the Node. js process and perform the necessary recovery of a crashed instance. Note that these tools do not address the recovery of the current state of the user session

npm. The Node Package Manager

Built-in support for package management using npm is included in every Node. js installation. The idea behind npm modules is similar to that of Ruby Gems. Nó là một tập hợp các thành phần có sẵn công khai, có thể tái sử dụng, dễ dàng cài đặt thông qua kho lưu trữ trực tuyến, với quản lý phiên bản và phụ thuộc

npm Inc. shares a list of packaged modules that are also accessible via its npm CLI tool. The module ecosystem is open to all to publish their own module, which would be added to the npm repository

Some useful npm modules include

express, Express. js, or simply Express

A Sinatra-inspired web development framework for Node. js, and the de facto standard for the majority of Node. js applications

hapi

A modular and simple-to-use configuration-centric framework for building web and services applications

connect

An extensible HTTP server framework for Node. js, providing a collection of high performance plugins known as middleware; serves as a base foundation for Express

socket. io and sockjs

A server-side component of two common WebSocket components

pug (formerly Jade)

A templating engine inspired by HAML, a default in Express. js

mongodb and mongojs

MongoDB wrappers to provide the API for MongoDB object databases in Node. js

làm lại

Thư viện máy khách Redis

lodash, gạch dưới, lười biếng. js

Vành đai tiện ích JavaScript. Underscore bắt đầu trò chơi nhưng bị lật đổ bởi một trong hai đối tác của nó, chủ yếu là do lười biếng. js' hiệu suất tốt hơn và triển khai mô-đun

mãi mãi

Một tiện ích để đảm bảo rằng tập lệnh nút đã cho chạy liên tục; . js xử lý trong quá trình sản xuất khi đối mặt với bất kỳ lỗi không mong muốn nào

chim xanh

Triển khai Promise/A+ đầy đủ tính năng với hiệu suất đặc biệt tốt

khoảng khăc. js

Thư viện ngày JavaScript để phân tích cú pháp, xác thực, thao tác và định dạng ngày

Nơi sử dụng nút. js

Trò chuyện

Trò chuyện là một ứng dụng nhiều người dùng, thời gian thực điển hình—từ IRC (trước đây)—đến các triển khai hiện đại trong Node. js với WebSocket

Ứng dụng trò chuyện nhẹ, lưu lượng truy cập cao và sử dụng nhiều dữ liệu (nhưng khả năng xử lý/tính toán thấp). Nó chạy trên các thiết bị phân tán và là ví dụ điển hình cho Node. js

Đơn giản, nhưng bao gồm hầu hết các mô hình mà bạn sẽ sử dụng trong một Nút điển hình. js, trò chuyện là một trường hợp sử dụng tuyệt vời cho việc học

Hãy mô tả cách trò chuyện hoạt động. Giả sử chúng tôi có một phòng trò chuyện duy nhất nơi người dùng có thể trao đổi tin nhắn theo kiểu một-nhiều (thực tế là tất cả). Cũng giả sử có ba người dùng được kết nối với bảng tin của chúng tôi

Về phía máy chủ, một Express đơn giản. triển khai ứng dụng js

  1. Trình xử lý yêu cầu GET / phục vụ trang web chứa bảng tin và nút 'Gửi' để khởi tạo đầu vào tin nhắn mới và
  2. Máy chủ WebSocket lắng nghe các tin nhắn mới do máy khách WebSocket phát ra

Về phía khách hàng, chúng tôi có một trang HTML với một số trình xử lý được thiết lập

  1. Trình xử lý cho sự kiện nhấp vào nút 'Gửi', nhận thông báo đầu vào và gửi nó xuống WebSocket
  2. Trình xử lý lắng nghe các tin nhắn đến mới trên máy khách WebSocket (i. e. , thông báo do người dùng tạo mà máy chủ muốn máy khách hiển thị)

Khi một khách hàng đăng một tin nhắn, đây là những gì sẽ xảy ra

  1. Trình duyệt bắt nút 'Gửi' khi nhấp qua trình xử lý JavaScript. Nó chọn giá trị từ trường đầu vào (i. e. , văn bản tin nhắn) và phát ra một tin nhắn WebSocket bằng ứng dụng khách WebSocket được kết nối với máy chủ của chúng tôi (được khởi tạo khi khởi tạo trang web)
  2. Thành phần phía máy chủ của kết nối WebSocket nhận tin nhắn và chuyển tiếp nó tới tất cả các máy khách được kết nối khác, sử dụng phương thức quảng bá
  3. Tất cả máy khách nhận được tin nhắn mới dưới dạng tin nhắn đẩy, thông qua thành phần phía máy khách WebSocket chạy trong trang web. Sau đó, khách hàng chọn nội dung tin nhắn và cập nhật trang web tại chỗ, bằng cách thêm tin nhắn mới vào bảng
Client and Server WebSockets in a Node.js Application

Đây là một ví dụ đơn giản về trò chuyện thời gian thực với NodeJS, Socket. io và ExpressJS

Để có giải pháp hiệu quả hơn, bạn có thể sử dụng bộ đệm đơn giản dựa trên cửa hàng Redis. Hoặc trong một giải pháp nâng cao hơn nữa, hãy sử dụng hàng đợi tin nhắn để xử lý việc định tuyến tin nhắn đến máy khách và cơ chế phân phối mạnh mẽ hơn. Hàng đợi có thể bao gồm mất kết nối tạm thời hoặc lưu trữ tin nhắn cho khách hàng đã đăng ký khi họ ngoại tuyến

Bất kể giải pháp bạn chọn là gì, Node. js hoạt động theo các nguyên tắc cơ bản giống nhau. phản ứng với các sự kiện, xử lý nhiều kết nối đồng thời và duy trì tính trôi chảy trong trải nghiệm người dùng

API trên đầu DB đối tượng

Nút. js là sự phù hợp tự nhiên để hiển thị dữ liệu từ các DB đối tượng (e. g. , MongoDB). Dữ liệu được lưu trữ JSON cho phép Node. js hoạt động mà không có trở kháng không phù hợp và chuyển đổi dữ liệu

Chẳng hạn, nếu bạn đang sử dụng Rails, bạn sẽ chuyển đổi từ JSON sang mô hình nhị phân, sau đó hiển thị chúng trở lại dưới dạng JSON qua HTTP khi dữ liệu được sử dụng bởi Backbone. js, góc cạnh. js, v.v. —hoặc thậm chí các cuộc gọi jQuery AJAX đơn giản. với nút. js, bạn có thể hiển thị các đối tượng JSON bằng API REST để máy khách sử dụng

Nếu bạn đang sử dụng MongoDB, bạn không cần lo lắng về việc chuyển đổi giữa JSON và bất kỳ thứ gì khác khi đọc hoặc ghi từ cơ sở dữ liệu. Do đó, bạn có thể tránh nhu cầu chuyển đổi nhiều lần bằng cách sử dụng định dạng tuần tự hóa dữ liệu thống nhất trên máy khách, máy chủ và cơ sở dữ liệu

Đầu vào xếp hàng

Nút cho phép bạn linh hoạt đẩy việc xóa sổ cơ sở dữ liệu sang một bên. Nhưng thậm chí còn có nhiều lý do hơn để sử dụng Node. js

Nếu bạn đang nhận một lượng lớn dữ liệu đồng thời, cơ sở dữ liệu của bạn có thể trở thành nút cổ chai. Nút. js có thể dễ dàng xử lý các kết nối đồng thời. Bởi vì—trong trường hợp này—việc truy cập cơ sở dữ liệu là một thao tác ngăn chặn, nên chúng tôi gặp rắc rối. Giải pháp là thừa nhận hành vi của khách hàng trước khi dữ liệu thực sự được ghi vào cơ sở dữ liệu

Cách tiếp cận này cho phép hệ thống duy trì khả năng phản hồi khi tải nặng. Tính năng này đặc biệt hữu ích khi khách hàng không yêu cầu xác nhận chắc chắn về việc ghi dữ liệu thành công, khi ghi nhật ký hoặc ghi dữ liệu theo dõi người dùng, được xử lý theo lô, để sử dụng sau này hoặc cho các hoạt động không cần thiết

Dữ liệu được xếp hàng đợi thông qua một số loại bộ nhớ đệm hoặc cơ sở hạ tầng xếp hàng tin nhắn như RabbitMQ hoặc ZeroMQ. Sau đó, nó được tiêu hóa bởi một quy trình ghi hàng loạt cơ sở dữ liệu riêng biệt hoặc dịch vụ phụ trợ xử lý tính toán chuyên sâu, được viết trên một nền tảng hoạt động tốt hơn cho tác vụ như vậy

Database Batch-write in Node.js With Message Queuing.

Nói ngắn gọn. Với Node, bạn có thể đẩy việc ghi cơ sở dữ liệu sang một bên để xử lý sau

Truyền dữ liệu

Tại sao không sử dụng Nút. js trong truyền dữ liệu? . Chúng ta có thể sử dụng quan sát này để xây dựng một số Node thú vị. tính năng js

Ví dụ: chúng tôi có thể xử lý tệp trong khi chúng vẫn đang được tải lên. Khi dữ liệu đến qua một luồng, chúng tôi có thể xử lý dữ liệu song song trong quá trình tải lên đó. Điều này đúng với mã hóa âm thanh hoặc video thời gian thực và ủy quyền giữa các nguồn dữ liệu khác nhau

Ủy quyền

Nút. js dễ dàng được sử dụng làm proxy phía máy chủ, nơi nó có thể xử lý một lượng lớn kết nối đồng thời theo cách không chặn. Nó hữu ích cho việc ủy ​​quyền các dịch vụ khác nhau với thời gian phản hồi khác nhau hoặc thu thập dữ liệu từ nhiều điểm nguồn

Ví dụ: hãy xem xét ứng dụng phía máy chủ giao tiếp với tài nguyên của bên thứ ba, lấy dữ liệu từ các nguồn khác nhau hoặc lưu trữ nội dung (như hình ảnh và video) vào dịch vụ đám mây của bên thứ ba

Sử dụng Nút thay cho máy chủ proxy chuyên dụng có thể hữu ích nếu cơ sở hạ tầng ủy quyền của bạn không tồn tại hoặc nếu bạn cần một giải pháp để phát triển cục bộ. Bằng cách này, ý tôi là bạn có thể xây dựng ứng dụng phía máy khách bằng Node. máy chủ phát triển js cho nội dung và yêu cầu ủy quyền/sơ khai API. Trong sản xuất, bạn sẽ xử lý các tương tác như vậy với dịch vụ proxy chuyên dụng (như nginx hoặc HAProxy)

Môi giới/Bảng điều khiển của nhà giao dịch chứng khoán

Ở cấp độ ứng dụng, phần mềm giao dịch của nhà môi giới là một ví dụ khác trong đó phần mềm máy tính chiếm ưu thế, nhưng có thể dễ dàng thay thế bằng giải pháp web thời gian thực. Phần mềm giao dịch của nhà môi giới theo dõi giá cổ phiếu, thực hiện tính toán và phân tích kỹ thuật, đồng thời hiển thị đồ thị và biểu đồ

Tại sao không sử dụng Nút. js để viết một giải pháp dựa trên web thời gian thực cho các nhà môi giới? . Chúng tôi có thể sớm gặp các nhà môi giới của mình trên bãi biển ở Florida hoặc Ibiza hoặc Bali

Bảng điều khiển giám sát ứng dụng

Hãy tưởng tượng bạn có thể phát triển doanh nghiệp của mình như thế nào nếu bạn có thể thấy khách truy cập của mình đang làm gì trong thời gian thực. Với ổ cắm hai chiều, thời gian thực của Node, bạn có thể đạt được khả năng này

Nút với WebSocket hoàn toàn phù hợp để theo dõi khách truy cập trang web và trực quan hóa các tương tác của họ trong thời gian thực

Lý do nên sử dụng Nút. js cho bảng điều khiển giám sát bao gồm thu thập số liệu thống kê theo thời gian thực từ người dùng hoặc giới thiệu các tương tác được nhắm mục tiêu với khách truy cập của bạn bằng cách mở kênh liên lạc tại một điểm cụ thể trong kênh của bạn. CANDDi sản xuất ý tưởng này

Bảng điều khiển giám sát hệ thống

Bây giờ, hãy đến thăm khía cạnh cơ sở hạ tầng của mọi thứ. Imagine, for example, a SaaS provider that wants to offer users a service monitoring page, like GitHub’s status page. với nút. js’s event-loop, we can create a powerful web-based dashboard that checks services’ statuses in an asynchronous manner, pushing data to clients using WebSocket

Both internal (intracompany) and public services’ statuses can be reported live and in real time using this technology. Push a little further and try to imagine a network operations center (NOC) that monitors the applications of a telecommunications operator, cloud/network/hosting provider, or some financial institution. The applications would run on the open web stack backed by Node. js and WebSocket

Đừng cố xây dựng các hệ thống thời gian thực cứng trong Node (tôi. e. , systems requiring consistent response times). Erlang is probably a better choice for that class of application

Nơi sử dụng nút. js, but Cautiously

Server-side Web Applications

với nút. js with Express. js, you can create classic web applications on the server side. While possible, this request-response paradigm in which Node. js would carry rendered HTML is not an ideal use case. There are arguments to be made for and against this approach. Here are some facts to consider

Pros

  • You can significantly ease the development of an application that does not require CPU-intensive computation, by using Javascript to build it top to bottom, even down to the database level—if you use JSON storage Object DB (e. g. , MongoDB)
  • Crawlers receive a fully rendered HTML response, which is far more SEO friendly than, say, a Single Page Application or a WebSocket app that runs on top of Node. js

Cons

  • Any CPU-intensive computation will block Node. js responsiveness, so a threaded platform is a better approach. Alternatively, you could try scaling out the computation
  • Using Node. js with a relational database can be painful. If you’re trying to perform relational operations, consider going with an environment such as Rails, Django, or ASP. Net MVC

An alternative to CPU-intensive computations is to create a highly scalable MQ-backed environment with back-end processing to keep Node as a front-facing “clerk” to handle client requests asynchronously

Where Not to Use Node. js

There are situations where Node may not be the best tool for the job

Server-side Web Application With a Relational Database Application

Ruby on Rails was once the clear choice as a tool to access relational databases like PostgreSQL, MySQL, and Microsoft SQL Server. This was because relational DB tools for Node. js were still in their early stages while, in contrast, Rails automatically provided data access setup right out of the box, together with DB schema migrations support tools, and other Gems (pun intended). Rails and its peer frameworks have mature and proven Active Record or Data Mapper data access layer implementations

It’s possible and not uncommon to use Node solely on the front end, while keeping your Rails back end with its easy access to a relational DB

But things have changed. Sequelize, TypeORM, and Bookshelf have come a long way toward becoming mature ORM solutions. It might also be worth checking out Join Monster if you’re looking to generate SQL from GraphQL queries

Heavy Server-side Computation and/or Processing

Node. js is not the best platform to handle heavy computation. No, you definitely don’t want to build a Fibonacci computation server in Node. js

In general, any CPU-intensive operation annuls all the throughput benefits Node offers with its event-driven, nonblocking I/O model. This is because incoming requests are blocked while the thread is occupied with your number-crunching—assuming you’re trying to run computations in the same Node instance used to respond to requests

Since Node. js is single-threaded and uses only a single CPU core, it would require considerable effort to develop a cluster module in order to deliver concurrency on a multicore server. Alternatively, you can run several Node. js server instances pretty easily behind a reverse proxy via nginx

With clustering, you should still offload all heavy computation to background processes. Ensure that you use an appropriate environment for the background processes, and that they communicate via a message queue server like RabbitMQ

While you may run background processes on the main server, this approach may not scale well once the load increases. You may distribute background processing services to separate worker servers without the need to configure the loads of front-facing web servers

With Node. js—as opposed to most other platforms—you enjoy that high reqs/sec throughput we talked about, as each request is a small task that Node handles quickly and efficiently

Why Choose Node. js?

We discussed Node. js from theory to practice, beginning with its purpose, and ending with its sweet spots and pitfalls

Problems with Node almost always originate from the fact that blocking operations are the root of all evil—and 99% of Node misuses are a direct consequence

In Node, blocking operations are the root of all evil—99% of Node misuses are a direct consequence

tiếng riu ríu

If your use case does not contain CPU-intensive operations, nor accesses blocking resources, you can exploit the benefits of Node. js and enjoy fast and scalable network applications. Welcome to the real-time web

Understanding the basics

What is Node. js?

Node. js is a server-side, open-source, JavaScript runtime environment. Node uses Google's V8 engine---libUV---to deliver cross-platform compatibility and a core library. Notably, Node. js does not expose a global window object, since it does not run within a browser

What is Node. js used for?

Because Node. js là một luồng, chúng tôi sử dụng nó chủ yếu cho các máy chủ hướng sự kiện, không chặn. We can also use Node. js for traditional websites and back-end API services, as it was designed with real-time, push-based architectures in mind

What is a web framework?

Web frameworks like Angular and React are libraries that help organize and generate the front-end code that runs in a web browser. Web frameworks reuse code for common operations, thereby reducing development time. Some web frameworks are full stack

Is Node. js a framework?

No, Node. js is an environment. Back-end frameworks run within Node. js. Popular, compatible frameworks include Express. js (also referred to as Express) for HTTP servers and Socket. IO for WebSocket servers

Is Node. js a programming language?

Node. js is not a programming language. The ". js" at the end of its name indicates that JavaScript is its associated programming language. Anything that can transpile to JavaScript---like TypeScript, Haxe, or CoffeeScript---can also be used with Node. js

Aside from its being highly effective, Node. js is popular because of its huge, active, open-source, JavaScript-based ecosystem

What is the difference between Node. js and Angular/AngularJS?

The Node. js runtime environment executes JavaScript code on the server, whereas Angular is a JavaScript framework that is executed on the client (i. e. , within a web browser)

Why is Node. js bad?

Node. js isn't bad. Its technology is widely used for many types of servers. However, because it’s single-threaded, Node. js is not ideal for web servers that double as computational servers---such heavy computation would block the server's responsiveness

Tags

JavaScriptI/ONode. js

Freelancer? Find your next job.

JavaScript Developer Jobs

View full profile

Tomislav Capan

Cloud Solution Architect and Lead Developer

Thông tin về các Tác giả

Tomislav is a software engineer, technical consultant, and solution architect who began as a technical partner for an online media business, growing it from zero to over 100,000 monthly readers. After years in software engineering, he now provides technical leadership through consulting and architecting dynamic, reliable, and scalable cloud solutions to support business growth and optimize complex architectures gone wrong. As an infrastructure lead, he makes the cloud a friendly place

Hire Tomislav

Comments

Anony Mouse

For relational DBs on Node, I like http. //bookshelfjs. tổ chức/

Anony Mouse

For relational DBs on Node, I like http. //bookshelfjs. tổ chức/

Adin Scannell

Awesome article. I definitely agree that node. js has some really perfectly suited use cases. However, I do want to comment on something that is a bit of a pet peeve of mine -- I wish you wouldn't contrast it with a non-existent straw-man "traditional" system in "how it works". 1) No server spawns a thread per request (they use thread pools or process pools). 2) Bạn nói "chi phí chuyển đổi ngữ cảnh" như thể nó chỉ áp dụng cho các chuỗi hệ điều hành. Các khung không gian người dùng cần được lưu và tải theo cùng một cách. Ngoài ra, hệ điều hành thực hiện điều đó với một vài hướng dẫn, tận dụng hỗ trợ chuyên biệt từ phần cứng - điều mà không gian người dùng không thể làm được. 3) Tương tự, luồng không gian người dùng (I. e. khung hoặc bao đóng nếu bạn không muốn nói về các luồng) lấy tài nguyên bộ nhớ giống như cách các luồng nhân thực hiện. Không phải mỗi luồng hệ thống đều được phân bổ giới hạn ngăn xếp đầy đủ, vì vậy đó là một phân tích không công bằng. Các hệ thống thông thường thường có hơn 4000 mà không đến gần nơi bạn đã chốt nó. 4) Vấn đề LỚN với đồng thời một luồng là thiếu tính song song. Chắc chắn, bạn có thể xử lý hàng nghìn yêu cầu mỗi giây, nhưng chỉ một CPU trên máy chủ 40 lõi của bạn sẽ thực hiện BẤT KỲ công việc nào. Dù sao đi nữa, tất cả những điều trên liên quan đến một đoạn khá nhỏ trong bài đăng xuất sắc của bạn. Nút không thực sự có lỗi về điều này, chỉ là có rất nhiều FUD xung quanh các luồng và quy trình mà mọi người thường sử dụng để biện minh cho các thiết kế điên rồ (và tránh các luồng khi chúng hoàn toàn là cách tiếp cận phù hợp cho phần lớn các tình huống)

Adin Scannell

Awesome article. I definitely agree that node. js has some really perfectly suited use cases. However, I do want to comment on something that is a bit of a pet peeve of mine -- I wish you wouldn't contrast it with a non-existent straw-man "traditional" system in "how it works". 1) No server spawns a thread per request (they use thread pools or process pools). 2) Bạn nói "chi phí chuyển đổi ngữ cảnh" như thể nó chỉ áp dụng cho các chuỗi hệ điều hành. Các khung không gian người dùng cần được lưu và tải theo cùng một cách. Ngoài ra, hệ điều hành thực hiện điều đó với một vài hướng dẫn, tận dụng hỗ trợ chuyên biệt từ phần cứng - điều mà không gian người dùng không thể làm được. 3) Tương tự, luồng không gian người dùng (I. e. khung hoặc bao đóng nếu bạn không muốn nói về các luồng) lấy tài nguyên bộ nhớ giống như cách các luồng nhân thực hiện. Không phải mỗi luồng hệ thống đều được phân bổ giới hạn ngăn xếp đầy đủ, vì vậy đó là một phân tích không công bằng. Các hệ thống thông thường thường có hơn 4000 mà không đến gần nơi bạn đã chốt nó. 4) Vấn đề LỚN với đồng thời một luồng là thiếu tính song song. Chắc chắn, bạn có thể xử lý hàng nghìn yêu cầu mỗi giây, nhưng chỉ một CPU trên máy chủ 40 lõi của bạn sẽ thực hiện BẤT KỲ công việc nào. Dù sao đi nữa, tất cả những điều trên liên quan đến một đoạn khá nhỏ trong bài đăng xuất sắc của bạn. Nút không thực sự có lỗi về điều này, chỉ là có rất nhiều FUD xung quanh các luồng và quy trình mà mọi người thường sử dụng để biện minh cho các thiết kế điên rồ (và tránh các luồng khi chúng hoàn toàn là cách tiếp cận phù hợp cho phần lớn các tình huống)

Eric Elliott

All your advice about computation heavy apps could not be more wrong. Chắc chắn rằng việc cố gắng tính toán nội tuyến nặng nề với chu kỳ phản hồi yêu cầu là một ý tưởng tồi, nhưng điều tương tự cũng có thể xảy ra với các môi trường luồng. Nếu bạn có các hoạt động bị ràng buộc bởi CPU, bạn nên xử lý chúng bằng worker process. JavaScript và đặc biệt là Node thực sự rất phù hợp để xử lý tính toán phân tán - đặc biệt là với sự hỗ trợ tốt cho lập trình kiểu chức năng. Nếu bạn viết thuật toán của mình bằng cách sử dụng các hàm thuần túy và phân phối khối lượng công việc cho nhân viên, bạn có thể dễ dàng phân phối khối lượng công việc của mình trên các cụm được nối mạng. Node's great support for networking makes it an ideal environment both for computing and orchestration tasks, and it's orders of magnitude faster than Ruby at both

Eric Elliott

All your advice about computation heavy apps could not be more wrong. Chắc chắn rằng việc cố gắng tính toán nội tuyến nặng nề với chu kỳ phản hồi yêu cầu là một ý tưởng tồi, nhưng điều tương tự cũng có thể xảy ra với các môi trường luồng. Nếu bạn có các hoạt động bị ràng buộc bởi CPU, bạn nên xử lý chúng bằng worker process. JavaScript và đặc biệt là Node thực sự rất phù hợp để xử lý tính toán phân tán - đặc biệt là với sự hỗ trợ tốt cho lập trình kiểu chức năng. Nếu bạn viết thuật toán của mình bằng cách sử dụng các hàm thuần túy và phân phối khối lượng công việc cho nhân viên, bạn có thể dễ dàng phân phối khối lượng công việc của mình trên các cụm được nối mạng. Node's great support for networking makes it an ideal environment both for computing and orchestration tasks, and it's orders of magnitude faster than Ruby at both

jim thomas

Rất hữu ích. Cảm ơn rất nhiều

jim thomas

Rất hữu ích. Cảm ơn rất nhiều

roland

Bạn chắc chắn không muốn chặn bất kỳ Node nào. js đang xử lý các yêu cầu của máy chủ, nhưng điều đó không có nghĩa là bạn không nên thực hiện các tính toán nặng nề đằng sau một Nút. máy chủ js. Miễn là quá trình thực hiện các tính toán nặng nề được sinh ra không đồng bộ từ quá trình máy chủ của bạn. Still you could end up blocking your Node. js process if you overdue it, but that is also true with the traditional threaded server

roland

Bạn chắc chắn không muốn chặn bất kỳ Node nào. js đang xử lý các yêu cầu của máy chủ, nhưng điều đó không có nghĩa là bạn không nên thực hiện các tính toán nặng nề đằng sau một Nút. máy chủ js. Miễn là quá trình thực hiện các tính toán nặng nề được sinh ra không đồng bộ từ quá trình máy chủ của bạn. Still you could end up blocking your Node. js process if you overdue it, but that is also true with the traditional threaded server

Danny Machal

This is going to make me out to be a giant noob but can you give me an example of a "blocking operation" ?

Danny Machal

This is going to make me out to be a giant noob but can you give me an example of a "blocking operation" ?

irneb

Any such hybrid system? I'm thinking. Use Node. js to process a request by simply placing it onto a to-process queue, return a message to the client stating something like "calculating. ". Then Node. js is free to continue with the next request. The to-process queue can then be run through using a difference thread (or even multiple threads). As and when these complete, they send their results to Node. js's queue which will then relay it back to the original client? Of course this means some ID key needs to accompany each item in this queue to ensure the correct data is returned to the correct client. Anything like this possible? Or even already implemented?

irneb

Any such hybrid system? I'm thinking. Use Node. js to process a request by simply placing it onto a to-process queue, return a message to the client stating something like "calculating. ". Then Node. js is free to continue with the next request. The to-process queue can then be run through using a difference thread (or even multiple threads). As and when these complete, they send their results to Node. js's queue which will then relay it back to the original client? Of course this means some ID key needs to accompany each item in this queue to ensure the correct data is returned to the correct client. Anything like this possible? Or even already implemented?

zivkovic_milan

Great article, thanks . )

zivkovic_milan

Great article, thanks . )

Gerd Jungbluth

Tomislav, thanks for this very well written and concise article. We 've been using MongoDB and Node. js (in combination with AngularJS for the user facing part) for > 2 years now and couldn't imagine to ever, ever, ever switch back to Flash (after 10 years of experience) or JEE / RDMS. So it boils down to just one programming language (JS), one data format (JSON) and one programming paradigma (Async), wow

Gerd Jungbluth

Tomislav, thanks for this very well written and concise article. We 've been using MongoDB and Node. js (in combination with AngularJS for the user facing part) for > 2 years now and couldn't imagine to ever, ever, ever switch back to Flash (after 10 years of experience) or JEE / RDMS. So it boils down to just one programming language (JS), one data format (JSON) and one programming paradigma (Async), wow

chad

That's by far the best explanation out there about Node. js. I finally understood that it is very useful (in certain scenarios) and not just a hype. Thanks a lot this was very informative

chad

That's by far the best explanation out there about Node. js. I finally understood that it is very useful (in certain scenarios) and not just a hype. Thanks a lot this was very informative

ellisgl

Node works well with relational databases, just don't use an ORM. SQL isn't that hard to learn. =)

ellisgl

Node works well with relational databases, just don't use an ORM. SQL isn't that hard to learn. =)

Tomislav Capan

True that, but I thought we as an industry got over the idea of writing all the SQL manually. Tools are good for common operations, tools that just get out of the way when needed to write some specifics manually, otherwise reducing the possibility of errors and security issues (that happens with more junior developers whether we want it or not)

Tomislav Capan

True that, but I thought we as an industry got over the idea of writing all the SQL manually. Tools are good for common operations, tools that just get out of the way when needed to write some specifics manually, otherwise reducing the possibility of errors and security issues (that happens with more junior developers whether we want it or not)

Tomislav Capan

Hi Adin, let me comment back 1) same scenario happens, there's a limitid amount of threads serving limited amount of clients. 2/3) Referenced presentation shows some measurements and numbers, you may be quite right on the internals but the common rough overview still stands as a general comparison of how things work between those two worlds. 4) parallelization options are also discussed within the article - as background worker processes, or several node processes behind a reverse proxy, or with Node clustering API (which is still in Experimental, but will be there eventually). Thanks for the great comments and the quality feedback on the article with that additional info, I appreciate it

Tomislav Capan

Hi Adin, let me comment back 1) same scenario happens, there's a limitid amount of threads serving limited amount of clients. 2/3) Referenced presentation shows some measurements and numbers, you may be quite right on the internals but the common rough overview still stands as a general comparison of how things work between those two worlds. 4) parallelization options are also discussed within the article - as background worker processes, or several node processes behind a reverse proxy, or with Node clustering API (which is still in Experimental, but will be there eventually). Thanks for the great comments and the quality feedback on the article with that additional info, I appreciate it

Tomislav Capan

Yes, you can have multiple worker processes, even communicating through Message Queue (MQ). Those workers can be separate Node processes (as node is single-threaded, unless you experiment with clustering API - I haven't tried yet as the API is very early and probably immmature), but can be any other language. I've worked on such a system which ran C# on Mono for background processing in a distributed CQRS architecture

Tomislav Capan

Yes, you can have multiple worker processes, even communicating through Message Queue (MQ). Those workers can be separate Node processes (as node is single-threaded, unless you experiment with clustering API - I haven't tried yet as the API is very early and probably immmature), but can be any other language. I've worked on such a system which ran C# on Mono for background processing in a distributed CQRS architecture

Tomislav Capan

Any calculation that keeps the CPU busy until the calculation is finished. Imagine some operation that requires 2 seconds to perform the calculation. Hit that with 100 clients - you get a 200-sec delay. Note the article I have referenced, which explains the blocking of the event loop. http. //zef. me/4561/node-js-and-the-case-of-the-blocked-event-loop

Tomislav Capan

Any calculation that keeps the CPU busy until the calculation is finished. Imagine some operation that requires 2 seconds to perform the calculation. Hit that with 100 clients - you get a 200-sec delay. Note the article I have referenced, which explains the blocking of the event loop. http. //zef. me/4561/node-js-and-the-case-of-the-blocked-event-loop

Tomislav Capan

Yes, that falls under the idea of having 'backend worker processes' in a distributed system. As the system is distributed, those workers can use any language/platform, including Node

Tomislav Capan

Yes, that falls under the idea of having 'backend worker processes' in a distributed system. As the system is distributed, those workers can use any language/platform, including Node

Tomislav Capan

Thanks for your feedback. I agree on that completely, for worker processes you could use JS when it fits, and that implies Node. js as that's what runs JS on the server, but you can also use other languages that do the particular work at hand fast

Tomislav Capan

Thanks for your feedback. I agree on that completely, for worker processes you could use JS when it fits, and that implies Node. js as that's what runs JS on the server, but you can also use other languages that do the particular work at hand fast

ellisgl

For ORMs in general, I just see them as a tool that can get something done quick for a newbie, but end up really gumming up the works later on. The closest thing I use for an ORM is a PDO wrapper (which I borrowed and rewrote from an old co-worker), that helps with writing PDO statements. https. //github. com/ellisgl/GeekLab-XPDO

ellisgl

For ORMs in general, I just see them as a tool that can get something done quick for a newbie, but end up really gumming up the works later on. The closest thing I use for an ORM is a PDO wrapper (which I borrowed and rewrote from an old co-worker), that helps with writing PDO statements. https. //github. com/ellisgl/GeekLab-XPDO

Adin Scannell

Lời xin lỗi cho bức tường của văn bản. Excellent discussion. 1) Agreed. But threads and processes are powerful tools. That's why a hybrid of threads/processes and event systems typically does best in the real world. Like the much beloved nginx . ) 2/3) Sorry, I may not have been clear. When I said FUD regarding threads and processes, I *meant the referenced presentation*. It's just a bunch of specifically tailored microbenchmarks designed to prove a certain point. (Which is fair, given that it's a lightning fair and can be a bit polemic. In fact, it's a great talk. But these synthetic micro-benchmarks are not the basis for a fair and through comparison. ) To say the difference between nginx and apache benchmarks is purely because of context switching is an extreme oversimplification. Nginx is specifically designed to serve HTTP requests really, really quickly in common circumstances (IMO generally by a tight coupling with the latest OS event systems, etc. ). You could specifically measure the overhead of context switching, and I would wager it's trivial. 4) But then aren't you at the mercy of the horrible "process overhead" the referenced presentation talks about -- can't have it both ways . ) (To be clear, my position using threads/processes or whatever is not in and of itself a problem. There are way more important design factors there, the OS overhead of those entities is pretty trivial. Hence I hate it when people adopt a silly design based on the idea thread-are-bad or processes-are-bad or some other such nonesense)

Adin Scannell

Lời xin lỗi cho bức tường của văn bản. Excellent discussion. 1) Agreed. But threads and processes are powerful tools. That's why a hybrid of threads/processes and event systems typically does best in the real world. Like the much beloved nginx . ) 2/3) Sorry, I may not have been clear. When I said FUD regarding threads and processes, I *meant the referenced presentation*. It's just a bunch of specifically tailored microbenchmarks designed to prove a certain point. (Which is fair, given that it's a lightning fair and can be a bit polemic. In fact, it's a great talk. But these synthetic micro-benchmarks are not the basis for a fair and through comparison. ) To say the difference between nginx and apache benchmarks is purely because of context switching is an extreme oversimplification. Nginx is specifically designed to serve HTTP requests really, really quickly in common circumstances (IMO generally by a tight coupling with the latest OS event systems, etc. ). You could specifically measure the overhead of context switching, and I would wager it's trivial. 4) But then aren't you at the mercy of the horrible "process overhead" the referenced presentation talks about -- can't have it both ways . ) (To be clear, my position using threads/processes or whatever is not in and of itself a problem. There are way more important design factors there, the OS overhead of those entities is pretty trivial. Hence I hate it when people adopt a silly design based on the idea thread-are-bad or processes-are-bad or some other such nonesense)

Tomislav Capan

Everything always needs to be put in the right context. I have presented possible situations, to analyze each one deeply I'd need a book . -) Still, I really appreciate your comments and insights, they are valuable addition to the article. Thank you for those

Tomislav Capan

Everything always needs to be put in the right context. I have presented possible situations, to analyze each one deeply I'd need a book . -) Still, I really appreciate your comments and insights, they are valuable addition to the article. Thank you for those

Aaron Wang

When use node. js as api server, and the back-end db is the bottleneck, if the clients are the other applications, not user interface, can we just let these client requests hang there waiting for db operation complete(sine node. js can handle massive concurrent connections easily)? Is a MQ necessary in this scenario? In my opinion, node. js is right the queue

Aaron Wang

When use node. js as api server, and the back-end db is the bottleneck, if the clients are the other applications, not user interface, can we just let these client requests hang there waiting for db operation complete(sine node. js can handle massive concurrent connections easily)? Is a MQ necessary in this scenario? In my opinion, node. js is right the queue

Ethan

ORM does not exist to make query languages "easier", it's a tool used to encapsulate database concerns, isolating them from the application. There are several benefits, but ultimately, it makes applications easier to test and maintain years down the road. Excuse the tangent, nothing to do with node

Ethan

ORM does not exist to make query languages "easier", it's a tool used to encapsulate database concerns, isolating them from the application. There are several benefits, but ultimately, it makes applications easier to test and maintain years down the road. Excuse the tangent, nothing to do with node

Eric Elliott

Yes, you could, but Ruby would be a poor choice if your aim is performance. =)

Eric Elliott

Yes, you could, but Ruby would be a poor choice if your aim is performance. =)

Vedran

thank you for a great article. By using the node. js child process http. //nodejs. org/api/child_process. html - would you be able to overcome the high computational blocking Fibonacci issue?

Vedran

thank you for a great article. By using the node. js child process http. //nodejs. org/api/child_process. html - would you be able to overcome the high computational blocking Fibonacci issue?

nene odonkor

any real life examples?

nene odonkor

any real life examples?

nene odonkor

What of the Facebook example you used. When a user clicks on the like button there is an immediate acknowledgement but the data is written later. Cant that be an example of node used with relational db? Anyway what makes up the message queue?

nene odonkor

What of the Facebook example you used. When a user clicks on the like button there is an immediate acknowledgement but the data is written later. Cant that be an example of node used with relational db? Anyway what makes up the message queue?

Moch Lutfi

Maybe go-lang is alternative choice. . )

Moch Lutfi

Maybe go-lang is alternative choice. . )

Anthony Hildoer

This article is great, except for the part where it says don't use NodeJS for computation because it doesn't have threads. Since when do we need threads? Run child processes. The only advantage to running threads over child processes is shared memory. Last time I checked, any system large enough for this entire debate to be relevant anyway is going to span multiple servers anyway, their by nullifying any benefit of threads. So, get it out of your head that NodeJS can't do CPU intensive work. And, if you can't, contact BlueRival. com, and we can fix all the stuff you built wrong with NodeJS

Anthony Hildoer

This article is great, except for the part where it says don't use NodeJS for computation because it doesn't have threads. Since when do we need threads? Run child processes. The only advantage to running threads over child processes is shared memory. Last time I checked, any system large enough for this entire debate to be relevant anyway is going to span multiple servers anyway, their by nullifying any benefit of threads. So, get it out of your head that NodeJS can't do CPU intensive work. And, if you can't, contact BlueRival. com, and we can fix all the stuff you built wrong with NodeJS

RiggerTheGeek

One application that few people use, but could be really fanastic, is using NodeJS to build a desktop application. There's plenty of packages out there - personally, I favour Node-Webkit https. //github. com/rogerwang/node-webkit

RiggerTheGeek

One application that few people use, but could be really fanastic, is using NodeJS to build a desktop application. There's plenty of packages out there - personally, I favour Node-Webkit https. //github. com/rogerwang/node-webkit

hfuti

Hi, nice article. Tuy nhiên tôi muốn chỉ ra một điều, NodeJS không chạy trong một luồng đơn lẻ. Lập trình viên không phải sinh ra các luồng mới, chúng được xử lý bởi chính nút trên cơ sở sự kiện. NodeJS được tạo sự kiện, mỗi lệnh gọi hàm cho mỗi sự kiện sẽ chạy trong một luồng riêng biệt. Cách tiếp cận đó khuyến khích viết các chức năng nhẹ hơn. Nếu chức năng của bạn thực hiện nhiều tính toán, hãy phân tích nó thành các chức năng nhỏ hơn và tất cả chúng sẽ chạy trong các luồng riêng biệt. Hãy nghĩ về ví dụ nơi bạn xử lý tệp trong khi phát trực tuyến. Điều đó là có thể nhờ chủ đề

hfuti

Hi, nice article. Tuy nhiên tôi muốn chỉ ra một điều, NodeJS không chạy trong một luồng đơn lẻ. Lập trình viên không phải sinh ra các luồng mới, chúng được xử lý bởi chính nút trên cơ sở sự kiện. NodeJS được tạo sự kiện, mỗi lệnh gọi hàm cho mỗi sự kiện sẽ chạy trong một luồng riêng biệt. Cách tiếp cận đó khuyến khích viết các chức năng nhẹ hơn. Nếu chức năng của bạn thực hiện nhiều tính toán, hãy phân tích nó thành các chức năng nhỏ hơn và tất cả chúng sẽ chạy trong các luồng riêng biệt. Hãy nghĩ về ví dụ nơi bạn xử lý tệp trong khi phát trực tuyến. Điều đó là có thể nhờ chủ đề

Matthew Keas

Điều này được viết rất tốt. Cảm ơn vì điều này

Matthew Keas

Điều này được viết rất tốt. Cảm ơn vì điều này

Matti Schneider

> The technique used to avoid exceptions bubbling up to the surface is passing errors back to the caller as callback parameters Excuse me, but that seems misled. Theo hiểu biết của tôi, [“Gọi lại kiểu nút”](http. // nút hướng dẫn. com/phong cách. html#callbacks) (tôi. e. mô hình chuyển lỗi dưới dạng tham số đầu tiên cho lệnh gọi lại) là tác dụng phụ của hàng đợi sự kiện (trả lại quyền kiểm soát càng sớm càng tốt để cho phép “đồng thời”) thay vì thiết kế để tránh làm gián đoạn luồng. Thực tế là các ngoại lệ không bong bóng thực sự thường là một nguồn gây ra lỗi, đặc biệt là đối với những người mới

Matti Schneider

> The technique used to avoid exceptions bubbling up to the surface is passing errors back to the caller as callback parameters Excuse me, but that seems misled. Theo hiểu biết của tôi, [“Gọi lại kiểu nút”](http. // nút hướng dẫn. com/phong cách. html#callbacks) (tôi. e. mô hình chuyển lỗi dưới dạng tham số đầu tiên cho lệnh gọi lại) là tác dụng phụ của hàng đợi sự kiện (trả lại quyền kiểm soát càng sớm càng tốt để cho phép “đồng thời”) thay vì thiết kế để tránh làm gián đoạn luồng. Thực tế là các ngoại lệ không bong bóng thực sự thường là một nguồn gây ra lỗi, đặc biệt là đối với những người mới

kyoukhana

Bài báo tuyệt vời. Tự hỏi ai đã tạo ra những sơ đồ đẹp. )

kyoukhana

Bài báo tuyệt vời. Tự hỏi ai đã tạo ra những sơ đồ đẹp. )

TZ

Bài báo tuyệt vời, cảm ơn. ) BTW, bạn sử dụng công cụ nào để vẽ hình ảnh?

TZ

Bài báo tuyệt vời, cảm ơn. ) BTW, bạn sử dụng công cụ nào để vẽ hình ảnh?

Matthew Keas

+1 cho điều đó

Matthew Keas

+1 cho điều đó

Matthew Keas

Đối với những người tò mò, có vẻ như những hình ảnh được tạo ra bằng Adobe Photoshop CC. Tôi đã kiểm tra điều này bằng cách xem dữ liệu EXIF ​​của một trong những hình ảnh. http. //dữ liệu exif. com/ Kích thước tệp – 61 kB Loại tệp – PNG Loại MIME – hình ảnh/png Chiều rộng hình ảnh – 624 Chiều cao hình ảnh – Độ phân giải 600 X – Độ phân giải 72 Y – 72 Không gian màu – Chế độ màu sRGB – 3 Nén – Hướng lệch/phồng – Ngang ( . 5-c014 79. 151481, 2013/03/13-12. 09. 15 Công cụ tạo – Adobe Photoshop CC (Macintosh)

Matthew Keas

Đối với những người tò mò, có vẻ như những hình ảnh được tạo ra bằng Adobe Photoshop CC. Tôi đã kiểm tra điều này bằng cách xem dữ liệu EXIF ​​của một trong những hình ảnh. http. //dữ liệu exif. com/ Kích thước tệp – 61 kB Loại tệp – PNG Loại MIME – hình ảnh/png Chiều rộng hình ảnh – 624 Chiều cao hình ảnh – Độ phân giải 600 X – Độ phân giải 72 Y – 72 Không gian màu – Chế độ màu sRGB – 3 Nén – Hướng lệch/phồng – Ngang ( . 5-c014 79. 151481, 2013/03/13-12. 09. 15 Công cụ tạo – Adobe Photoshop CC (Macintosh)

Juan G. nuño

Ngoài ra, thực tế là javascript không thể kiểm tra tính tuân thủ của loại gây khó khăn trong việc tổ chức số lượng lớn các lập trình viên cập nhật cùng một lúc cùng một cơ sở mã

Juan G. nuño

Ngoài ra, thực tế là javascript không thể kiểm tra tính tuân thủ của loại gây khó khăn trong việc tổ chức số lượng lớn các lập trình viên cập nhật cùng một lúc cùng một cơ sở mã

Juan G. nuño

mmmm. không đồng ý, nếu bạn sử dụng đúng một ORM tốt (hãy xem các ORM trưởng thành), bạn cũng nhận được bộ đệm được phân phối của Cơ sở dữ liệu quan hệ cho phép bạn có hiệu suất cao hơn với cùng số tiền và khả năng mở rộng hơn của hệ thống của bạn. ORM không chỉ để giảm bớt cuộc sống cho người mới. Thật vô nghĩa khi sử dụng một hệ thống không chặn như nút. js, nếu cuối cùng bạn bị chặn tại Cơ sở dữ liệu của mình. Nhưng sử dụng ORM theo cách đó, không dành cho người mới

Juan G. nuño

mmmm. không đồng ý, nếu bạn sử dụng đúng một ORM tốt (hãy xem các ORM trưởng thành), bạn cũng nhận được bộ đệm được phân phối của Cơ sở dữ liệu quan hệ cho phép bạn có hiệu suất cao hơn với cùng số tiền và khả năng mở rộng hơn của hệ thống của bạn. ORM không chỉ để giảm bớt cuộc sống cho người mới. Thật vô nghĩa khi sử dụng một hệ thống không chặn như nút. js, nếu cuối cùng bạn bị chặn tại Cơ sở dữ liệu của mình. Nhưng sử dụng ORM theo cách đó, không dành cho người mới

thiên tài

Rất vui khi bạn đề cập, hầu hết mọi người không đề cập đến điều này

thiên tài

Rất vui khi bạn đề cập, hầu hết mọi người không đề cập đến điều này

Trình theo dõi1

Đối với vấn đề đó, vì bạn có thể thực hiện async shell cho ứng dụng bảng điều khiển, bạn có thể dễ dàng ghi nhân viên của mình vào, chẳng hạn như golang, sau đó sử dụng nhóm chung để giới hạn nhân viên cpu của bạn. từ đó, bạn có thể bao ra cho một công nhân hiệu quả hơn. Bạn cũng có thể làm điều đó cho JS chuyên sâu về CPU, tôi đã làm điều này cho mô-đun scrypt-js của mình (có các mô-đun nhị phân hoạt động hiệu quả hơn, nhưng tôi muốn một mô-đun không có phụ thuộc được biên dịch). Không khó để xếp hàng công việc cho các hệ thống khác và không có lý do gì không thể sử dụng nút để điều phối công việc nói trên

Trình theo dõi1

Đối với vấn đề đó, vì bạn có thể thực hiện async shell cho ứng dụng bảng điều khiển, bạn có thể dễ dàng ghi nhân viên của mình vào, chẳng hạn như golang, sau đó sử dụng nhóm chung để giới hạn nhân viên cpu của bạn. từ đó, bạn có thể bao ra cho một công nhân hiệu quả hơn. Bạn cũng có thể làm điều đó cho JS chuyên sâu về CPU, tôi đã làm điều này cho mô-đun scrypt-js của mình (có các mô-đun nhị phân hoạt động hiệu quả hơn, nhưng tôi muốn một mô-đun không có phụ thuộc được biên dịch). Không khó để xếp hàng công việc cho các hệ thống khác và không có lý do gì không thể sử dụng nút để điều phối công việc nói trên

Trình theo dõi1

Có thể *có thể* sử dụng một hệ thống trung gian như TypeScript, bạn cũng có thể sử dụng một kẻ nói dối (jshint) và thậm chí yêu cầu một mức độ kiểm tra để phát hành. Nhận phạm vi kiểm tra 100% nói chung là *rất* dễ dàng trong môi trường tập lệnh. Sẽ đề xuất xem xét Mocha, Chai và Proxyquire. Nếu bạn không viết bài kiểm tra đơn vị, kiểu an toàn thực sự không mang lại cho bạn nhiều

Trình theo dõi1

Có thể *có thể* sử dụng một hệ thống trung gian như TypeScript, bạn cũng có thể sử dụng một kẻ nói dối (jshint) và thậm chí yêu cầu một mức độ kiểm tra để phát hành. Nhận phạm vi kiểm tra 100% nói chung là *rất* dễ dàng trong môi trường tập lệnh. Sẽ đề xuất xem xét Mocha, Chai và Proxyquire. Nếu bạn không viết bài kiểm tra đơn vị, kiểu an toàn thực sự không mang lại cho bạn nhiều

Steve Naidamast

I am beginning to find Node. js khá thú vị. Tuy nhiên, mô hình mà nó dường như đang quảng bá hầu như không mới đối với CNTT. Trong thế giới truyền thông máy tính lớn, chúng tôi gọi những khả năng như vậy là "đăng nhập lại", trong đó một quy trình đơn lẻ có thể xử lý mức độ cao của các cuộc gọi đến nó. Microsoft đã triển khai các khả năng tương tự với cơ sở hạ tầng đối tượng Singleton của mình và tôi tưởng tượng thế giới Java đã thực hiện các triển khai tương tự. Thật kỳ lạ, khuyến nghị của Microsoft để tăng cường khả năng mở rộng trên các dây dẫn đến các dịch vụ phụ trợ là thúc đẩy cấu trúc đối tượng "Cuộc gọi đơn" hoặc một phiên bản đối tượng cho mỗi yêu cầu cuộc gọi. Do đó, lập luận được đưa ra cho Node. js thực sự trái với khuyến nghị của Microsoft; . Trong mọi trường hợp, với tư cách là một doanh nghiệp ASP. NET, tôi không chắc liệu tôi có tìm thấy bất kỳ cách sử dụng nào cho một Node hay không. js, mặc dù nhà thiết kế web của chúng tôi có thể. Một lưu ý khác, tôi muốn thêm ý kiến ​​​​của riêng mình về việc sử dụng ORM. ORM là công cụ tuyệt vời khi phải đối mặt với cấu trúc cơ sở dữ liệu hiện có so với yêu cầu của ứng dụng mới vì ORM có thể xử lý rất nhiều mã hóa lặp đi lặp lại thông thường thường thấy với bất kỳ ứng dụng cơ sở dữ liệu nào. Tuy nhiên, vì ORM là các lớp cấp cao nên chúng thường không phải là tùy chọn hiệu quả nhất để sử dụng đối với cơ sở dữ liệu trong khi truy cập trực tiếp thông qua các nhà cung cấp bản địa là. Trong nhiều khía cạnh, tốt hơn là thực hiện mã hóa lặp đi lặp lại để đạt hiệu quả hơn là áp dụng lớp tạm thời có trọng lượng nặng, chẳng hạn như ORM

Steve Naidamast

I am beginning to find Node. js khá thú vị. Tuy nhiên, mô hình mà nó dường như đang quảng bá hầu như không mới đối với CNTT. Trong thế giới truyền thông máy tính lớn, chúng tôi gọi những khả năng như vậy là "đăng nhập lại", trong đó một quy trình đơn lẻ có thể xử lý mức độ cao của các cuộc gọi đến nó. Microsoft đã triển khai các khả năng tương tự với cơ sở hạ tầng đối tượng Singleton của mình và tôi tưởng tượng thế giới Java đã thực hiện các triển khai tương tự. Thật kỳ lạ, khuyến nghị của Microsoft để tăng cường khả năng mở rộng trên các dây dẫn đến các dịch vụ phụ trợ là thúc đẩy cấu trúc đối tượng "Cuộc gọi đơn" hoặc một phiên bản đối tượng cho mỗi yêu cầu cuộc gọi. Do đó, lập luận được đưa ra cho Node. js thực sự trái với khuyến nghị của Microsoft; . Trong mọi trường hợp, với tư cách là một doanh nghiệp ASP. NET, tôi không chắc liệu tôi có tìm thấy bất kỳ cách sử dụng nào cho một Node hay không. js, mặc dù nhà thiết kế web của chúng tôi có thể. Một lưu ý khác, tôi muốn thêm ý kiến ​​​​của riêng mình về việc sử dụng ORM. ORM là công cụ tuyệt vời khi phải đối mặt với cấu trúc cơ sở dữ liệu hiện có so với yêu cầu của ứng dụng mới vì ORM có thể xử lý rất nhiều mã hóa lặp đi lặp lại thông thường thường thấy với bất kỳ ứng dụng cơ sở dữ liệu nào. Tuy nhiên, vì ORM là các lớp cấp cao nên chúng thường không phải là tùy chọn hiệu quả nhất để sử dụng đối với cơ sở dữ liệu trong khi truy cập trực tiếp thông qua các nhà cung cấp bản địa là. Trong nhiều khía cạnh, tốt hơn là thực hiện mã hóa lặp đi lặp lại để đạt hiệu quả hơn là áp dụng lớp tạm thời có trọng lượng nặng, chẳng hạn như ORM

openas

Quan sát rất thú vị. Tôi muốn ai đó giải thích thêm một chút về điều đó. I would like a more concrete example, like some piece of concrete code calling an async heavy-computational function, and someone explaining what happens if that is run in a multicore equipment. Chuỗi đang thu thập các yêu cầu http có bị chặn không?

openas

Quan sát rất thú vị. Tôi muốn ai đó giải thích thêm một chút về điều đó. I would like a more concrete example, like some piece of concrete code calling an async heavy-computational function, and someone explaining what happens if that is run in a multicore equipment. Chuỗi đang thu thập các yêu cầu http có bị chặn không?

Derrick Simpson

Node là một máy chủ web khủng khiếp. Ngay cả người sáng tạo cũng gợi ý rằng đây không phải là mục đích của Node và nó nên được tận dụng vì thế mạnh của nó. JavaScript "Mọi thứ", giống như các quy trình công nhân, thật lố bịch

Derrick Simpson

Node là một máy chủ web khủng khiếp. Ngay cả người sáng tạo cũng gợi ý rằng đây không phải là mục đích của Node và nó nên được tận dụng vì thế mạnh của nó. JavaScript "Mọi thứ", giống như các quy trình công nhân, thật lố bịch

Eric Elliott

Điều này thật là buồn cười. Nút được xây dựng với web là hạng nhất và nó vượt trội như một máy chủ web. Nó đang nhanh chóng thay thế Ruby và PHP trong nhiều tổ chức doanh nghiệp vì nó đã tăng hiệu suất ứng dụng một cách đáng kể (giảm thời gian tải trang, v.v. ) và năng suất của nhà phát triển

Eric Elliott

Điều này thật là buồn cười. Nút được xây dựng với web là hạng nhất và nó vượt trội như một máy chủ web. Nó đang nhanh chóng thay thế Ruby và PHP trong nhiều tổ chức doanh nghiệp vì nó đã tăng hiệu suất ứng dụng một cách đáng kể (giảm thời gian tải trang, v.v. ) và năng suất của nhà phát triển

jonpress

Trên thực tế, bạn có thể tạo các máy chủ đa luồng bằng Node. js để cung cấp hiệu suất ổn định hơn nhưng phải làm thêm nhiều việc (xem mô-đun cụm tích hợp và mô-đun child_ process). Tôi đã tạo một khung chạy trên nhiều lõi CPU và giải quyết được nhiều vấn đề được thảo luận trong bài đăng này. Kiểm tra nó ra. http. // nombo. io/

jonpress

Trên thực tế, bạn có thể tạo các máy chủ đa luồng bằng Node. js để cung cấp hiệu suất ổn định hơn nhưng phải làm thêm nhiều việc (xem mô-đun cụm tích hợp và mô-đun child_ process). Tôi đã tạo một khung chạy trên nhiều lõi CPU và giải quyết được nhiều vấn đề được thảo luận trong bài đăng này. Kiểm tra nó ra. http. // nombo. io/

Connor Leech

làm điều gì đó giống cầy mangut. js giải quyết vấn đề cơ sở dữ liệu quan hệ nút? . // mongoosejs. com/

Connor Leech

làm điều gì đó giống cầy mangut. js giải quyết vấn đề cơ sở dữ liệu quan hệ nút? . // mongoosejs. com/

Rob Tweed

Có - xem cách tiếp cận nhóm công nhân hàng đợi/phân nhánh trước được EWD áp dụng. js. http. //gradvs1. đường cổng. com/tải xuống/EWDjs. pdf Tóm tắt tại đây. http. //gradvs1. đường cổng. com/download/EWDjsMechanics. pdf

Rob Tweed

Có - xem cách tiếp cận nhóm công nhân hàng đợi/phân nhánh trước được EWD áp dụng. js. http. //gradvs1. đường cổng. com/tải xuống/EWDjs. pdf Tóm tắt tại đây. http. //gradvs1. đường cổng. com/download/EWDjsMechanics. pdf

keith

vâng, tôi cũng đã tự hỏi về nó. hình ảnh tuyệt vời + bài đăng tuyệt vời

keith

vâng, tôi cũng đã tự hỏi về nó. hình ảnh tuyệt vời + bài đăng tuyệt vời

Carlos Ballena

bài viết rất hữu ích

Carlos Ballena

bài viết rất hữu ích

Chúa Giêsu Nunez

npm cài đặt felixge/nút-mysql. Đó có thể là kho lưu trữ hữu ích nhất mà tôi từng thấy từ lâu

Chúa Giêsu Nunez

npm cài đặt felixge/nút-mysql. Đó có thể là kho lưu trữ hữu ích nhất mà tôi từng thấy từ lâu

Matthias Lienau

Nice article, indeed. Nhưng, @hfuti. disqus, bạn đã sai khi nói "NodeJS không chạy trong một luồng đơn lẻ. mỗi lời gọi hàm cho mỗi sự kiện sẽ chạy trong một chuỗi riêng biệt. " Theo như tôi hiểu, vòng lặp sự kiện chính của NodeJS sử dụng mã JS của bạn trên thực tế chạy trong một luồng đơn. Tất cả các tác vụ có khả năng chặn và/hoặc chạy dài hạn như I/O của đĩa được ủy quyền và thực thi bởi libuv như một phần của công cụ thời gian chạy nút tạo ra một số lượng *giới hạn* các luồng có sẵn dưới dạng nhóm luồng. Nói điều này, rõ ràng là luồng vòng lặp sự kiện chính không bị ảnh hưởng hoặc bị chặn bởi việc thực thi mã khác (lại không đồng bộ). Vì vậy, ví dụ: tệp I/O với chính mô-đun fs được triển khai theo cách không chặn - cuối cùng thì hệ điều hành/nhân cho phép hoạt động không chặn cũng tốt. Tất nhiên, các quy trình hoặc luồng nước ngoài luôn có thể được tạo ra bởi các mô-đun tùy chỉnh hoặc dịch vụ của bên thứ 3 (quy trình công nhân). Và vâng, có các dự án env thời gian chạy xử lý nhiều quy trình nút và luồng của chúng trên cùng một máy hoặc cụm cpu. Nhưng nó là một câu chuyện khác. Hãy sửa tôi nếu tôi sai

Matthias Lienau

Nice article, indeed. Nhưng, @hfuti. disqus, bạn đã sai khi nói "NodeJS không chạy trong một luồng đơn lẻ. mỗi lời gọi hàm cho mỗi sự kiện sẽ chạy trong một chuỗi riêng biệt. " Theo như tôi hiểu, vòng lặp sự kiện chính của NodeJS sử dụng mã JS của bạn trên thực tế chạy trong một luồng đơn. Tất cả các tác vụ có khả năng chặn và/hoặc chạy dài hạn như I/O của đĩa được ủy quyền và thực thi bởi libuv như một phần của công cụ thời gian chạy nút tạo ra một số lượng *giới hạn* các luồng có sẵn dưới dạng nhóm luồng. Nói điều này, rõ ràng là luồng vòng lặp sự kiện chính không bị ảnh hưởng hoặc bị chặn bởi việc thực thi mã khác (lại không đồng bộ). Vì vậy, ví dụ: tệp I/O với chính mô-đun fs được triển khai theo cách không chặn - cuối cùng thì hệ điều hành/nhân cho phép hoạt động không chặn cũng tốt. Tất nhiên, các quy trình hoặc luồng nước ngoài luôn có thể được tạo ra bởi các mô-đun tùy chỉnh hoặc dịch vụ của bên thứ 3 (quy trình công nhân). Và vâng, có các dự án env thời gian chạy xử lý nhiều quy trình nút và luồng của chúng trên cùng một máy hoặc cụm cpu. Nhưng nó là một câu chuyện khác. Hãy sửa tôi nếu tôi sai

josep2

Cái này thật tuyệt

josep2

Cái này thật tuyệt

Jacopo Chiapparino

Bài viết hay, cảm ơn bạn

Jacopo Chiapparino

Bài viết hay, cảm ơn bạn

NoobMovies. com

Tôi nghĩ Django vẫn đá đít Node

NoobMovies. com

Tôi nghĩ Django vẫn đá đít Node

Alex Viết

Này Tomislav, http. // mật mã. com/7-minimal-node-js-web-frameworks/ Tôi rất vui nếu bạn có thể thêm bài viết trên vào danh sách. )

Alex Viết

Này Tomislav, http. // mật mã. com/7-minimal-node-js-web-frameworks/ Tôi rất vui nếu bạn có thể thêm bài viết trên vào danh sách. )

dung nham Victor

Ôi, điều này thật tuyệt vời. Tôi luôn muốn học nút. js

dung nham Victor

Ôi, điều này thật tuyệt vời. Tôi luôn muốn học nút. js

ak

Cảm ơn bạn đã cung cấp ví dụ, minh họa và trường hợp sử dụng. Giải thích chi tiết và các bước trong một số trường hợp với các tài nguyên có liên quan làm cho nó trở nên tuyệt vời. Trường hợp sử dụng nodejs *nên* rất hữu ích

ak

Cảm ơn bạn đã cung cấp ví dụ, minh họa và trường hợp sử dụng. Giải thích chi tiết và các bước trong một số trường hợp với các tài nguyên có liên quan làm cho nó trở nên tuyệt vời. Trường hợp sử dụng nodejs *nên* rất hữu ích

tàu tuần dương

Tất cả mã Node đều bị ràng buộc bởi luồng. Nó có thể không chạy trên cùng một luồng mọi lúc (điều này không liên quan gì đến bản thân Node mà thay vào đó phải thực hiện với bộ lập lịch xử lý của hệ điều hành), nhưng nó bị ràng buộc bởi luồng. Để tận dụng nhiều luồng, bạn cần sử dụng thứ gì đó như Cụm. http. //nodejs. tổ chức/api/cụm. html

tàu tuần dương

Tất cả mã Node đều bị ràng buộc bởi luồng. Nó có thể không chạy trên cùng một luồng mọi lúc (điều này không liên quan gì đến bản thân Node mà thay vào đó phải thực hiện với bộ lập lịch xử lý của hệ điều hành), nhưng nó bị ràng buộc bởi luồng. Để tận dụng nhiều luồng, bạn cần sử dụng thứ gì đó như Cụm. http. //nodejs. tổ chức/api/cụm. html

tàu tuần dương

Đã đồng ý. Tôi sử dụng Postgres cho tất cả các loại hoạt động GIS trong một ứng dụng mà tôi đã làm việc trong khoảng một năm và ứng dụng này hoạt động rất tốt cũng như hưởng lợi từ I/O không chặn giống như bất kỳ quyền truy cập cơ sở dữ liệu nào khác. Chỉ là bạn phải thả trực tiếp xuống SQL. Có một vài ORM, nhưng không có gì thực sự trưởng thành

tàu tuần dương

Đã đồng ý. Tôi sử dụng Postgres cho tất cả các loại hoạt động GIS trong một ứng dụng mà tôi đã làm việc trong khoảng một năm và ứng dụng này hoạt động rất tốt cũng như hưởng lợi từ I/O không chặn giống như bất kỳ quyền truy cập cơ sở dữ liệu nào khác. Chỉ là bạn phải thả trực tiếp xuống SQL. Có một vài ORM, nhưng không có gì thực sự trưởng thành

tiên tri

Tuyệt vời, cảm ơn rất nhiều vì điều này

tiên tri

Tuyệt vời, cảm ơn rất nhiều vì điều này

Zmirc

nhận xét nhỏ. đừng nhầm lẫn Object DB với Mongo (Document DB). Có 2 thứ hoàn toàn khác nhau

Zmirc

nhận xét nhỏ. đừng nhầm lẫn Object DB với Mongo (Document DB). Có 2 thứ hoàn toàn khác nhau

gianlucca

tôi đồng ý, bài tốt

gianlucca

tôi đồng ý, bài tốt

gianlucca

Vâng tôi đồng ý

gianlucca

Vâng tôi đồng ý

gianlucca

chắc chắn rồi

gianlucca

chắc chắn rồi

Toulon

Bài viết rất tốt. Bạn đã suy nghĩ rất nhiều về nó. Nút nhanh/câu hỏi nhanh Tôi đang thêm mục nhập dữ liệu nhanh, không theo lô, mục nhập dữ liệu vào hệ thống của tôi Tôi có một biểu mẫu (mfntapes) hoạt động tốt. Tôi có một biểu mẫu kiểm tra (joe) lời nhắc về số lần tôi muốn gọi biểu mẫu mfntapes Ý chính chứa mã, không hoạt động, sau khi nhắc cnt cố gắng gọi mfntapes cnt lần. Lỗi là "ReferenceError. biểu mẫu không được xác định" trong dòng 87 của ý chính. Câu hỏi đặt ra là làm thế nào để gọi biểu mẫu mfntapes x số lần trong đó x là khả dụng? Xem các dòng 45-55 của https. //ý chính. github. com/toulon/9571625

Toulon

Bài viết rất tốt. Bạn đã suy nghĩ rất nhiều về nó. Nút nhanh/câu hỏi nhanh Tôi đang thêm mục nhập dữ liệu nhanh, không theo lô, mục nhập dữ liệu vào hệ thống của tôi Tôi có một biểu mẫu (mfntapes) hoạt động tốt. Tôi có một biểu mẫu kiểm tra (joe) lời nhắc về số lần tôi muốn gọi biểu mẫu mfntapes Ý chính chứa mã, không hoạt động, sau khi nhắc cnt cố gắng gọi mfntapes cnt lần. Lỗi là "ReferenceError. biểu mẫu không được xác định" trong dòng 87 của ý chính. Câu hỏi đặt ra là làm thế nào để gọi biểu mẫu mfntapes x số lần trong đó x là khả dụng? Xem các dòng 45-55 của https. //ý chính. github. com/toulon/9571625

Chúa Giêsu Bejarano

ORM cho các dự án thực tế là vô ích

Chúa Giêsu Bejarano

ORM cho các dự án thực tế là vô ích

Thomas

bài viết hay. -) > ỨNG DỤNG WEB PHÍA MÁY CHỦ W/ MỘT DB QUAN HỆ SAU ĐÓ Tôi tự hỏi tại sao Node không tốt cho việc đó? . Nút không có sự phản đối với cơ sở dữ liệu quan hệ. nó không quan tâm đến việc chỉ chặn trình điều khiển I/O. Quan hệ hay không quan hệ

Thomas

bài viết hay. -) > ỨNG DỤNG WEB PHÍA MÁY CHỦ W/ MỘT DB QUAN HỆ SAU ĐÓ Tôi tự hỏi tại sao Node không tốt cho việc đó? . Nút không có sự phản đối với cơ sở dữ liệu quan hệ. nó không quan tâm đến việc chỉ chặn trình điều khiển I/O. Quan hệ hay không quan hệ

Seb

Tôi ước gì NodeJS không (gần như) được trình bày một cách có hệ thống dưới dạng THE de facto thay thế cho máy chủ web theo luồng truyền thống. Async IO không dành riêng cho NodeJS. Hầu hết các ngôn ngữ chính hiện có - bao gồm Java và PHP - đều có khung IO không đồng bộ tương tự như NodeJS. Trang wiki này liệt kê hầu hết chúng. http. // vi. wikipedia. org/wiki/Reactor_potype Tôi không nói rằng NodeJS không có giá trị của nó, nhưng tôi phát ốm và mệt mỏi khi thấy mọi người đổ xô vào nó như thể đó là ngăn xếp IO *chỉ* không đồng bộ có sẵn và là giải pháp thay thế *chỉ* cho . Thành thật mà nói, chúng tôi có thể bị mắc kẹt với Javascript trên trình duyệt và sẽ còn rất lâu (trừ khi Javascript trở thành một nền tảng/ngôn ngữ mục tiêu khác nhờ asm. js), nhưng tôi không thể đưa ra bất kỳ lý do chính đáng nào để sử dụng nó ở phía máy chủ có lợi cho các ngôn ngữ khả dụng khác. Hầu hết các lựa chọn thay thế chỉ là ngôn ngữ tốt hơn, có thư viện, công cụ và tài nguyên tiêu chuẩn tốt hơn. Chỉ là ý kiến ​​cá nhân. Tóm lại, Node JS rất tuyệt, nhưng chắc chắn có một framework tương tự được viết bằng ngôn ngữ yêu thích của bạn. Vui lòng dành 5 phút để nghiên cứu về nó trước khi chuyển sang NodeJS

Seb

Tôi ước gì NodeJS không (gần như) được trình bày một cách có hệ thống dưới dạng THE de facto thay thế cho máy chủ web theo luồng truyền thống. Async IO không dành riêng cho NodeJS. Hầu hết các ngôn ngữ chính hiện có - bao gồm Java và PHP - đều có khung IO không đồng bộ tương tự như NodeJS. Trang wiki này liệt kê hầu hết chúng. http. // vi. wikipedia. org/wiki/Reactor_potype Tôi không nói rằng NodeJS không có giá trị của nó, nhưng tôi phát ốm và mệt mỏi khi thấy mọi người đổ xô vào nó như thể đó là ngăn xếp IO *chỉ* không đồng bộ có sẵn và là giải pháp thay thế *chỉ* cho . Thành thật mà nói, chúng tôi có thể bị mắc kẹt với Javascript trên trình duyệt và sẽ còn rất lâu (trừ khi Javascript trở thành một nền tảng/ngôn ngữ mục tiêu khác nhờ asm. js), nhưng tôi không thể đưa ra bất kỳ lý do chính đáng nào để sử dụng nó ở phía máy chủ có lợi cho các ngôn ngữ khả dụng khác. Hầu hết các lựa chọn thay thế chỉ là ngôn ngữ tốt hơn, có thư viện, công cụ và tài nguyên tiêu chuẩn tốt hơn. Chỉ là ý kiến ​​cá nhân. Tóm lại, Node JS rất tuyệt, nhưng chắc chắn có một framework tương tự được viết bằng ngôn ngữ yêu thích của bạn. Vui lòng dành 5 phút để nghiên cứu về nó trước khi chuyển sang NodeJS

Jarle Leopold Moe

Làm thế nào bạn sẽ tải lên các tập tin? . Nút. js là _single-threaded_ nó chỉ áp dụng cho một số loại tác vụ nhất định

Jarle Leopold Moe

Làm thế nào bạn sẽ tải lên các tập tin? . Nút. js là _single-threaded_ nó chỉ áp dụng cho một số loại tác vụ nhất định

Eric Elliott

Đây là những ví dụ tuyệt vời về lý do tại sao Node tốt hơn nhiều so với sự cạnh tranh tại các dịch vụ web. Không ai trong số đó đang chặn hoạt động trong Node. Chúng không đồng bộ. Trong khi các máy chủ khác lãng phí tài nguyên khi chạy các luồng riêng biệt, Node kích hoạt hoạt động không đồng bộ theo hướng sự kiện và tiếp tục nhận nhiều yêu cầu hơn trong thời gian chờ đợi. Kết quả thực tế là việc chuyển các dịch vụ web từ PHP hoặc Ruby có thể mang lại những cải tiến từ 2 đến 10 lần trong các kết nối đồng thời và thường là 30% - 60% cải thiện về thời gian phản hồi trung bình. Rất nhiều công ty lớn đang thực hiện các dự án Node web chỉ vì những lý do này, bao gồm Adobe, Paypal, eBay, Walmart, Yahoo. , Groupon, Uber, v.v.

Eric Elliott

Đây là những ví dụ tuyệt vời về lý do tại sao Node tốt hơn nhiều so với sự cạnh tranh tại các dịch vụ web. Không ai trong số đó đang chặn hoạt động trong Node. Chúng không đồng bộ. Trong khi các máy chủ khác lãng phí tài nguyên khi chạy các luồng riêng biệt, Node kích hoạt hoạt động không đồng bộ theo hướng sự kiện và tiếp tục nhận nhiều yêu cầu hơn trong thời gian chờ đợi. Kết quả thực tế là việc chuyển các dịch vụ web từ PHP hoặc Ruby có thể mang lại những cải tiến từ 2 đến 10 lần trong các kết nối đồng thời và thường là 30% - 60% cải thiện về thời gian phản hồi trung bình. Rất nhiều công ty lớn đang thực hiện các dự án Node web chỉ vì những lý do này, bao gồm Adobe, Paypal, eBay, Walmart, Yahoo. , Groupon, Uber, v.v.

jenit shah

bài viết rất hay và suy nghĩ rất rõ ràng về nút. js nên sử dụng ở đâu và không ở đâu

jenit shah

bài viết rất hay và suy nghĩ rất rõ ràng về nút. js nên sử dụng ở đâu và không ở đâu

BòQuy Định

Mọi nền tảng phát triển ứng dụng chính đều đã hỗ trợ HTML5 trong vài năm qua, bao gồm cả ổ cắm web để liên lạc hai chiều. Thêm vào đó là các loại mạnh, đa luồng và hàng tấn thứ khác mà các ngôn ngữ như Java phải cung cấp và tôi thực sự đặt câu hỏi tại sao mọi người lại lãng phí thời gian của họ khi sử dụng ngôn ngữ này

BòQuy Định

Mọi nền tảng phát triển ứng dụng chính đều đã hỗ trợ HTML5 trong vài năm qua, bao gồm cả ổ cắm web để liên lạc hai chiều. Thêm vào đó là các loại mạnh, đa luồng và hàng tấn thứ khác mà các ngôn ngữ như Java phải cung cấp và tôi thực sự đặt câu hỏi tại sao mọi người lại lãng phí thời gian của họ khi sử dụng ngôn ngữ này

robertcook

Chỉ muốn đề cập rằng nút đó không phải là tùy chọn phía máy chủ duy nhất cho javascript, đặc biệt là khi Oracle đặt công cụ javascript nashorn trên jdk. Bây giờ bạn cũng có thể sử dụng tất cả tính năng tốt của jvm từ javascript mà chúng tôi đang sử dụng vert. x làm máy chủ không đồng bộ và nashorn để sử dụng javascript. Bạn có thể xem một số mẫu mã trong mô-đun này https. //github. com/core9/module-nashorn trang web dự án là core9. io

robertcook

Chỉ muốn đề cập rằng nút đó không phải là tùy chọn phía máy chủ duy nhất cho javascript, đặc biệt là khi Oracle đặt công cụ javascript nashorn trên jdk. Bây giờ bạn cũng có thể sử dụng tất cả tính năng tốt của jvm từ javascript mà chúng tôi đang sử dụng vert. x làm máy chủ không đồng bộ và nashorn để sử dụng javascript. Bạn có thể xem một số mẫu mã trong mô-đun này https. //github. com/core9/module-nashorn trang web dự án là core9. io

Vô danh

Đây là một tổng quan tuyệt vời. Cảm ơn bạn

Vô danh

Đây là một tổng quan tuyệt vời. Cảm ơn bạn

Vishnu Tekale

Viết rất tốt. Cám ơn vì đã chia sẻ

Vishnu Tekale

Viết rất tốt. Cám ơn vì đã chia sẻ

Gleb Bahmutov

Tại sao Nút lại khác - sử dụng thanh làm http tương tự. // bamutov. cái ghim. co/tại sao-nút-là-khác. html

Gleb Bahmutov

Tại sao Nút lại khác - sử dụng thanh làm http tương tự. // bamutov. cái ghim. co/tại sao-nút-là-khác. html

FluckerSputter

Chỉ để cho bạn biết rằng bạn có "hỗ trợ hỗ trợ" trong Cách thức hoạt động cơ bản khá thú vị. So với các kỹ thuật phục vụ web truyền thống trong đó mỗi kết nối (yêu cầu) tạo ra một luồng mới, chiếm RAM hệ thống và cuối cùng sử dụng tối đa dung lượng RAM có sẵn, Node. js hoạt động trên một luồng đơn, sử dụng các cuộc gọi I/O không chặn, cho phép nó hỗ trợ hàng chục nghìn kết nối đồng thời (được tổ chức trong vòng lặp sự kiện)

FluckerSputter

Chỉ để cho bạn biết rằng bạn có "hỗ trợ hỗ trợ" trong Cách thức hoạt động cơ bản khá thú vị. So với các kỹ thuật phục vụ web truyền thống trong đó mỗi kết nối (yêu cầu) tạo ra một luồng mới, chiếm RAM hệ thống và cuối cùng sử dụng tối đa dung lượng RAM có sẵn, Node. js hoạt động trên một luồng đơn, sử dụng các cuộc gọi I/O không chặn, cho phép nó hỗ trợ hàng chục nghìn kết nối đồng thời (được tổ chức trong vòng lặp sự kiện)

piloh23

Nút. js sẽ không bao giờ thay thế Rails để trở thành web framework số một

piloh23

Nút. js sẽ không bao giờ thay thế Rails để trở thành web framework số một

Alifa Nurani Putri

Xin chào, Nút có phải là lựa chọn tốt nhất để truyền phát và tải lên video không?

Alifa Nurani Putri

Xin chào, Nút có phải là lựa chọn tốt nhất để truyền phát và tải lên video không?

SleightDifference

Tại sao PHP không được đề cập để tương tác với cơ sở dữ liệu quan hệ?

SleightDifference

Tại sao PHP không được đề cập để tương tác với cơ sở dữ liệu quan hệ?

Clain Dsilva

Cảm ơn bạn đã dành thời gian giải thích về Node. js. Tôi thực sự gặp khó khăn trong việc hiểu nó từ trang web của họ cũng như Wikipedia. Bài viết tốt. Giữ nó lên

Clain Dsilva

Cảm ơn bạn đã dành thời gian giải thích về Node. js. Tôi thực sự gặp khó khăn trong việc hiểu nó từ trang web của họ cũng như Wikipedia. Bài viết tốt. Giữ nó lên

Cézar Luiz

Còn https này thì sao. //github. com/felixge/nút-mysql? . Cảm ơn

Cézar Luiz

Còn https này thì sao. //github. com/felixge/nút-mysql? . Cảm ơn

Marcelo Lima

Cảm ơn bạn cho bài viết này. Đã xóa rất nhiều câu hỏi của tôi về nội bộ Node

Marcelo Lima

Cảm ơn bạn cho bài viết này. Đã xóa rất nhiều câu hỏi của tôi về nội bộ Node

điều hướng

Điều tuyệt vời

điều hướng

Điều tuyệt vời

Abdelhakim

https. //www. demy. com/nodejs-tutorial-from-scratch-by-examples/?couponCode=NewOffer 1. Truy cập trọn đời 24 bài giảng 2. Hơn 120 phút nội dung chất lượng cao. 2. Tham gia cộng đồng hơn 2687 sinh viên cùng nhau học tập. 4. Thông tin khóa học và cập nhật thường xuyên 5. Tìm hiểu nút. js và mongoDB từ đầu bằng các ví dụ. 6. Thông tin khóa học và cập nhật thường xuyên. 7. Diễn đàn thảo luận mà chúng tôi khuyến khích bạn tận dụng -- vừa để đặt câu hỏi về tài liệu cho người hướng dẫn khóa học vừa để trao đổi ý kiến ​​với các bạn cùng lớp. số 8. Hỗ trợ khóa học chất lượng cao

Abdelhakim

https. //www. demy. com/nodejs-tutorial-from-scratch-by-examples/?couponCode=NewOffer 1. Truy cập trọn đời 24 bài giảng 2. Hơn 120 phút nội dung chất lượng cao. 2. Tham gia cộng đồng hơn 2687 sinh viên cùng nhau học tập. 4. Thông tin khóa học và cập nhật thường xuyên 5. Tìm hiểu nút. js và mongoDB từ đầu bằng các ví dụ. 6. Thông tin khóa học và cập nhật thường xuyên. 7. Diễn đàn thảo luận mà chúng tôi khuyến khích bạn tận dụng -- vừa để đặt câu hỏi về tài liệu cho người hướng dẫn khóa học vừa để trao đổi ý kiến ​​với các bạn cùng lớp. số 8. Hỗ trợ khóa học chất lượng cao

rahul gag

Theo sự hiểu biết của tôi với bài viết, nếu bạn gửi bất kỳ yêu cầu nào tới máy chủ nút, nó sẽ thực sự xử lý trên một số luồng nền (libuv. dll). Bây giờ tôi muốn đăng một số tệp qua máy chủ nút, tại sao nó lại chặn máy chủ nút trong khi nó thực sự sẽ xử lý trên luồng nền và khi hoàn tất, chỉ phản hồi sẽ được trả về bởi luồng nút?

rahul gag

Theo sự hiểu biết của tôi với bài viết, nếu bạn gửi bất kỳ yêu cầu nào tới máy chủ nút, nó sẽ thực sự xử lý trên một số luồng nền (libuv. dll). Bây giờ tôi muốn đăng một số tệp qua máy chủ nút, tại sao nó lại chặn máy chủ nút trong khi nó thực sự sẽ xử lý trên luồng nền và khi hoàn tất, chỉ phản hồi sẽ được trả về bởi luồng nút?

siddesh

Siêu Bài Viết

siddesh

Siêu Bài Viết

fanck

Không thể lấy ngày đăng bài viết của bạn? . Thật sự rất khó chịu khi đọc các bài viết kỹ thuật không có ngày tháng. cảm ơn

fanck

Không thể lấy ngày đăng bài viết của bạn? . Thật sự rất khó chịu khi đọc các bài viết kỹ thuật không có ngày tháng. cảm ơn

nam mô

Bạn đề cập đến Nút. js tốt cho ứng dụng trò chuyện vì nó không tốn nhiều CPU. Tôi không thể nghĩ ra quá nhiều trường hợp sử dụng không yêu cầu nhiều CPU. Ví dụ: Twitter có thể được xây dựng bằng Node không? . Nút. js sử dụng chắc chắn không thể quá hẹp

nam mô

Bạn đề cập đến Nút. js tốt cho ứng dụng trò chuyện vì nó không tốn nhiều CPU. Tôi không thể nghĩ ra quá nhiều trường hợp sử dụng không yêu cầu nhiều CPU. Ví dụ: Twitter có thể được xây dựng bằng Node không? . Nút. js sử dụng chắc chắn không thể quá hẹp

Ian Kaplan

Bài báo tuyệt vời. Cảm ơn. Có một trò đùa cũ. bạn không phải là một kẻ hoang tưởng nếu họ thực sự ra ngoài để có được bạn. Đó là thái độ nên có khi nói đến bảo mật ứng dụng Web. Một điều làm phiền tôi về Node. js là tôi không hiểu rõ về mức độ an toàn của nó. Khi một môi trường như Grails, nơi tôi có Java/Groovy chạy trên Tomcat, tôi có chút tin tưởng vào bảo mật của Tomcat, nếu không vì lý do nào khác ngoài thực tế là Tomcat đã tồn tại từ lâu và đã phát triển. Điều này không đúng với Node. js. Tôi cũng đang xem Node. thư viện js. Ít nhất là đối với quyền truy cập tệp, nó dường như chẳng khác gì một lớp mỏng trên các cuộc gọi hệ thống tệp POSIX. Tôi thích phần trừu tượng hóa tệp Java hoặc thậm chí C++ hơn. Đối số chính mà tôi thấy cho Node. js (được thực hiện trong bài đăng này) là nó có các luồng thực sự nhẹ và bạn có thể có JavaScrip ở mọi nơi. Vấn đề cuối cùng này là một điểm thu hút đối với những người chỉ biết JavaScript. Đối với các chủ đề trọng lượng nhẹ, đây không phải là vấn đề về ngôn ngữ mà là vấn đề hỗ trợ nền tảng. It should be possible to support this kind of thread model in another language

Ian Kaplan

Bài báo tuyệt vời. Cảm ơn. Có một trò đùa cũ. bạn không phải là một kẻ hoang tưởng nếu họ thực sự ra ngoài để có được bạn. Đó là thái độ nên có khi nói đến bảo mật ứng dụng Web. Một điều làm phiền tôi về Node. js là tôi không hiểu rõ về mức độ an toàn của nó. Khi một môi trường như Grails, nơi tôi có Java/Groovy chạy trên Tomcat, tôi có chút tin tưởng vào bảo mật của Tomcat, nếu không vì lý do nào khác ngoài thực tế là Tomcat đã tồn tại từ lâu và đã phát triển. Điều này không đúng với Node. js. Tôi cũng đang xem Node. thư viện js. Ít nhất là đối với quyền truy cập tệp, nó dường như chẳng khác gì một lớp mỏng trên các cuộc gọi hệ thống tệp POSIX. Tôi thích phần trừu tượng hóa tệp Java hoặc thậm chí C++ hơn. Đối số chính mà tôi thấy cho Node. js (được thực hiện trong bài đăng này) là nó có các luồng thực sự nhẹ và bạn có thể có JavaScrip ở mọi nơi. Vấn đề cuối cùng này là một điểm thu hút đối với những người chỉ biết JavaScript. Đối với các chủ đề trọng lượng nhẹ, đây không phải là vấn đề về ngôn ngữ mà là vấn đề hỗ trợ nền tảng. It should be possible to support this kind of thread model in another language

Web khổng lồ

Nhà thiết kế Toptal đã thiết kế cho họ

Web khổng lồ

Nhà thiết kế Toptal đã thiết kế cho họ

Scott

Bài báo tuyệt vời. cảm ơn vì những thông tin

Scott

Bài báo tuyệt vời. cảm ơn vì những thông tin

daimmo

tôi đồng ý. Tôi đoán đó là khoảng "một năm trước" vì hầu hết các bình luận của Disqus. Điều này được lấy từ các thẻ meta của họ. 2013-08-13

daimmo

tôi đồng ý. Tôi đoán đó là khoảng "một năm trước" vì hầu hết các bình luận của Disqus. Điều này được lấy từ các thẻ meta của họ. 2013-08-13

Vua Adnan

đẹp

Vua Adnan

đẹp

Ethan Garofolo

Nút. js không phải là một khung web. Đó là thời gian chạy V8 được đóng gói với một số thư viện lõi được đính kèm. Node giống mri trong thế giới Ruby hơn Rails

Ethan Garofolo

Nút. js không phải là một khung web. Đó là thời gian chạy V8 được đóng gói với một số thư viện lõi được đính kèm. Node giống mri trong thế giới Ruby hơn Rails

Khách mời

Nút. js giống Rack hơn, nhưng không giống. MRI chỉ là một ngôn ngữ thực hiện

Khách mời

Nút. js giống Rack hơn, nhưng không giống. MRI chỉ là một ngôn ngữ thực hiện

Bể bơi Lambda

vấn đề là mongodb, quá rủi ro khi sử dụng cơ sở dữ liệu không thể di chuyển

Bể bơi Lambda

vấn đề là mongodb, quá rủi ro khi sử dụng cơ sở dữ liệu không thể di chuyển

Bể bơi Lambda

đúng vậy, ORM là một thực tế tồi sau tất cả

Bể bơi Lambda

đúng vậy, ORM là một thực tế tồi sau tất cả

Bể bơi Lambda

có nhưng nó hoạt động theo một cách rất không hiệu quả

Bể bơi Lambda

có nhưng nó hoạt động theo một cách rất không hiệu quả

Bể bơi Lambda

bản thân công cụ cơ sở dữ liệu sẽ tinh vi hơn bất kỳ thư viện ORM nào do người khác tạo ra

Bể bơi Lambda

bản thân công cụ cơ sở dữ liệu sẽ tinh vi hơn bất kỳ thư viện ORM nào do người khác tạo ra

John Bailo

Thật thú vị khi web vẫn không đồng bộ như thế nào. Thật vậy, giống như một chiếc máy trả lời điện thoại, tiện ích của nó nằm ở chỗ

John Bailo

Thật thú vị khi web vẫn không đồng bộ như thế nào. Thật vậy, giống như một chiếc máy trả lời điện thoại, tiện ích của nó nằm ở chỗ

Jayaraj Poroor

Tôi đồng ý - Tôi cũng không phải là người hâm mộ ORM. ORM là một ví dụ cổ điển về sự trừu tượng bị rò rỉ

Jayaraj Poroor

Tôi đồng ý - Tôi cũng không phải là người hâm mộ ORM. ORM là một ví dụ cổ điển về sự trừu tượng bị rò rỉ

Jayaraj Poroor

Về việc sử dụng Node. js với cơ sở dữ liệu quan hệ. Shelloid (http. // vỏ sò. org) là một máy chủ ứng dụng mã nguồn mở cho Node. js mà chúng tôi đã phát triển để đơn giản hóa nhiều tác vụ của lập trình viên. e. g. , Bạn có thể khai báo các truy vấn SQL có tên dưới dạng chú thích và một hàm có tên đó sẽ tự động được thêm vào đối tượng DB để bạn sử dụng

Jayaraj Poroor

Về việc sử dụng Node. js với cơ sở dữ liệu quan hệ. Shelloid (http. // vỏ sò. org) là một máy chủ ứng dụng mã nguồn mở cho Node. js mà chúng tôi đã phát triển để đơn giản hóa nhiều tác vụ của lập trình viên. e. g. , Bạn có thể khai báo các truy vấn SQL có tên dưới dạng chú thích và một hàm có tên đó sẽ tự động được thêm vào đối tượng DB để bạn sử dụng

M

Tôi nghĩ bạn chưa hiểu rõ về lý do cũng như đặc điểm của ORM. ORM không chỉ cô lập các mối quan tâm về dữ liệu, chúng còn cung cấp khả năng kiểm tra và tính linh hoạt cao hơn so với các máy khách SQL truyền thống. ORM cũng cung cấp quyền truy cập bộ nhớ thay cho các phép nối không hiệu quả, vì vậy chúng thực sự có thể hiệu quả hơn nhiều so với SQL trong các tình huống trong thế giới thực. Ngoài ra, với sự lựa chọn thực hiện các hoạt động tập hợp phức tạp trong ngôn ngữ tập hợp thủ tục hạn chế như SQL hoặc phức tạp trong các hoạt động bộ nhớ bằng cách sử dụng ngôn ngữ phong phú hơn, biểu cảm hơn và dễ bảo trì hơn, ngôn ngữ phong phú hơn sẽ chiến thắng nếu bạn mong muốn duy trì hoặc mở rộng ứng dụng

M

Tôi nghĩ bạn chưa hiểu rõ về lý do cũng như đặc điểm của ORM. ORM không chỉ cô lập các mối quan tâm về dữ liệu, chúng còn cung cấp khả năng kiểm tra và tính linh hoạt cao hơn so với các máy khách SQL truyền thống. ORM cũng cung cấp quyền truy cập bộ nhớ thay cho các phép nối không hiệu quả, vì vậy chúng thực sự có thể hiệu quả hơn nhiều so với SQL trong các tình huống trong thế giới thực. Ngoài ra, với sự lựa chọn thực hiện các hoạt động tập hợp phức tạp trong ngôn ngữ tập hợp thủ tục hạn chế như SQL hoặc phức tạp trong các hoạt động bộ nhớ bằng cách sử dụng ngôn ngữ phong phú hơn, biểu cảm hơn và dễ bảo trì hơn, ngôn ngữ phong phú hơn sẽ chiến thắng nếu bạn mong muốn duy trì hoặc mở rộng ứng dụng

M

Bạn không biết những gì bạn đang nói về. Nếu bạn đang viết một ứng dụng không tầm thường và không sử dụng ORM thì tôi chắc chắn rằng sẽ có nhiều nhà phát triển cả hiện tại và trong tương lai sẽ nguyền rủa tên bạn khi họ lướt qua hàng đống SQL lố bịch. Khả năng kiểm tra? . Khi tôi thấy những bình luận lố bịch như thế này đến từ nút. js fanboi, điều đó khiến tôi nghi ngờ rằng họ sẽ hát một giai điệu khác nếu nút. js có khả năng RDBMS tốt

M

Bạn không biết những gì bạn đang nói về. Nếu bạn đang viết một ứng dụng không tầm thường và không sử dụng ORM thì tôi chắc chắn rằng sẽ có nhiều nhà phát triển cả hiện tại và trong tương lai sẽ nguyền rủa tên bạn khi họ lướt qua hàng đống SQL lố bịch. Khả năng kiểm tra? . Khi tôi thấy những bình luận lố bịch như thế này đến từ nút. js fanboi, điều đó khiến tôi nghi ngờ rằng họ sẽ hát một giai điệu khác nếu nút. js có khả năng RDBMS tốt

Bể bơi Lambda

bạn chỉ đánh giá quá cao ORM, chẳng hạn như hầu hết các fanboy OO đều làm

Bể bơi Lambda

bạn chỉ đánh giá quá cao ORM, chẳng hạn như hầu hết các fanboy OO đều làm

Bể bơi Lambda

nhận xét của bạn cũng thật nực cười, ORM không phải là mẫu được mọi người chấp nhận

Bể bơi Lambda

nhận xét của bạn cũng thật nực cười, ORM không phải là mẫu được mọi người chấp nhận

M

Điều trớ trêu là lambda's (hay còn gọi là phương thức ẩn danh) là cơ sở của cả javascript và kỹ thuật ưa thích để triển khai nhiều kiểu gọi lại của C #, mặc dù có kiểu an toàn đầy đủ. Trên thực tế, các đặc điểm chính của nút (2 chiều, nhẹ, không đồng bộ đã được triển khai hiệu quả trong C# dưới dạng "SignalR" và có một số tính năng ngôn ngữ vừa không đồng bộ vừa đa luồng, (không giống như nút. js). Bây giờ tôi có thể hiểu nếu trải nghiệm của bạn với ORM bị giới hạn ở Hibernate (hoàn toàn khủng khiếp, một trong những triển khai tồi tệ nhất của một khái niệm chính mà tôi từng không hài lòng khi làm việc cùng) hoặc thậm chí là EF, ít nhất là khá mạnh mẽ và biểu cảm do . Nhưng một ORM vi mô như Dapper mang lại cho bạn tất cả tính linh hoạt và sức mạnh của SQL trực tiếp với lợi ích của việc thao tác dữ liệu phong phú thông qua các đối tượng và nhanh, rất nhanh. Và tôi xin lỗi, nhưng OOP là một chiến lược thiết kế rất hiệu quả, đã được chứng minh nếu bạn biết mình đang làm gì, tôi. e. , bạn là dân chuyên nghiệp. Tôi thấy có ba vấn đề lớn với nút. js approach that no one seems to have a good answer for. So you start with the premise that there are such inefficiencies in waiting for IO that there is a huge potential there. Vì vậy, vâng, bạn đã có tính đồng thời tuyệt vời, ngay cho đến khi bạn đến thư viện chặn đầu tiên, cơ sở dữ liệu, máy chủ tệp, v.v., thực tế là mọi phần chính của chức năng được viết. Vì vậy, chỉ cần nhanh lên và đợi 10.000 kết nối thay vì 100, ok đó là điều gì đó, nhưng nó sẽ đưa bạn đến đâu? . Bởi vì cuối cùng, mọi cơ sở dữ liệu trên trái đất cuối cùng đều có một cánh tay từ tính lướt qua đĩa hoặc đọc bộ nhớ trạng thái rắn và điều đó giả định rằng bạn đang sử dụng cùng một máy, trái ngược với việc phân phối dữ liệu qua một nhóm kết nối mạng chậm hơn nhiều. Sau đó, bạn có vấn đề đơn luồng. Có lẽ không có ngôn ngữ nào bị lạm dụng nhiều hơn Javascript vì rào cản gia nhập quá thấp. Và mặc dù những người dùng đầu tiên có thể hiểu một cách làm không tốt khi họ nhìn thấy, nhưng hầu hết các lập trình viên javascript chỉ đơn giản là không biết họ đang làm gì. Thứ ba, Javascript không hẳn là một ngôn ngữ đặc biệt nhanh, vì vậy lời khuyên có vẻ là đừng thực hiện các tác vụ chuyên sâu về tính toán. Điều đó đưa bạn đến đâu?

M

Điều trớ trêu là lambda's (hay còn gọi là phương thức ẩn danh) là cơ sở của cả javascript và kỹ thuật ưa thích để triển khai nhiều kiểu gọi lại của C #, mặc dù có kiểu an toàn đầy đủ. Trên thực tế, các đặc điểm chính của nút (2 chiều, nhẹ, không đồng bộ đã được triển khai hiệu quả trong C# dưới dạng "SignalR" và có một số tính năng ngôn ngữ vừa không đồng bộ vừa đa luồng, (không giống như nút. js). Bây giờ tôi có thể hiểu nếu trải nghiệm của bạn với ORM bị giới hạn ở Hibernate (hoàn toàn khủng khiếp, một trong những triển khai tồi tệ nhất của một khái niệm chính mà tôi từng không hài lòng khi làm việc cùng) hoặc thậm chí là EF, ít nhất là khá mạnh mẽ và biểu cảm do . Nhưng một ORM vi mô như Dapper mang lại cho bạn tất cả tính linh hoạt và sức mạnh của SQL trực tiếp với lợi ích của việc thao tác dữ liệu phong phú thông qua các đối tượng và nhanh, rất nhanh. Và tôi xin lỗi, nhưng OOP là một chiến lược thiết kế rất hiệu quả, đã được chứng minh nếu bạn biết mình đang làm gì, tôi. e. , bạn là dân chuyên nghiệp. Tôi thấy có ba vấn đề lớn với nút. js approach that no one seems to have a good answer for. So you start with the premise that there are such inefficiencies in waiting for IO that there is a huge potential there. Vì vậy, vâng, bạn đã có tính đồng thời tuyệt vời, ngay cho đến khi bạn đến thư viện chặn đầu tiên, cơ sở dữ liệu, máy chủ tệp, v.v., thực tế là mọi phần chính của chức năng được viết. Vì vậy, chỉ cần nhanh lên và đợi 10.000 kết nối thay vì 100, ok đó là điều gì đó, nhưng nó sẽ đưa bạn đến đâu? . Bởi vì cuối cùng, mọi cơ sở dữ liệu trên trái đất cuối cùng đều có một cánh tay từ tính lướt qua đĩa hoặc đọc bộ nhớ trạng thái rắn và điều đó giả định rằng bạn đang sử dụng cùng một máy, trái ngược với việc phân phối dữ liệu qua một nhóm kết nối mạng chậm hơn nhiều. Sau đó, bạn có vấn đề đơn luồng. Có lẽ không có ngôn ngữ nào bị lạm dụng nhiều hơn Javascript vì rào cản gia nhập quá thấp. Và mặc dù những người dùng đầu tiên có thể hiểu một cách làm không tốt khi họ nhìn thấy, nhưng hầu hết các lập trình viên javascript chỉ đơn giản là không biết họ đang làm gì. Thứ ba, Javascript không hẳn là một ngôn ngữ đặc biệt nhanh, vì vậy lời khuyên có vẻ là đừng thực hiện các tác vụ chuyên sâu về tính toán. Điều đó đưa bạn đến đâu?

M

Wow, đó là một tuyên bố thiếu hiểu biết nghiêm trọng. Tải tệp lên máy chủ web là *THE* đã nêu lý do của nút. js về lý do tại sao anh ấy muốn có một thư viện không chặn. Vì vậy, khi bạn fanboi thoát ra khỏi thế giới cắt và dán mã đơn luồng, năng động chậm chạp với loại không an toàn, đa luồng và chỉ có một mẹo nhỏ (lambdas) để khớp. nhiều khả năng không đồng bộ của Net, (tất cả là để bạn có thể thu hút thêm gấp 10 lần người dùng nhanh lên và đợi IO), sau đó bạn có thể giảng cho chúng tôi về "sự phức tạp". Các. Net framework có bộ tính năng tiên tiến hơn rất nhiều so với bất kỳ ngôn ngữ nào bạn có thể đặt tên, dấu chấm và IIS, được định cấu hình đúng cách, có thể đánh bại Apache và có thể dễ dàng khớp nginx làm proxy ngược hoặc cho nội dung tĩnh. Cuối cùng, bạn đã có một số vấn đề khó chữa. 1. Javascript chậm và công nghệ bạn chọn là đơn luồng, vì vậy các tác vụ điện toán chuyên sâu không phải bàn. 2. Gỡ lỗi Javascript và thử nghiệm vượt trội so với bất kỳ ngôn ngữ đánh máy nào. Chuyên gia sử dụng thử nghiệm rộng rãi, không bay theo quần 'này, nó hoạt động'. 3. Cách tiếp cận 'mọi thứ đều là mô-đun' không phải là một kiến ​​trúc, nó là một lời mời đến sự hỗn loạn, giống như Perl hoặc PHP. 4. Đồng thời không mua cho bạn những thứ tào lao nếu tất cả những gì bạn đang làm là chờ đợi một số quy trình ràng buộc IO khác, đó là hầu hết mọi thứ đáng để làm với máy tính. 5. Chất lượng và kinh nghiệm của nhiều lập trình viên javascript (không phải nút. js, nhưng sự phổ biến sẽ mang lại cho họ) rất kém, thể hiện qua các bình luận trong đó fanboi chứng minh rằng họ không biết làm thế nào các hệ thống khác thực sự không bỏ qua bất kỳ vấn đề máy tính nào mà họ không thể giải quyết được.

M

Wow, đó là một tuyên bố thiếu hiểu biết nghiêm trọng. Tải tệp lên máy chủ web là *THE* đã nêu lý do của nút. js về lý do tại sao anh ấy muốn có một thư viện không chặn. Vì vậy, khi bạn fanboi thoát ra khỏi thế giới cắt và dán mã đơn luồng, năng động chậm chạp với loại không an toàn, đa luồng và chỉ có một mẹo nhỏ (lambdas) để khớp. nhiều khả năng không đồng bộ của Net, (tất cả là để bạn có thể thu hút thêm gấp 10 lần người dùng nhanh lên và đợi IO), sau đó bạn có thể giảng cho chúng tôi về "sự phức tạp". Các. Net framework có bộ tính năng tiên tiến hơn rất nhiều so với bất kỳ ngôn ngữ nào bạn có thể đặt tên, dấu chấm và IIS, được định cấu hình đúng cách, có thể đánh bại Apache và có thể dễ dàng khớp nginx làm proxy ngược hoặc cho nội dung tĩnh. Cuối cùng, bạn đã có một số vấn đề khó chữa. 1. Javascript chậm và công nghệ bạn chọn là đơn luồng, vì vậy các tác vụ điện toán chuyên sâu không phải bàn. 2. Gỡ lỗi Javascript và thử nghiệm vượt trội so với bất kỳ ngôn ngữ đánh máy nào. Chuyên gia sử dụng thử nghiệm rộng rãi, không bay theo quần 'này, nó hoạt động'. 3. Cách tiếp cận 'mọi thứ đều là mô-đun' không phải là một kiến ​​trúc, nó là một lời mời đến sự hỗn loạn, giống như Perl hoặc PHP. 4. Đồng thời không mua cho bạn những thứ tào lao nếu tất cả những gì bạn đang làm là chờ đợi một số quy trình ràng buộc IO khác, đó là hầu hết mọi thứ đáng để làm với máy tính. 5. Chất lượng và kinh nghiệm của nhiều lập trình viên javascript (không phải nút. js, nhưng sự phổ biến sẽ mang lại cho họ) rất kém, thể hiện qua các bình luận trong đó fanboi chứng minh rằng họ không biết làm thế nào các hệ thống khác thực sự không bỏ qua bất kỳ vấn đề máy tính nào mà họ không thể giải quyết được.

Bể bơi Lambda

ORM chỉ là giải pháp cho vấn đề trở kháng không phù hợp, không có gì khác. Nó không phải là vấn đề lớn, về OO, nó là một mô hình chéo giống như AOP và nó không thực sự dựa trên bất cứ thứ gì khác ngoài sự đóng gói. Không có mô hình thủ tục OO không làm gì cả, mọi lập trình viên lành nghề thực sự đều biết rằng

Bể bơi Lambda

ORM chỉ là giải pháp cho vấn đề trở kháng không phù hợp, không có gì khác. Nó không phải là vấn đề lớn, về OO, nó là một mô hình chéo giống như AOP và nó không thực sự dựa trên bất cứ thứ gì khác ngoài sự đóng gói. Không có mô hình thủ tục OO không làm gì cả, mọi lập trình viên lành nghề thực sự đều biết rằng

M

Sự không phù hợp trở kháng liên quan đến tất cả các loại phân nhánh, đặc biệt là liên quan đến khả năng bảo trì, tính di động, khả năng mở rộng và hiệu suất. Để trích dẫn Ethan ở trên (vì lời giải thích của tôi rõ ràng là không có). ". đó là một công cụ được sử dụng để đóng gói các mối quan tâm về cơ sở dữ liệu, cách ly chúng khỏi ứng dụng. Có một số lợi ích, nhưng cuối cùng, nó giúp các ứng dụng dễ dàng kiểm tra và duy trì trong nhiều năm tới. " "về OO, nó là một mô hình chéo giống như AOP và nó không thực sự dựa trên bất cứ điều gì khác ngoài sự đóng gói. Nếu không có mô hình thủ tục thì OO chẳng làm được gì" Ok, tôi chắc chắn sẽ truyền bá thông điệp rằng chúng ta nên ngừng đùa giỡn với tất cả những thứ OOP bí truyền này và quay lại với một ngôn ngữ cho phép chúng ta làm mọi thứ trực quan hóa sự đóng gói. VB6. Bạn sẽ nghĩ rằng một lập trình viên Javascript có thể muốn đề cập đến tính kế thừa, nếu không phải là tính đa hình, vì javascript có một cơ chế tương đối khác thường đối với nó. nguyên mẫu

M

Sự không phù hợp trở kháng liên quan đến tất cả các loại phân nhánh, đặc biệt là liên quan đến khả năng bảo trì, tính di động, khả năng mở rộng và hiệu suất. Để trích dẫn Ethan ở trên (vì lời giải thích của tôi rõ ràng là không có). ". đó là một công cụ được sử dụng để đóng gói các mối quan tâm về cơ sở dữ liệu, cách ly chúng khỏi ứng dụng. Có một số lợi ích, nhưng cuối cùng, nó giúp các ứng dụng dễ dàng kiểm tra và duy trì trong nhiều năm tới. " "về OO, nó là một mô hình chéo giống như AOP và nó không thực sự dựa trên bất cứ điều gì khác ngoài sự đóng gói. Nếu không có mô hình thủ tục thì OO chẳng làm được gì" Ok, tôi chắc chắn sẽ truyền bá thông điệp rằng chúng ta nên ngừng đùa giỡn với tất cả những thứ OOP bí truyền này và quay lại với một ngôn ngữ cho phép chúng ta làm mọi thứ trực quan hóa sự đóng gói. VB6. Bạn sẽ nghĩ rằng một lập trình viên Javascript có thể muốn đề cập đến tính kế thừa, nếu không phải là tính đa hình, vì javascript có một cơ chế tương đối khác thường đối với nó. nguyên mẫu

M

Một singleton là một đối tượng có thể khởi tạo (không tĩnh) với một hàm tạo riêng để chỉ có thể tạo một cá thể duy nhất. (Hãy tưởng tượng một lớp thể hiện với một thuộc tính tĩnh hiển thị một thể hiện của chính nó phụ thuộc vào một hàm tạo cá thể riêng). Nó đã thực sự được thực hiện trong Java trước đây. mạng tồn tại. Có lẽ những gì bạn đang nghĩ đến là cơ chế Gọi lại không chặn, được xử lý trong C# thông qua các đại biểu, sự kiện (đại biểu phát đa hướng) và các từ khóa async và await mới biến C# tiêu chuẩn thành lambda để được thực thi tại thời điểm biên dịch. It also handles multi-threaded asynchronous operations via it's Parallel extensions, which permit spreading load across multiple threads/cores as long as that work is not serial in nature. Ngoài ra, tôi khuyến khích bạn kiểm tra một ORM vi mô như Dapper. Nó kém toàn diện hơn nhiều so với EF, nhưng nó linh hoạt hơn nhiều và không gây cản trở, cộng với nó hiệu quả hơn đáng kể so với Hibernate và EF (nhanh hơn khoảng 5 lần để đọc)

M

Một singleton là một đối tượng có thể khởi tạo (không tĩnh) với một hàm tạo riêng để chỉ có thể tạo một cá thể duy nhất. (Hãy tưởng tượng một lớp thể hiện với một thuộc tính tĩnh hiển thị một thể hiện của chính nó phụ thuộc vào một hàm tạo cá thể riêng). Nó đã thực sự được thực hiện trong Java trước đây. mạng tồn tại. Có lẽ những gì bạn đang nghĩ đến là cơ chế Gọi lại không chặn, được xử lý trong C# thông qua các đại biểu, sự kiện (đại biểu phát đa hướng) và các từ khóa async và await mới biến C# tiêu chuẩn thành lambda để được thực thi tại thời điểm biên dịch. It also handles multi-threaded asynchronous operations via it's Parallel extensions, which permit spreading load across multiple threads/cores as long as that work is not serial in nature. Ngoài ra, tôi khuyến khích bạn kiểm tra một ORM vi mô như Dapper. Nó kém toàn diện hơn nhiều so với EF, nhưng nó linh hoạt hơn nhiều và không gây cản trở, cộng với nó hiệu quả hơn đáng kể so với Hibernate và EF (nhanh hơn khoảng 5 lần để đọc)

Qalandr

Có bài viết này làm rung chuyển ngực. Esp tốt cho người Croatia có ESL. ;) #nodeboy

Qalandr

Có bài viết này làm rung chuyển ngực. Esp tốt cho người Croatia có ESL. ;) #nodeboy

Ty Turner

We are searching for a Node. js developer. Please see http. //altaits. com/careers/search-jobs/ for details. Thank you

Ty Turner

We are searching for a Node. js developer. Please see http. //altaits. com/careers/search-jobs/ for details. Thank you

Vob Bobily

So after reading your article I still havent figured out why Node js want to reinvent the wheel. I still think node js and the likes are crap

Vob Bobily

So after reading your article I still havent figured out why Node js want to reinvent the wheel. I still think node js and the likes are crap

cintalauraramarimari

A great introduction to find out what it is JavaScript and once the answer to from bagaimana tips mengatasi wanita frigid

cintalauraramarimari

A great introduction to find out what it is JavaScript and once the answer to from bagaimana tips mengatasi wanita frigid

Daniel

Noob questions. Um, isn't the ease with which you can move request data (i. e. untrusted data) into database (where data is assumed to be trusted) a big hazard? How do you ensure that you never forget to inspect every piece of incoming data when it arrives, before you start trusting it? Generally, I would assume something as popular as Node. js would have thought of this, but I remember back when Rails had blanket model update. That changed real quick when Github's use of this "feature" was exploited (fortunately, by a whitehat). Also, of course, just because you add a conversion speed bump does not mean that people won't make mistakes, but at least they're more likely to give it some thought, which probably means they're going to make less mistakes

Daniel

Noob questions. Um, isn't the ease with which you can move request data (i. e. untrusted data) into database (where data is assumed to be trusted) a big hazard? How do you ensure that you never forget to inspect every piece of incoming data when it arrives, before you start trusting it? Generally, I would assume something as popular as Node. js would have thought of this, but I remember back when Rails had blanket model update. That changed real quick when Github's use of this "feature" was exploited (fortunately, by a whitehat). Also, of course, just because you add a conversion speed bump does not mean that people won't make mistakes, but at least they're more likely to give it some thought, which probably means they're going to make less mistakes

Q

I don't understand the angst against using an ORM. Were you in a proper environment where concerns were separated? The ones bashing ORM just sound like they don't know what they're doing or how to engineer proper software. Why on earth would I want to go from writing software in Java/C#/_whatever_ to drop into SQL where it is hard to version, properly test, and can apparently cause severe brain damage? Everything is a double edged sword - an implementation or a convention like using an ORM over raw SQL really doesn't matter. Depending on the situation raw SQL might be best. it might be better to use a NoSQL store. maybe an ORM is fine. Usually, from my experience, I can tell you that an ORM is better for a lot of reasons, and they have been relayed by M. I spent the time to write my own libraries to abstract vendor specific implementations and you need to create your own mappings. You can easily spawn from a certain state or use existing data structures. It took time to write my libraries and it was not easy at all to do it but it was well worth my time to do it since I can now reuse my libraries. Nó có phải là TỐT NHẤT không? . Tôi thích nó nhưng tôi chắc chắn sẽ không đi đến các bài báo kỹ thuật tùy tiện không liên quan gì đến SQL và đăng những thứ như "Vâng, công nghệ này tốt nhưng hãy tránh xa SQL thô. " Tôi không thấy cần phải đả kích bất cứ thứ gì ở đây, đặc biệt là ORM khi bài viết chỉ nói về JS và NodeJS

Q

I don't understand the angst against using an ORM. Were you in a proper environment where concerns were separated? The ones bashing ORM just sound like they don't know what they're doing or how to engineer proper software. Why on earth would I want to go from writing software in Java/C#/_whatever_ to drop into SQL where it is hard to version, properly test, and can apparently cause severe brain damage? Everything is a double edged sword - an implementation or a convention like using an ORM over raw SQL really doesn't matter. Depending on the situation raw SQL might be best. it might be better to use a NoSQL store. maybe an ORM is fine. Usually, from my experience, I can tell you that an ORM is better for a lot of reasons, and they have been relayed by M. I spent the time to write my own libraries to abstract vendor specific implementations and you need to create your own mappings. You can easily spawn from a certain state or use existing data structures. It took time to write my libraries and it was not easy at all to do it but it was well worth my time to do it since I can now reuse my libraries. Nó có phải là TỐT NHẤT không? . Tôi thích nó nhưng tôi chắc chắn sẽ không đi đến các bài báo kỹ thuật tùy tiện không liên quan gì đến SQL và đăng những thứ như "Vâng, công nghệ này tốt nhưng hãy tránh xa SQL thô. " Tôi không thấy cần phải đả kích bất cứ thứ gì ở đây, đặc biệt là ORM khi bài viết chỉ nói về JS và NodeJS

Michael

Probably one of the main points of this article, that gives Node is supposed scalability, is the offloading to a Queue or Service Bus that leads to asynchronous processing. That is a well proven architectural pattern, available in many languages, is especially used in CQRS (Command Query Responsibility Segregation) with Event Sourcing, is very well suited to be used by technologies such . Net Reactive Extensions that provide considerably greater functionality and flexibility than Node. Asynchronous programming and handling its pitfalls has been around without Node for years, if you had knowledge of enterprise development. As for the hate against ORMs. you guys crticising it seem to be moving from front-end development into an area where you have no knowledge or expertise in OO, BDD, TDD or any other proven Enterprise level methodology. No concept of integration other than Twitter feeds. No experience of complex Workflow or scalable caching. This is one of the dangers - you know JavaScript, and a bit of SQL. So everything else is superfluous - until you need it, such as the attempts to bring an element of type checking to JavaScript. Seriously, each technology has its place, but there is no one size fits all approach. Appreciate the strengths of each technology, and use them where appropriate

Michael

Probably one of the main points of this article, that gives Node is supposed scalability, is the offloading to a Queue or Service Bus that leads to asynchronous processing. That is a well proven architectural pattern, available in many languages, is especially used in CQRS (Command Query Responsibility Segregation) with Event Sourcing, is very well suited to be used by technologies such . Net Reactive Extensions that provide considerably greater functionality and flexibility than Node. Asynchronous programming and handling its pitfalls has been around without Node for years, if you had knowledge of enterprise development. As for the hate against ORMs. you guys crticising it seem to be moving from front-end development into an area where you have no knowledge or expertise in OO, BDD, TDD or any other proven Enterprise level methodology. No concept of integration other than Twitter feeds. No experience of complex Workflow or scalable caching. This is one of the dangers - you know JavaScript, and a bit of SQL. So everything else is superfluous - until you need it, such as the attempts to bring an element of type checking to JavaScript. Seriously, each technology has its place, but there is no one size fits all approach. Appreciate the strengths of each technology, and use them where appropriate

Reo

Great introduction to node. js. Thanks, i samo naprjed

Reo

Great introduction to node. js. Thanks, i samo naprjed

Richard Bellantoni

Bởi vì chúng không phù hợp với một ứng dụng phức tạp. Chắc chắn nếu kịch bản của bạn mà bạn đã dành toàn bộ thời gian để cố gắng làm cho ORM hoạt động theo cách bạn cần, thì bạn có thể chỉ cần nỗ lực như vậy để viết SQL đúng cách và đảm bảo rằng nó được tổ chức, v.v. và bạn sẽ tiến xa hơn trong . ORM's are great at saving time on a small to medium scale project, but once you delve into more complex and larger applications, you're going to spend either A. ) A lot of time coding to make the ORM work the way you need it or B. ) Just decide to write the SQL yourself because the time it takes to make the tool work how you need it just isn't worth it

Richard Bellantoni

Bởi vì chúng không phù hợp với một ứng dụng phức tạp. Chắc chắn nếu kịch bản của bạn mà bạn đã dành toàn bộ thời gian để cố gắng làm cho ORM hoạt động theo cách bạn cần, thì bạn có thể chỉ cần nỗ lực như vậy để viết SQL đúng cách và đảm bảo rằng nó được tổ chức, v.v. và bạn sẽ tiến xa hơn trong . ORM's are great at saving time on a small to medium scale project, but once you delve into more complex and larger applications, you're going to spend either A. ) A lot of time coding to make the ORM work the way you need it or B. ) Just decide to write the SQL yourself because the time it takes to make the tool work how you need it just isn't worth it

sinta maharani

JavaScript is better than some of the other programming languages. therefore cara menghilangkan gatal keputihan better fit with JavaScript

sinta maharani

JavaScript is better than some of the other programming languages. therefore cara menghilangkan gatal keputihan better fit with JavaScript

naseya10

Great, informative article. Thanks for sharing this. Unlockpwd

naseya10

Great, informative article. Thanks for sharing this. Unlockpwd

Eric Elliott

Pot, meet kettle. Those may be intractable problems if any of them were true. None of them are. 1. a) JavaScript is all JIT these days and delivers 1-2x native code performance (faster than any other dynamic language I'm aware of). b) Non-blocking by default can deliver orders-of-magnitude improvements in code efficiency - transparently. 2. Almost all modern editors support type inference for JS. ESLint, Closure Compiler, and a number of other options offer sophisticated static analysis capabilities. TypeScript even offers a nice structural type system. 3. The opposite of modular is a tightly coupled monolith. That's a bad idea in ANY language. 4. "if all you are doing is waiting for some other IO bound process" - Non-blocking by default means you're NEVER waiting for some other IO bound process. That's why Node delivers such huge improvements on resource utilization. 5. 2006 called. They want their language-snob attitude back. The days when serious engineers considered JS to be a toy are long since over. JS powers sophisticated enterprise applications at just about every fortune 500 today. Additional point. JS is the only language with fully native support for isomorphic code (meaning you reuse most of your application on both servers and clients). You can write JS ONCE, and it will power the server, the web browser, and mobile devices including iOS and Android. See React Native. https. //leanpub. com/learning-javascript-react-nodejs-es6/

Eric Elliott

Pot, meet kettle. Those may be intractable problems if any of them were true. None of them are. 1. a) JavaScript is all JIT these days and delivers 1-2x native code performance (faster than any other dynamic language I'm aware of). b) Non-blocking by default can deliver orders-of-magnitude improvements in code efficiency - transparently. 2. Almost all modern editors support type inference for JS. ESLint, Closure Compiler, and a number of other options offer sophisticated static analysis capabilities. TypeScript even offers a nice structural type system. 3. The opposite of modular is a tightly coupled monolith. That's a bad idea in ANY language. 4. "if all you are doing is waiting for some other IO bound process" - Non-blocking by default means you're NEVER waiting for some other IO bound process. That's why Node delivers such huge improvements on resource utilization. 5. 2006 called. They want their language-snob attitude back. The days when serious engineers considered JS to be a toy are long since over. JS powers sophisticated enterprise applications at just about every fortune 500 today. Additional point. JS is the only language with fully native support for isomorphic code (meaning you reuse most of your application on both servers and clients). You can write JS ONCE, and it will power the server, the web browser, and mobile devices including iOS and Android. See React Native. https. //leanpub. com/learning-javascript-react-nodejs-es6/

M

1) Hiệu suất mã gốc gấp 1-2 lần? . 2) Suy luận kiểu đang ánh xạ các khai báo biến thành các kiểu không có cú pháp rõ ràng, tôi. e. , a) nó yêu cầu các loại thực tế và b) trình biên dịch thực thi an toàn loại, không phải trình chỉnh sửa. Và bạn có thể trang trí nó theo bất kỳ cách nào bạn muốn, nhưng không có cách nào để thực thi phân tích trạng thái phức tạp với các từ điển cẩu thả của bất kỳ thứ gì được lưu trữ trong chuỗi và các đại biểu chức năng. Ngoài ra, Bản mô tả không phải là Javascript, nó là Javascript với hệ thống loại nửa vời được dán lên trên. Ngay cả Google cũng đang từ bỏ Js cho Bản mô tả trong Angular 2. 0 Why? Because Google has decided that an untyped system is insufficient for serious work. But is that type system anywhere near as sophisticated as a compiled language? Nope, not even close. 3) You are misunderstanding what I was characterizing as "modular design". The alternative is not monolithic code, but encapsulation, specialization via inheritance (or prototyping), polymorphism, and externalizing dependencies via IoC. The alternative is SOLID, i. e. , modern Object Orientation. 4) Your process may not be waiting, but your customers are waiting for the callback. My point is that being able to serve more requests doesn't do you any good if every served request then has to wait on yet another operation. In the end, somewhere somehow, you will eventually be going to a disk or waiting for IO, because that's where the information the customer wants lives. 5) I didn't say that JavaScript was a toy language, I said that most JavaScript developers are well-meaning, cut and paste amateurs, and they will invade the ranks of node. js developers as it becomes more popular. I'll take a strong type system over "full native support" (that's not native) for "isometric" code that can run on clients or servers [you say that like that's a good thing] any day. Wow, Js on android and iOS. I guess the days of Apple adding another strongly typed, native language for iOS are over Obviously you've never heard of Mono, the cross platform . Net that compiles and runs on every major OS, produces native runtimes for all three major mobile platforms, and runs on everything from beowulf clusters to wearable devices. This is why we don't respect you. You don't know or understand anything that came before, or anything outside of your javascript bubble. You don't solve any problems that weren't solved before, but yet you're convinced you have all the answers. That seems to be a common theme with anyone whose education system stressed self-esteem over critical thinking

M

1) Hiệu suất mã gốc gấp 1-2 lần? . 2) Suy luận kiểu đang ánh xạ các khai báo biến thành các kiểu không có cú pháp rõ ràng, tôi. e. , a) nó yêu cầu các loại thực tế và b) trình biên dịch thực thi an toàn loại, không phải trình chỉnh sửa. Và bạn có thể trang trí nó theo bất kỳ cách nào bạn muốn, nhưng không có cách nào để thực thi phân tích trạng thái phức tạp với các từ điển cẩu thả của bất kỳ thứ gì được lưu trữ trong chuỗi và các đại biểu chức năng. Ngoài ra, Bản mô tả không phải là Javascript, nó là Javascript với hệ thống loại nửa vời được dán lên trên. Ngay cả Google cũng đang từ bỏ Js cho Bản mô tả trong Angular 2. 0 Why? Because Google has decided that an untyped system is insufficient for serious work. But is that type system anywhere near as sophisticated as a compiled language? Nope, not even close. 3) You are misunderstanding what I was characterizing as "modular design". The alternative is not monolithic code, but encapsulation, specialization via inheritance (or prototyping), polymorphism, and externalizing dependencies via IoC. The alternative is SOLID, i. e. , modern Object Orientation. 4) Your process may not be waiting, but your customers are waiting for the callback. My point is that being able to serve more requests doesn't do you any good if every served request then has to wait on yet another operation. In the end, somewhere somehow, you will eventually be going to a disk or waiting for IO, because that's where the information the customer wants lives. 5) I didn't say that JavaScript was a toy language, I said that most JavaScript developers are well-meaning, cut and paste amateurs, and they will invade the ranks of node. js developers as it becomes more popular. I'll take a strong type system over "full native support" (that's not native) for "isometric" code that can run on clients or servers [you say that like that's a good thing] any day. Wow, Js on android and iOS. I guess the days of Apple adding another strongly typed, native language for iOS are over Obviously you've never heard of Mono, the cross platform . Net that compiles and runs on every major OS, produces native runtimes for all three major mobile platforms, and runs on everything from beowulf clusters to wearable devices. This is why we don't respect you. You don't know or understand anything that came before, or anything outside of your javascript bubble. You don't solve any problems that weren't solved before, but yet you're convinced you have all the answers. That seems to be a common theme with anyone whose education system stressed self-esteem over critical thinking

Eric Elliott

This reply just strikes me as willful ignorance. 1. Really? Rather than investigate and learn the truth, you just want to ridicule the answer? I'm not taking the bait. Watch Brendan Eich's Fluent talks if you're interested in actually learning something. 2. I know what types and type inference are, and I know the benefits of static types. I've been in this game since before JavaScript was invented. TypeScript is a superset of JavaScript that compiles to JS & allows for sophisticated static analysis. It's structural type system is better than the type system Java had back when I was coding in Java, and it's much better (as in more reliable and flexible) than C and C++. 3. "encapsulation, specialization via inheritance (or prototyping), polymorphism, and externalizing dependencies via IoC" - these are all forms of modularity, and JavaScript modules provide viable alternatives to all of them - and in the case of class inheritance, it's far superior. See https. //medium. com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3 4. "your customers are waiting for the callback. " Fortunately, that's where the performance I talked about in point 1 shines. JS provides efficient utilization of I/O resources. In fact, dealing with I/O bottlenecks is the entire reason that Node was invented. I've ported several large production projects from PHP and Ruby to Node, and seen dramatic reductions in response times, both average response times and response time ranges - and since a typical Node app utilizes a small fraction of the memory required for C# applications, your customer I/O competes less with the RAM paging you might experience with a compiled C# application. 5. "you say that like that's a good thing" I've seen objectively measurable increases in team velocity ranging from 40% - 60% improvements. Believe it or not, it's a fact, and being more able to adapt to changing needs and experiment more (particularly in the UI layer) delivers very real business value. Why do you think so many enterprise organizations are adopting Node? It's not because some dev prefers JS. It's because they ran the tests themselves and figured out it's a huge win. "Obviously you've never heard of Mono, the cross platform . Net that compiles and runs on every major OS" Yeah, I have - what I haven't heard of is Mono delivering anywhere near the value that Node delivers in enterprise production. Got a good article on that? 'Cause a quick Google search isn't turning up much. Check out this awesome result in the top 3 of the SERP. http. //www. quora. com/Why-isnt-C-with-Mono-popular-for-enterprise-applications-on-Linux-servers . but a quick Google search for Enterprise Node. js delivers quite a bit. Here are the top 3 search results I see. http. //blog. risingstack. com/node-js-is-enterprise-ready/ https. //www. joyent. com/nodejs-support https. //www. centurylinkcloud. com/blog/post/node-js-is-taking-over-the-enterprise-whether-you-like-it-or-not/ There's really no contest here

Eric Elliott

This reply just strikes me as willful ignorance. 1. Really? Rather than investigate and learn the truth, you just want to ridicule the answer? I'm not taking the bait. Watch Brendan Eich's Fluent talks if you're interested in actually learning something. 2. I know what types and type inference are, and I know the benefits of static types. I've been in this game since before JavaScript was invented. TypeScript is a superset of JavaScript that compiles to JS & allows for sophisticated static analysis. It's structural type system is better than the type system Java had back when I was coding in Java, and it's much better (as in more reliable and flexible) than C and C++. 3. "encapsulation, specialization via inheritance (or prototyping), polymorphism, and externalizing dependencies via IoC" - these are all forms of modularity, and JavaScript modules provide viable alternatives to all of them - and in the case of class inheritance, it's far superior. See https. //medium. com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3 4. "your customers are waiting for the callback. " Fortunately, that's where the performance I talked about in point 1 shines. JS provides efficient utilization of I/O resources. In fact, dealing with I/O bottlenecks is the entire reason that Node was invented. I've ported several large production projects from PHP and Ruby to Node, and seen dramatic reductions in response times, both average response times and response time ranges - and since a typical Node app utilizes a small fraction of the memory required for C# applications, your customer I/O competes less with the RAM paging you might experience with a compiled C# application. 5. "you say that like that's a good thing" I've seen objectively measurable increases in team velocity ranging from 40% - 60% improvements. Believe it or not, it's a fact, and being more able to adapt to changing needs and experiment more (particularly in the UI layer) delivers very real business value. Why do you think so many enterprise organizations are adopting Node? It's not because some dev prefers JS. It's because they ran the tests themselves and figured out it's a huge win. "Obviously you've never heard of Mono, the cross platform . Net that compiles and runs on every major OS" Yeah, I have - what I haven't heard of is Mono delivering anywhere near the value that Node delivers in enterprise production. Got a good article on that? 'Cause a quick Google search isn't turning up much. Check out this awesome result in the top 3 of the SERP. http. //www. quora. com/Why-isnt-C-with-Mono-popular-for-enterprise-applications-on-Linux-servers . but a quick Google search for Enterprise Node. js delivers quite a bit. Here are the top 3 search results I see. http. //blog. risingstack. com/node-js-is-enterprise-ready/ https. //www. joyent. com/nodejs-support https. //www. centurylinkcloud. com/blog/post/node-js-is-taking-over-the-enterprise-whether-you-like-it-or-not/ There's really no contest here

M

1, yes, I'm mocking your evidently accidental claim that JavaScript makes electrons run faster, or even as fast as native, because it's patent nonsense. Not only is that impossible, it ignores one of node. js' acknowledged weaknesses. It sucks on compute intensive operations, because it's single threaded, which means compute intensive operations block execution. duh. 2. Your knowledge of Java does not qualify you to understand what a competent type system is. Java's generics are a largely useless, johnny come lately me-too feature when compared against to C# generics because they suffer from run-time erasure, in other words, the generic type safety and reflection only works at compile time, because at run time, everything is cast to an object. So when you are going on about static analysis, you are effectively trying to claim it's as good as compile time + run time type reflection, which is very far from the truth. 3. Meh. Chopping up everything into discrete functions is a form of modularity too, but it's vastly inferior to SOLID, which was my point in the first place. And while prototype based inheritance is interesting, it's hardly better than real inheritance, which permits far more flexible arrangements. 4. I don't see how it's impressive to speed up a Ruby app, or refactor some craptastic PHP into something faster. Your memory overhead claims are equally baseless. I can run micro. Net on a watch or on an arduino device. I can write . Net that runs very well on an under-powered phone. Look at the memory chrome consumes for an SPA, or try to run a complex javascript app on a tablet, and then tell me how "lightweight" JavaScript is. 5. The lack of a proper separation of concerns (which is the cause of most maintainability problems) is the number one issue I encounter at enterprise scaled customers, and an impressive team velocity is always how they got there. Why do I think a number of organizations are choosing node? Because typically a mediocre, over-sized team of moderate competence f'd up the previously shiny new thing that was supposed to solve all their problems, so they want to believe the hype that the problem is not them, but their previous technology choices

M

1, yes, I'm mocking your evidently accidental claim that JavaScript makes electrons run faster, or even as fast as native, because it's patent nonsense. Not only is that impossible, it ignores one of node. js' acknowledged weaknesses. It sucks on compute intensive operations, because it's single threaded, which means compute intensive operations block execution. duh. 2. Your knowledge of Java does not qualify you to understand what a competent type system is. Java's generics are a largely useless, johnny come lately me-too feature when compared against to C# generics because they suffer from run-time erasure, in other words, the generic type safety and reflection only works at compile time, because at run time, everything is cast to an object. So when you are going on about static analysis, you are effectively trying to claim it's as good as compile time + run time type reflection, which is very far from the truth. 3. Meh. Chopping up everything into discrete functions is a form of modularity too, but it's vastly inferior to SOLID, which was my point in the first place. And while prototype based inheritance is interesting, it's hardly better than real inheritance, which permits far more flexible arrangements. 4. I don't see how it's impressive to speed up a Ruby app, or refactor some craptastic PHP into something faster. Your memory overhead claims are equally baseless. I can run micro. Net on a watch or on an arduino device. I can write . Net that runs very well on an under-powered phone. Look at the memory chrome consumes for an SPA, or try to run a complex javascript app on a tablet, and then tell me how "lightweight" JavaScript is. 5. The lack of a proper separation of concerns (which is the cause of most maintainability problems) is the number one issue I encounter at enterprise scaled customers, and an impressive team velocity is always how they got there. Why do I think a number of organizations are choosing node? Because typically a mediocre, over-sized team of moderate competence f'd up the previously shiny new thing that was supposed to solve all their problems, so they want to believe the hype that the problem is not them, but their previous technology choices

Eric Elliott

1. I think you misunderstood my meaning. JS runs 1-2x SLOWER than native -- much better perf than any other dynamic language I know of. It's fast enough to run AAA game engines like Unreal Engine and Unity in stunning quality at 60+ fps. 2. I actually think that a good native type tool would be a good addition to JavaScript, but only if they're user-definable structural types. That said, JavaScript does support static analysis via type inference, and there are a number of ways to provide type hints for dev tools. In addition, JavaScript also has an impressive array of runtime analysis tools. 3. "hardly better than real inheritance, which permits far more flexible arrangements. " Wrong. https. //medium. com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3 4. My apologies. I was not aware of micro. Net. JavaScript also runs as-is on low-powered devices including Arduino, Tessel, and a number of others. Node works great on most of them. If that's not small enough, you can create a custom Node compile, drop features, even swap out the V8 engine for a different JS engine if you need to. You can also restrict yourself to using tiny JS libraries (of which there are many on npm) to keep your codebase compact. 5. ". they want to believe the hype that the problem is not them, but their previous technology choices. " That might explain an experiment or two, but the Node takeover is much more than that. We're rapidly replacing apps in a variety of languages with Node. Having worked at a fortune 500 during the transition to Node, I can tell you our justifications. Chúng tôi đã thử nghiệm chuyển sang Node, đã tìm thấy. 1. that the app was faster and more reliable, delivering huge wins in both average response time, and the number of requests we could serve with the same machine, and 2. Các nhà phát triển đã làm việc hiệu quả hơn vì nhiều lý do, bao gồm cả việc các chuyên gia JavaScript có thể làm việc dễ dàng hơn trên cả hai mặt của ngăn xếp mà không cần chuyển ngữ cảnh và nhiều mã có thể được chia sẻ ở cả máy chủ và máy khách. Những lợi thế đó có ảnh hưởng thực sự, có thể đo lường được đến lợi nhuận của công ty. That's why Node is taking over at both startups and enterprise companies

Eric Elliott

1. I think you misunderstood my meaning. JS runs 1-2x SLOWER than native -- much better perf than any other dynamic language I know of. It's fast enough to run AAA game engines like Unreal Engine and Unity in stunning quality at 60+ fps. 2. I actually think that a good native type tool would be a good addition to JavaScript, but only if they're user-definable structural types. That said, JavaScript does support static analysis via type inference, and there are a number of ways to provide type hints for dev tools. In addition, JavaScript also has an impressive array of runtime analysis tools. 3. "hardly better than real inheritance, which permits far more flexible arrangements. " Wrong. https. //medium. com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3 4. My apologies. I was not aware of micro. Net. JavaScript also runs as-is on low-powered devices including Arduino, Tessel, and a number of others. Node works great on most of them. If that's not small enough, you can create a custom Node compile, drop features, even swap out the V8 engine for a different JS engine if you need to. You can also restrict yourself to using tiny JS libraries (of which there are many on npm) to keep your codebase compact. 5. ". they want to believe the hype that the problem is not them, but their previous technology choices. " That might explain an experiment or two, but the Node takeover is much more than that. We're rapidly replacing apps in a variety of languages with Node. Having worked at a fortune 500 during the transition to Node, I can tell you our justifications. Chúng tôi đã thử nghiệm chuyển sang Node, đã tìm thấy. 1. that the app was faster and more reliable, delivering huge wins in both average response time, and the number of requests we could serve with the same machine, and 2. Các nhà phát triển đã làm việc hiệu quả hơn vì nhiều lý do, bao gồm cả việc các chuyên gia JavaScript có thể làm việc dễ dàng hơn trên cả hai mặt của ngăn xếp mà không cần chuyển ngữ cảnh và nhiều mã có thể được chia sẻ ở cả máy chủ và máy khách. Những lợi thế đó có ảnh hưởng thực sự, có thể đo lường được đến lợi nhuận của công ty. That's why Node is taking over at both startups and enterprise companies

Kesava Velugubantla

especially with edge it is really handy

Kesava Velugubantla

especially with edge it is really handy

pawan kumar

Thanks Tamisalv I was looking for quick reference read for understanding node. js and why projects might use it. Reading this gave me a better understanding of advantages of this this technology and also when one might use it. Cheers

pawan kumar

Thanks Tamisalv I was looking for quick reference read for understanding node. js and why projects might use it. Reading this gave me a better understanding of advantages of this this technology and also when one might use it. Cheers

Jay

"After over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections. " As a result we have webpages which take longer to load nowadays when we have Internet speeds in the order of megabytes per second, than back in the day when our speeds were in the order of bytes per second but our webpages were plain simple HTML. Nowadays we have webpages which load halfway and then stop, which crash at the slightest network error i. e. dynamic IP address reassigning, or a momentary lapse in the WiFi signal forcing you to reload the whole page, whereas browsers are designed to gracefully handle those errors or resume once the network connection is restored, buggy Javascript scripts don't handle errors as well

Jay

"After over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections. " As a result we have webpages which take longer to load nowadays when we have Internet speeds in the order of megabytes per second, than back in the day when our speeds were in the order of bytes per second but our webpages were plain simple HTML. Nowadays we have webpages which load halfway and then stop, which crash at the slightest network error i. e. dynamic IP address reassigning, or a momentary lapse in the WiFi signal forcing you to reload the whole page, whereas browsers are designed to gracefully handle those errors or resume once the network connection is restored, buggy Javascript scripts don't handle errors as well

adroittech

I only have 1 question here with your statement. "It's structural type system is better than the type system Java had back when I was coding in Java, and it's much better (as in more reliable and flexible) than C and C++. " I can not take that. How? can you examplify? Some Facts (with obviously answer in no) - Why did Node inventor used V8 engine which was made in C++ to power node, if the js type system was so flexible and much better? - Can nodejs decode vp8 codec video by itself as efficiently as C/C++? - Could you build nodejs on top of pure javascript instead of C++? - Is there any such thing as pure javascript? You really have to understand my friend that it is a type system that can take advantage of underlying hardware and makes your program efficient at CPU and memory. Strongly typed C++ can solve any problem, even build node js. Node shines at non-blocking i/o and that is about it, it can not do anything else. Yes you can chop-off node code and make it work on micro devices but will it be efficient and make sense? Can you make product like node where you have to code in C++, yes you can but it would not make sense as power of C/C++ in not in web, its optimizations and hardware. It not like non-blocking I/O is something new, we have had that in many technologies including java, . Net, basic, python and perl, this is very old. The only reason why this thing is in limelight is it has enabled millions of frontend javascript developers, who do not understand pointers and bash about C++, to write server code, which is simply overwhelming, that's why the buzz. And about "Node in particular are actually very well suited to handle distributed computation", why on earth one would write such a statement? Node is not made for computation. it can not compute as efficiently as C/C++/Java. Period. With all due respect, lets not bring C++ in picture here, there is simply no practical comparison at all, or it will be very touchy

adroittech

I only have 1 question here with your statement. "It's structural type system is better than the type system Java had back when I was coding in Java, and it's much better (as in more reliable and flexible) than C and C++. " I can not take that. How? can you examplify? Some Facts (with obviously answer in no) - Why did Node inventor used V8 engine which was made in C++ to power node, if the js type system was so flexible and much better? - Can nodejs decode vp8 codec video by itself as efficiently as C/C++? - Could you build nodejs on top of pure javascript instead of C++? - Is there any such thing as pure javascript? You really have to understand my friend that it is a type system that can take advantage of underlying hardware and makes your program efficient at CPU and memory. Strongly typed C++ can solve any problem, even build node js. Node shines at non-blocking i/o and that is about it, it can not do anything else. Yes you can chop-off node code and make it work on micro devices but will it be efficient and make sense? Can you make product like node where you have to code in C++, yes you can but it would not make sense as power of C/C++ in not in web, its optimizations and hardware. It not like non-blocking I/O is something new, we have had that in many technologies including java, . Net, basic, python and perl, this is very old. The only reason why this thing is in limelight is it has enabled millions of frontend javascript developers, who do not understand pointers and bash about C++, to write server code, which is simply overwhelming, that's why the buzz. And about "Node in particular are actually very well suited to handle distributed computation", why on earth one would write such a statement? Node is not made for computation. it can not compute as efficiently as C/C++/Java. Period. With all due respect, lets not bring C++ in picture here, there is simply no practical comparison at all, or it will be very touchy

Eric Elliott

You may be interested in this. https. //medium. com/javascript-scene/what-is-webassembly-the-dawn-of-a-new-era-61256ec5a8f6

Eric Elliott

You may be interested in this. https. //medium. com/javascript-scene/what-is-webassembly-the-dawn-of-a-new-era-61256ec5a8f6

Ken Kopelson

Actually, Javascript in the V8 server engine is QUITE fast. The statement that Javascript is not fast is outdated. You combine Node with Chrome and you get a very fast environment. If you understand how Node works, it has an event loop that processes all code that is ready to run. So, you call a function that has a blocking database call inside and a callback when finished, it allows the the function to be called, which returns immediately allowing you to get on with other things while the database call is being processed. So you aren't "hurry-up and waiting" as you suppose. You get on with other things, and once the database call finishes, execution will continue to the callback which is invoked after the database call returns. So, you get the same basic abilities as a multi-threaded environment without all the extra overhead incurred by thread-state swapping. Because you don't get "time slicing" you have to be careful that no piece of code takes too long to run, and if it does, you just break it up using packages like "async". I come from a long C, C++, Delphi, Java background, having mastered the multi-threaded paradigm, and I can state assuredly that the Node single-threaded async paradigm is super cool, fast, and highly scalable. IF YOU KNOW WHAT YOU'RE DOING. But that's the same for any of the other technologies as well. None of these technologies are for neophytes

Ken Kopelson

Actually, Javascript in the V8 server engine is QUITE fast. The statement that Javascript is not fast is outdated. You combine Node with Chrome and you get a very fast environment. If you understand how Node works, it has an event loop that processes all code that is ready to run. So, you call a function that has a blocking database call inside and a callback when finished, it allows the the function to be called, which returns immediately allowing you to get on with other things while the database call is being processed. So you aren't "hurry-up and waiting" as you suppose. You get on with other things, and once the database call finishes, execution will continue to the callback which is invoked after the database call returns. So, you get the same basic abilities as a multi-threaded environment without all the extra overhead incurred by thread-state swapping. Because you don't get "time slicing" you have to be careful that no piece of code takes too long to run, and if it does, you just break it up using packages like "async". I come from a long C, C++, Delphi, Java background, having mastered the multi-threaded paradigm, and I can state assuredly that the Node single-threaded async paradigm is super cool, fast, and highly scalable. IF YOU KNOW WHAT YOU'RE DOING. But that's the same for any of the other technologies as well. None of these technologies are for neophytes

M

A complex application is precisely where well tailored Domain objects and properly decoupled subsystems are most necessary. If you are spending all your time trying to get the ORM to work you should either learn that ORM better or get another ORM. I would assume the former goes without saying so if you are still fighting your ORM it's time to choose one that just works

M

A complex application is precisely where well tailored Domain objects and properly decoupled subsystems are most necessary. If you are spending all your time trying to get the ORM to work you should either learn that ORM better or get another ORM. I would assume the former goes without saying so if you are still fighting your ORM it's time to choose one that just works

M

Excepting your last comment that these technologies are not for neophytes, I think you are ignoring the last two paragraphs you were responding to. Even the founder of node. js says to avoid compute intensive operations. Yes, V8 speeds up javascript, but that doesn't solve the problem of a compute intensive operation or IO dependent operations blocking a single thread. You then respond that node. js is non-blocking and therefore it can be awaited. Great, I got that, sure, but what are you waiting on? Some code that isn't written in node. js apparently, (so much for the claimed benefit of "one true language to rule them all"), because your single threaded node. js process is happily moved on to something else until the callback. So, node. js works great just as long as you can rely on other processes handling the workload that is blocking (like waiting for IO), or another instance of single threaded node. js, that will (if written "correctly") undoubtable kick the can down the road to yet another process. And that's the issue. there are a limited subset of stuff done in programs that can be executed in parallel/out of order, and/or doesn't rely on blocking operations. Multi-threading is more complicated and has some overhead every time there is a context switch, but it means that more cores can be thrown at parallelizable units of work, and even discrete operations can be handled by the different threads. In a "node. js solves everything" world, you are either relying on something not written in node. js or waiting for your single threaded node. js application to finish up all the stuff that must be done, one way or another

M

Excepting your last comment that these technologies are not for neophytes, I think you are ignoring the last two paragraphs you were responding to. Even the founder of node. js says to avoid compute intensive operations. Yes, V8 speeds up javascript, but that doesn't solve the problem of a compute intensive operation or IO dependent operations blocking a single thread. You then respond that node. js is non-blocking and therefore it can be awaited. Great, I got that, sure, but what are you waiting on? Some code that isn't written in node. js apparently, (so much for the claimed benefit of "one true language to rule them all"), because your single threaded node. js process is happily moved on to something else until the callback. So, node. js works great just as long as you can rely on other processes handling the workload that is blocking (like waiting for IO), or another instance of single threaded node. js, that will (if written "correctly") undoubtable kick the can down the road to yet another process. And that's the issue. there are a limited subset of stuff done in programs that can be executed in parallel/out of order, and/or doesn't rely on blocking operations. Multi-threading is more complicated and has some overhead every time there is a context switch, but it means that more cores can be thrown at parallelizable units of work, and even discrete operations can be handled by the different threads. In a "node. js solves everything" world, you are either relying on something not written in node. js or waiting for your single threaded node. js application to finish up all the stuff that must be done, one way or another

Ken Kopelson

You know what? You seem to just like spouting on about something you are clearly not qualified to speak about. You obviously have never built anything serious in Node. js. Well, I have, and I can tell you that it works great if you actually program it correctly. That means you use things like job queues, you use the clustering that Node provides, you make sure you do everything with callbacks and promises, you use "async" and "setImmediate" to properly share the processor between code that is waiting and code can now execute, you make sure UI code has priority over CPU intensive code, etc. For example, I wrote an "async" heap sort algorithm that works great, sorting massive lists while not blocking for any appreciable amount of time. I also have a 5000 line heuristic algorithm that is quite complex that I split up so that the main loops are executed using async constructs. I then have these executed from a job queue called "Kue" that allows for efficient use of all cores, no threads, great UI response time, and complex calculation jobs being executed in the background using all available processor power. This is ALL done in javascript with excellent performance in both CPU intensive tasks and response to front-end data requests. In other words mate, the UI is super responsive, and the background processing (complex heuristic calculation) performed quickly and very responsively. This is all done with a single language for both backend and front end, which is a huge deal when it comes to system architecture

Ken Kopelson

You know what? You seem to just like spouting on about something you are clearly not qualified to speak about. You obviously have never built anything serious in Node. js. Well, I have, and I can tell you that it works great if you actually program it correctly. That means you use things like job queues, you use the clustering that Node provides, you make sure you do everything with callbacks and promises, you use "async" and "setImmediate" to properly share the processor between code that is waiting and code can now execute, you make sure UI code has priority over CPU intensive code, etc. For example, I wrote an "async" heap sort algorithm that works great, sorting massive lists while not blocking for any appreciable amount of time. I also have a 5000 line heuristic algorithm that is quite complex that I split up so that the main loops are executed using async constructs. I then have these executed from a job queue called "Kue" that allows for efficient use of all cores, no threads, great UI response time, and complex calculation jobs being executed in the background using all available processor power. This is ALL done in javascript with excellent performance in both CPU intensive tasks and response to front-end data requests. In other words mate, the UI is super responsive, and the background processing (complex heuristic calculation) performed quickly and very responsively. This is all done with a single language for both backend and front end, which is a huge deal when it comes to system architecture

Jacob Ross

Why are they not for "neophytes"? Is it alcoholic?

Jacob Ross

Why are they not for "neophytes"? Is it alcoholic?

Jacob Ross

I agree. Most times that I think an ORM is inadequate for complex queries, I write out raw SQL, later to find out the ORM has an "app for that". I like using an ORM as much as possible, but I won't spend too much time making it work for me, otherwise, as M said, I'll find another ORM

Jacob Ross

I agree. Most times that I think an ORM is inadequate for complex queries, I write out raw SQL, later to find out the ORM has an "app for that". I like using an ORM as much as possible, but I won't spend too much time making it work for me, otherwise, as M said, I'll find another ORM

JF80

Sounds like the words from a "Michael" I know. ;) I agree with your last statement. "each technology has it place". But why do you assume all Node developers are front-end developers with no back-end knowledge? Why is it NOT possible for these developers to make a scalable solution? Like or not Node is being used in Enterprise today and will continue to be adopted

JF80

Sounds like the words from a "Michael" I know. ;) I agree with your last statement. "each technology has it place". But why do you assume all Node developers are front-end developers with no back-end knowledge? Why is it NOT possible for these developers to make a scalable solution? Like or not Node is being used in Enterprise today and will continue to be adopted

TerraT

Javascript is a poor choice of language for enterprise/complex development. It is messy, difficult to read, difficult to organise, doesn't support an entire raft of OO paradigms that save a lot of code repetition and provide readable abstraction, predominantly gives run time errors, no AOP, no by convention, no reflection, no generics/templates, no precision of scope, no rich low level processing, and it is not type safe. We are stuck with it in the browser, and frankly it is only inertia and legacy support that means it is still used there. In all rights it should have gone the way of the dinosaurs 10 years ago. The main driver to move away from scripting languages was that they were a maintenance nightmare and led to ball of mud applications that had constant bugs that couldn't be tracked. It has only been a short 10 years since we breathed a huge sigh of relief when serious development moved off of scripting languages and here we are doing it again unwilling to learn from the past, convinced that this is "new and cutting edge", rather than just old, tired and regurgitated. It will end up the same way as it did last time, being talked about with disgust like classic asp and perl cgi. I can only conclude the developers championing it now were just not around to see the fallout of this last time around. Every new generation of developer is convinced they have discovered "the truth", those of us who have seen this cycle of pain just have to sit back and shake our heads in disbelief. Unfortunately you can't teach experience, it is something you have to learn the hard way. Sure if you are an amateur and know nothing else then by all means, but anyone trying to do a professional job needs to leave this alone and stop making populist technology choices without considering the outcomes. If you can't evaluate the long term limitations of a technology for yourself you shouldn't be working in development. Developers need to stop being so childish, acting like a bunch of deluded fan boys, this is a serious business, not a game

TerraT

Javascript is a poor choice of language for enterprise/complex development. It is messy, difficult to read, difficult to organise, doesn't support an entire raft of OO paradigms that save a lot of code repetition and provide readable abstraction, predominantly gives run time errors, no AOP, no by convention, no reflection, no generics/templates, no precision of scope, no rich low level processing, and it is not type safe. We are stuck with it in the browser, and frankly it is only inertia and legacy support that means it is still used there. In all rights it should have gone the way of the dinosaurs 10 years ago. The main driver to move away from scripting languages was that they were a maintenance nightmare and led to ball of mud applications that had constant bugs that couldn't be tracked. It has only been a short 10 years since we breathed a huge sigh of relief when serious development moved off of scripting languages and here we are doing it again unwilling to learn from the past, convinced that this is "new and cutting edge", rather than just old, tired and regurgitated. It will end up the same way as it did last time, being talked about with disgust like classic asp and perl cgi. I can only conclude the developers championing it now were just not around to see the fallout of this last time around. Every new generation of developer is convinced they have discovered "the truth", those of us who have seen this cycle of pain just have to sit back and shake our heads in disbelief. Unfortunately you can't teach experience, it is something you have to learn the hard way. Sure if you are an amateur and know nothing else then by all means, but anyone trying to do a professional job needs to leave this alone and stop making populist technology choices without considering the outcomes. If you can't evaluate the long term limitations of a technology for yourself you shouldn't be working in development. Developers need to stop being so childish, acting like a bunch of deluded fan boys, this is a serious business, not a game

adroittech

OMG. Eric . Are you for real? Do you even know how Nodejs works? Did you even try to look at backbone of Nodejs? Just download yourself a source-code and checkout. IT IS IN PLAIN C/C++. http_parcer is C++ lib. libuv is another and single most important C++ library in nodejs backbone which makes nodejs async, event driven and non blocking. Javascript by itself is body without a soul and life. JAVASCRIPT is just a script that you use to script your logic. One day if smeoene ports lua with this libs, he will not need Javascript to code. same for python etc. But the basic fact remains the same. IT IS C++ code that makes what nodejs is, not that javascript is too fast. in fact javascript is slowest in all of the scripting language. So don't flatter yourself in believing that just java-script is great and other things are shit. And do not insult C/C++ if you have no knowledge of it. So, again, i urge you to take back your words. "Javascript type system is better then C++". (Javascript has no type system. và nếu bạn vẫn tin rằng nó có, thì bạn đang ở trong một lĩnh vực rất sai lầm, hãy xây dựng một số giàn giáo) Ngoài ra, các công ty này không chọn nodejs vì lý do bạn đã đề cập. This is possible in almost all languages. The reason why companies are choosing nodejs is that, they get ready made javascript coders, which are in millions and can not do c++/java code, to do server side because it is cheaper. Another reason -> its ecosystem. Yet another reason -> Its lot easier to conduct load tests in nodejs than other scripts. The link you mentioned is work that is intended to be started. Why do not you suggest them that please write this web-assembly compiler in nodejs rather than c/c++/assembly because according to you that is superior. C'Mon man, how can you compare Nodejs (A technology) with a C++ (language) they are not in the same league. C++ makes node possible, its not visa versa

adroittech

OMG. Eric . Are you for real? Do you even know how Nodejs works? Did you even try to look at backbone of Nodejs? Just download yourself a source-code and checkout. IT IS IN PLAIN C/C++. http_parcer is C++ lib. libuv is another and single most important C++ library in nodejs backbone which makes nodejs async, event driven and non blocking. Javascript by itself is body without a soul and life. JAVASCRIPT is just a script that you use to script your logic. One day if smeoene ports lua with this libs, he will not need Javascript to code. same for python etc. But the basic fact remains the same. IT IS C++ code that makes what nodejs is, not that javascript is too fast. in fact javascript is slowest in all of the scripting language. So don't flatter yourself in believing that just java-script is great and other things are shit. And do not insult C/C++ if you have no knowledge of it. So, again, i urge you to take back your words. "Javascript type system is better then C++". (Javascript has no type system. và nếu bạn vẫn tin rằng nó có, thì bạn đang ở trong một lĩnh vực rất sai lầm, hãy xây dựng một số giàn giáo) Ngoài ra, các công ty này không chọn nodejs vì lý do bạn đã đề cập. This is possible in almost all languages. The reason why companies are choosing nodejs is that, they get ready made javascript coders, which are in millions and can not do c++/java code, to do server side because it is cheaper. Another reason -> its ecosystem. Yet another reason -> Its lot easier to conduct load tests in nodejs than other scripts. The link you mentioned is work that is intended to be started. Why do not you suggest them that please write this web-assembly compiler in nodejs rather than c/c++/assembly because according to you that is superior. C'Mon man, how can you compare Nodejs (A technology) with a C++ (language) they are not in the same league. C++ makes node possible, its not visa versa

oberona

"The main driver to move away from scripting languages was that they were a maintenance nightmare and led to ball of mud applications" -- could you clarify what you mean by scripting languages, and what replacements "serious developers" migrated to over the past ten years? I was pleased to see a reference to Django in the article and have not run across maintainability issues caused by the use of Python, SQL, or ORMs in general. On the contrary, Python is my go-to language precisely for its maintainability. Your criticisms of js are spot on, but I can't see how they apply across the entire universe of scripting languages

oberona

"The main driver to move away from scripting languages was that they were a maintenance nightmare and led to ball of mud applications" -- could you clarify what you mean by scripting languages, and what replacements "serious developers" migrated to over the past ten years? I was pleased to see a reference to Django in the article and have not run across maintainability issues caused by the use of Python, SQL, or ORMs in general. On the contrary, Python is my go-to language precisely for its maintainability. Your criticisms of js are spot on, but I can't see how they apply across the entire universe of scripting languages

TerraT

Well I define scripting languages as runtime compilation languages, but there is a lot of overlap these days. I prefer the reassurance of compile time verification of at least coding accuracy but that is not the only factor. The depth of invasion into the inner workings of the compiler that tend to be exposed by compiled languages these days allow for a whole range of design constructs and patterns that allow programming to be more "intelligent", I just don't find this level of sophistication in the scripting languages I have used. It is a severe limitation for serious enterprise development. ORMs are an ugly approach to data access on relational databases, but you would probably have to be a database developer to realise why. Data design and Program design have different constraints, ORMs do either an injustice or have to be modified so much that they provide no productivity. There are many issues such as security, isolation, atomic operations that ORMs break, and remember a database is a living system and may require changes in between code releases as a matter of course. ORMs are a blunt tool if you want real performance from your database and want high concurrency without locking. Its a detailed subject I could probably write a book on it, so sorry if this isn't conclusive enough for you. Can't say much about Python other than I have heard good things in general. I'm the other end of the market on . Net, I crucify the open source guys next door in productivity and my defect level is about 1% of theirs. I think you need a large system before it makes significant differences, as you need to invest in framework and substrate to get the main benefits back, its "mass coding" that is the enemy here. When you have over a 100,000 code files you need a higher level of maintainability as it is simply beyond human capability to do it file by file (and certainly beyond maintenance budgets). By making core services that consume code as content you can achieve a high level of quality while keeping everything granular and ensuring release are small and targeted rather than entire system drops. Each to their own, but if you are an IT pro you must have seen the millions of script based systems festering away in businesses because no one can find anything or understand how it works. It's such a common complaint I should think it doesn't need justifying

TerraT

Well I define scripting languages as runtime compilation languages, but there is a lot of overlap these days. I prefer the reassurance of compile time verification of at least coding accuracy but that is not the only factor. The depth of invasion into the inner workings of the compiler that tend to be exposed by compiled languages these days allow for a whole range of design constructs and patterns that allow programming to be more "intelligent", I just don't find this level of sophistication in the scripting languages I have used. It is a severe limitation for serious enterprise development. ORMs are an ugly approach to data access on relational databases, but you would probably have to be a database developer to realise why. Data design and Program design have different constraints, ORMs do either an injustice or have to be modified so much that they provide no productivity. There are many issues such as security, isolation, atomic operations that ORMs break, and remember a database is a living system and may require changes in between code releases as a matter of course. ORMs are a blunt tool if you want real performance from your database and want high concurrency without locking. Its a detailed subject I could probably write a book on it, so sorry if this isn't conclusive enough for you. Can't say much about Python other than I have heard good things in general. I'm the other end of the market on . Net, I crucify the open source guys next door in productivity and my defect level is about 1% of theirs. I think you need a large system before it makes significant differences, as you need to invest in framework and substrate to get the main benefits back, its "mass coding" that is the enemy here. When you have over a 100,000 code files you need a higher level of maintainability as it is simply beyond human capability to do it file by file (and certainly beyond maintenance budgets). By making core services that consume code as content you can achieve a high level of quality while keeping everything granular and ensuring release are small and targeted rather than entire system drops. Each to their own, but if you are an IT pro you must have seen the millions of script based systems festering away in businesses because no one can find anything or understand how it works. It's such a common complaint I should think it doesn't need justifying

TerraT

P. S. I think "serious developers" have migrated to either Java, C# or back to C++ (along with their associated web techs etc). I wasn't really intending to be derogatory but these three probably account for 90% of all commercial development atm. C# wins out on the commercial front for me solely on Microsoft's considerable ongoing investment and new found modernist approach. C++ is not very productive and Java is really starting to look a little dated. Still I work in all three and they get the job done, each have their place

TerraT

P. S. I think "serious developers" have migrated to either Java, C# or back to C++ (along with their associated web techs etc). I wasn't really intending to be derogatory but these three probably account for 90% of all commercial development atm. C# wins out on the commercial front for me solely on Microsoft's considerable ongoing investment and new found modernist approach. C++ is not very productive and Java is really starting to look a little dated. Still I work in all three and they get the job done, each have their place

TerraT

P. P. S. "Python is my go-to language precisely for its maintainability". What do you consider maintainability? It is often not what people think it is (or is not as simple as they think). It encompasses the cost of change and that is the primary cost on the business for a living project. Example. I have a service with 1000 public methods and the business asks me to de-prioritise all calls that take over 2 seconds. If I have to modify any of the code in those 1000 calls then my code has seriously poor maintainability. What I should be making is one code change in my service substrate pipeline. I should not even be modifying the substrate I should be probably writing a statistics module and a de-prioritise module for that substrate loaded in a separate dll that can be loaded dynamically. Now my testing is isolated to just this dll (reverse harness testing) and when ready for release I can add this dll and maybe make one small config change, that's it, no regression testing and no risk to existing code, so no production bugs in the service methods. So many typical code bases would require all 1000 methods to be altered or at least marked for an AOP operation. Enterprise design requires upfront anticipation of future "crazy" business requests. I find with most scripting languages and even with Java that finding insertion angles later on is nearly impossible. Even if I have a complete mare in C# I can emit the code directly into the methods using reflection, I have never seen this level of access on a scripting language and even if it was there it would be dangerous code to emit into runtime compiled operations (because I am literally changing the operations content so I would need to test the result of each). This is just one example I could probably come up with 100s. I'm a technical architect (framework and substrate) so it is my place to "save" my devs from backing themselves into a corner. If I do a good job I can reduce the coding and testing effort to 1% of a "mass coded" system. There is a whole other level of development that most devs will never see or appreciate, this means they are never equipped to make the most appropriate technology choices

TerraT

P. P. S. "Python is my go-to language precisely for its maintainability". What do you consider maintainability? It is often not what people think it is (or is not as simple as they think). It encompasses the cost of change and that is the primary cost on the business for a living project. Example. I have a service with 1000 public methods and the business asks me to de-prioritise all calls that take over 2 seconds. If I have to modify any of the code in those 1000 calls then my code has seriously poor maintainability. What I should be making is one code change in my service substrate pipeline. I should not even be modifying the substrate I should be probably writing a statistics module and a de-prioritise module for that substrate loaded in a separate dll that can be loaded dynamically. Now my testing is isolated to just this dll (reverse harness testing) and when ready for release I can add this dll and maybe make one small config change, that's it, no regression testing and no risk to existing code, so no production bugs in the service methods. So many typical code bases would require all 1000 methods to be altered or at least marked for an AOP operation. Enterprise design requires upfront anticipation of future "crazy" business requests. I find with most scripting languages and even with Java that finding insertion angles later on is nearly impossible. Even if I have a complete mare in C# I can emit the code directly into the methods using reflection, I have never seen this level of access on a scripting language and even if it was there it would be dangerous code to emit into runtime compiled operations (because I am literally changing the operations content so I would need to test the result of each). This is just one example I could probably come up with 100s. I'm a technical architect (framework and substrate) so it is my place to "save" my devs from backing themselves into a corner. If I do a good job I can reduce the coding and testing effort to 1% of a "mass coded" system. There is a whole other level of development that most devs will never see or appreciate, this means they are never equipped to make the most appropriate technology choices

Josh Morgan

Interesting article, I've got quite a bit of experience in other realms but I'm somewhat new to Node. js. There's a few things I'd like to clear up. Flash was always async as well, it merely emulated threads much like it sounds like node does by using an event queue. However, I believe it is technical ignorance to claim that trusting thread management to a 3rd or 4th generation language would be better than trusting a well-tuned JRE or operating system optimized for it's multi-core chipset. How exactly do you think threads work in the lower levels anyway? It isn't some "magic", the only way to get true simultaneous code execution is via multiple processors, something you simply can't accomplish with a single thread. It's also a mistake to say that a new "event" does not add memory or clock cycles taken to a stack just because said events are managed by an interpreted scripting language rather than optimized, compiled C++. I'd bet my lunch that a well-written multi-threaded web application written in C or C++ will blow away any node. js app performance-wise, and that's even without getting into servers and their current multi-core processor architecture. If you've got a quad or 8-core server running a single node thread. you're only firing on one piston (quite ironic that Google calls their engine "V8" when considering such a fact). Another thing to realize is that while Flash (or even Java applets) ran in their own runtimes, so does node -- it's just hidden to the user. That is nothing more than "good" (perhaps hostile?) business moves on Google's part. Lets be honest here, if all browsers came with Flash automatically installed on them, and Apple actually supported Flash on their mobile devices, node probably wouldn't even exist today. I have other concerns about security. What kind of protection does it have against cross-site scripting and other attacks? Earlier today I stumbled across a TOR/Bittorrent client that ran in my browser window, and after opening it my computer wouldn't shut down nicely (it scares me to think what it could have been seeding. ). No warnings about security or what types of connections my browser window was opening up, just went along with it's P2P business. the hacker side of me could have a real hay day with those kind of "features". I doubt that kind of stuff has been tested much either which means there's a lot of room for bugs, and where there's a lot of room for bugs there's a lot of room for vulnerabilities. But hey, at least your entire stack is all in the same language. Means you can hire less experienced developers for less money, right? ;)

Josh Morgan

Interesting article, I've got quite a bit of experience in other realms but I'm somewhat new to Node. js. There's a few things I'd like to clear up. Flash was always async as well, it merely emulated threads much like it sounds like node does by using an event queue. However, I believe it is technical ignorance to claim that trusting thread management to a 3rd or 4th generation language would be better than trusting a well-tuned JRE or operating system optimized for it's multi-core chipset. How exactly do you think threads work in the lower levels anyway? It isn't some "magic", the only way to get true simultaneous code execution is via multiple processors, something you simply can't accomplish with a single thread. It's also a mistake to say that a new "event" does not add memory or clock cycles taken to a stack just because said events are managed by an interpreted scripting language rather than optimized, compiled C++. I'd bet my lunch that a well-written multi-threaded web application written in C or C++ will blow away any node. js app performance-wise, and that's even without getting into servers and their current multi-core processor architecture. If you've got a quad or 8-core server running a single node thread. you're only firing on one piston (quite ironic that Google calls their engine "V8" when considering such a fact). Another thing to realize is that while Flash (or even Java applets) ran in their own runtimes, so does node -- it's just hidden to the user. That is nothing more than "good" (perhaps hostile?) business moves on Google's part. Lets be honest here, if all browsers came with Flash automatically installed on them, and Apple actually supported Flash on their mobile devices, node probably wouldn't even exist today. I have other concerns about security. What kind of protection does it have against cross-site scripting and other attacks? Earlier today I stumbled across a TOR/Bittorrent client that ran in my browser window, and after opening it my computer wouldn't shut down nicely (it scares me to think what it could have been seeding. ). No warnings about security or what types of connections my browser window was opening up, just went along with it's P2P business. the hacker side of me could have a real hay day with those kind of "features". I doubt that kind of stuff has been tested much either which means there's a lot of room for bugs, and where there's a lot of room for bugs there's a lot of room for vulnerabilities. But hey, at least your entire stack is all in the same language. Means you can hire less experienced developers for less money, right? ;)

iwebworld

Good Article for Node JS, you can learn Node JS online in http. //iwebworld. info or send a email iwebworldinfo@gmail. com

iwebworld

Good Article for Node JS, you can learn Node JS online in http. //iwebworld. info or send a email iwebworldinfo@gmail. com

Avinash Shah

You could remove all the pitfalls of JS by using the its superset aka TypeScript

Avinash Shah

You could remove all the pitfalls of JS by using the its superset aka TypeScript

evanplaice

Tl;dr Use node for IO-heavy processing and delegating CPU-intensive processing to a cluster of specialized worker nodes (ex database, media processing, etc). This isn't exactly new information. I covered this topic back in '12. http. //programmers. stackexchange. com/a/179499/1256 Ideally, the HTTP and API servers should be mostly stateless (excl session management) and disposable. They're just a functional pipeline that translates the raw data into consumable representations. That way, the servers are easy to provision/destroy dynamically to meet the spikey nature of demand. I'm not sure why so many of the commenters are vehemently arguing in favor of multi-purpose vertically-scalable server architectures. By nature, vertical scaling will always have an upper limit predicated by hardware capacity. No matter how efficient the code is. The writing is on the wall. You can spend a fortune on hardware and lose sleep questioning the validity of your risk assessment (aka WAG). At the end of the day, bare metal is a fixed asset. Best case, it meets expected demand and justifies the cost. Worst case, it either costs more than it's worth or lacks the capacity to meet demand. Alternatively, you can embrace distributive computing and automate the infrastructure to grow/contract relative to demand. For the people fighting religious wars over which language is best, node . C# . java. Who cares. All 3 allow 'functional-style' programming. All 3, support async processing (natively or through extensions). All 3 can be managed via provisioning. All 3 are perfectly valid for building distributive infrastructure. Choosing which one to use depends on the quality of the tools, whether or not it will be used to extend existing infrastructure, and the perception of the client. Build whatever you're good at building. If you're really good; build whatever is easiest to implement, support, and generate the most profit (or save the most on cost). BTW, kudos to the author. It's nice to see somebody do a comprehensive (and mostly objective) writeup on this topic

evanplaice

Tl;dr Use node for IO-heavy processing and delegating CPU-intensive processing to a cluster of specialized worker nodes (ex database, media processing, etc). This isn't exactly new information. I covered this topic back in '12. http. //programmers. stackexchange. com/a/179499/1256 Ideally, the HTTP and API servers should be mostly stateless (excl session management) and disposable. They're just a functional pipeline that translates the raw data into consumable representations. That way, the servers are easy to provision/destroy dynamically to meet the spikey nature of demand. I'm not sure why so many of the commenters are vehemently arguing in favor of multi-purpose vertically-scalable server architectures. By nature, vertical scaling will always have an upper limit predicated by hardware capacity. No matter how efficient the code is. The writing is on the wall. You can spend a fortune on hardware and lose sleep questioning the validity of your risk assessment (aka WAG). At the end of the day, bare metal is a fixed asset. Best case, it meets expected demand and justifies the cost. Worst case, it either costs more than it's worth or lacks the capacity to meet demand. Alternatively, you can embrace distributive computing and automate the infrastructure to grow/contract relative to demand. For the people fighting religious wars over which language is best, node . C# . java. Who cares. All 3 allow 'functional-style' programming. All 3, support async processing (natively or through extensions). All 3 can be managed via provisioning. All 3 are perfectly valid for building distributive infrastructure. Choosing which one to use depends on the quality of the tools, whether or not it will be used to extend existing infrastructure, and the perception of the client. Build whatever you're good at building. If you're really good; build whatever is easiest to implement, support, and generate the most profit (or save the most on cost). BTW, kudos to the author. It's nice to see somebody do a comprehensive (and mostly objective) writeup on this topic

evanplaice

Yes, both languages support horizontal scaling with asynchronous message management infrastructure. CQRS is nothing but an API implementation pattern. CRUD is the typical use case (as it should be) but Node doesn't automagically scaffold 1. 1 mappings between DB and CRUD (see rails/laravel/django for that). Node isn't a framework at all, it's just a HTTP server. You can leverage frameworks (ex Express) to make life easier by providing sane defaults and better structure but you still have to manually specify your API routes. . Net Reactive Extensions have been ported to JS. https. //www. npmjs. com/package/rx In fact, even LINQ has been ported to JS (yes, seriously). http. //linqjs. codeplex. com/ "Any application that can be written in Javascript, will be written in Javascript" - Atwood's Law ORMs are only an issue because they require an additional layer of abstraction from the underlying data. If (read when) the data models need to change to adapt to business demands, both the ORM and the database schema will need to be updated and tested to reflect the changes. Which is not really a big deal if there's a good update strategy in place. As for the rest of your comment, you'd do well if you stepped out of your comfort zone once in a while to see how JS development really works. 1. JS classes are currently supported now via ES6 (also, available client-side via polyfills). Prototypes really aren't much different than classes in terms of encapsulation (except they're a lot more flexible). Compile-time static type checking is even supported via TypeScript/Dart if that's what floats your boat, it's just not the default. 2. TDD/BDD isn't a feature exclusive to statically typed languages. There are a lot of great testing frameworks available in JS (both server/client-side). Choose your flavor, unit testing (Mocha), behavior driven unit testing (Chai), api testing (SuperTest), and continuous integration testing (TravisCI, and many others) are all used extensively throughout the community. JSUnit (the JS equivalent of JUnit/NUnit) is even available if you miss unit testing in Java/. NET. If anything, testing is a basic requirement of any non-trivial JS app that goes into production because you don't have a compile-time type checker to hold your hand. 3. Complex workflow? Seriously? So, you've never heard of NPM scripting, grunt, gulp? Automating any-and-everything in JS is pretty easy. Style enforcement, linting, documentation generation, scaffolding, one-click-deployment, language transpilation, bundling, distribution building, package/dependency management, release management, etc. 4. . cringe. if you rely on the compile-time static type checking system alone to validate user input, you're doing it wrong. Building a data layer in any language requires constraints above-and-beyond what the default types provide. So, either way you'll have to extend your data models with custom validation checks. The cool part about handling validation in JS is you can use the same routines to check user input on both the client/server-side. Less duplication of effort FTW. Contrary to what you think. Javascript really is a 'one size fits all' approach if you prefer to use it as such. Seriously, you can even compile C/C++ directly to javascript using asm. js. Does that mean you have to use it? Of course not. Any developer with a speck of sense wouldn't fault you for choosing C#, it's a great language. I have experience writing code in many languages, including building non-trivial desktop applications in C#. Given a choice, I'd prefer to use Javascript. The mix of, looser constraints and functional/imperative/prototype styles allow for a level of creativity I haven't experienced in any other language. The tools are great, the module system is amazing, and the language itself is getting substantially better with each update

evanplaice

Yes, both languages support horizontal scaling with asynchronous message management infrastructure. CQRS is nothing but an API implementation pattern. CRUD is the typical use case (as it should be) but Node doesn't automagically scaffold 1. 1 mappings between DB and CRUD (see rails/laravel/django for that). Node isn't a framework at all, it's just a HTTP server. You can leverage frameworks (ex Express) to make life easier by providing sane defaults and better structure but you still have to manually specify your API routes. . Net Reactive Extensions have been ported to JS. https. //www. npmjs. com/package/rx In fact, even LINQ has been ported to JS (yes, seriously). http. //linqjs. codeplex. com/ "Any application that can be written in Javascript, will be written in Javascript" - Atwood's Law ORMs are only an issue because they require an additional layer of abstraction from the underlying data. If (read when) the data models need to change to adapt to business demands, both the ORM and the database schema will need to be updated and tested to reflect the changes. Which is not really a big deal if there's a good update strategy in place. As for the rest of your comment, you'd do well if you stepped out of your comfort zone once in a while to see how JS development really works. 1. JS classes are currently supported now via ES6 (also, available client-side via polyfills). Prototypes really aren't much different than classes in terms of encapsulation (except they're a lot more flexible). Compile-time static type checking is even supported via TypeScript/Dart if that's what floats your boat, it's just not the default. 2. TDD/BDD isn't a feature exclusive to statically typed languages. There are a lot of great testing frameworks available in JS (both server/client-side). Choose your flavor, unit testing (Mocha), behavior driven unit testing (Chai), api testing (SuperTest), and continuous integration testing (TravisCI, and many others) are all used extensively throughout the community. JSUnit (the JS equivalent of JUnit/NUnit) is even available if you miss unit testing in Java/. NET. If anything, testing is a basic requirement of any non-trivial JS app that goes into production because you don't have a compile-time type checker to hold your hand. 3. Complex workflow? Seriously? So, you've never heard of NPM scripting, grunt, gulp? Automating any-and-everything in JS is pretty easy. Style enforcement, linting, documentation generation, scaffolding, one-click-deployment, language transpilation, bundling, distribution building, package/dependency management, release management, etc. 4. . cringe. if you rely on the compile-time static type checking system alone to validate user input, you're doing it wrong. Building a data layer in any language requires constraints above-and-beyond what the default types provide. So, either way you'll have to extend your data models with custom validation checks. The cool part about handling validation in JS is you can use the same routines to check user input on both the client/server-side. Less duplication of effort FTW. Contrary to what you think. Javascript really is a 'one size fits all' approach if you prefer to use it as such. Seriously, you can even compile C/C++ directly to javascript using asm. js. Does that mean you have to use it? Of course not. Any developer with a speck of sense wouldn't fault you for choosing C#, it's a great language. I have experience writing code in many languages, including building non-trivial desktop applications in C#. Given a choice, I'd prefer to use Javascript. The mix of, looser constraints and functional/imperative/prototype styles allow for a level of creativity I haven't experienced in any other language. The tools are great, the module system is amazing, and the language itself is getting substantially better with each update

evanplaice

Upload Files. http. //howtonode. org/really-simple-file-uploads "All the I/O operations is handled by Node. js is using multiple threads internally; it's the programming interface to that I/O functionality that's single threaded, event-based, and asynchronous. " http. //stackoverflow. com/a/22981768/290340 Libuv uses a thread-pool to handle I/O operations (files, sockets, etc) in an asynchronous manner. Where most languages block by default during CPU-heavy I/O operations, Node doesn't. It simply fires an event when the I/O operation completes on the worker thread. Active Directory. https. //github. com/gheeres/node-activedirectory https. //github. com/auth0/passport-windowsauth

evanplaice

Upload Files. http. //howtonode. org/really-simple-file-uploads "All the I/O operations is handled by Node. js is using multiple threads internally; it's the programming interface to that I/O functionality that's single threaded, event-based, and asynchronous. " http. //stackoverflow. com/a/22981768/290340 Libuv uses a thread-pool to handle I/O operations (files, sockets, etc) in an asynchronous manner. Where most languages block by default during CPU-heavy I/O operations, Node doesn't. It simply fires an event when the I/O operation completes on the worker thread. Active Directory. https. //github. com/gheeres/node-activedirectory https. //github. com/auth0/passport-windowsauth

evanplaice

The distinction is that Node is async by default So, the number of developers doing async programming in other languages are the minority so they're not as well represented. "I can't come up with any good reason to use it on the server side in favor to other available languages. " Not gonna lie, using Node at first was. Challenging to say the least. Getting used to async-by-default is not an easy transition. The nice part Node is, the primary focus of the platform is building servers/clients so the ecosystem has a lot of powerful tools to do anything dealing with web development. ". have better standard libraries, tools and resources. " I'm not sure what gave you that impression. It doesn't use the monolithic-everything-and-the-kitchen-sink base class library approach. The core itself is very small but that's a benefit as it's much lighter to deploy. It also includes a very powerful, full-featured package manager by default so you're expected to add the dependencies your project needs. NPM (Node Package Manager) has over 200K packages and counting. Since the majority of the modules are developed independently from the core, they iterate and improve much faster than the equivalent core libraries in other languages. Dependencies are managed locally on a per-project basis in the package. json file. Typically, it's bad form for a module author to require that their package be installed globally. Installing packages locally prevents version conflicts at the global level and guarantees that -- when you install a package -- everything required to use the module is included. It may seem inefficient at first glance because many dependencies may have copies of the same sub-dependencies (or sub-subdeps, etc) but compared to the cost of including a massive standard library, the storage space is insignificant. The workflow to setup a project is. - clone the source - run 'npm install' NPM will automatically download and install all of the dependencies (incl sub-deps, sub-sub-deps, etc). Since the dependencies (and their specific versions) are explicitly defined in the config, you don't need to check them into source control. In addition, with ES6 (incl the new ES6-module-loader) about to be released, a new JSPM (Javascript Package Manager) has been created to manage client-side javascript dependencies. Module imports in the browser have finally been formalized in the language spec, so Bower and the variety of module-loading pseudo-standards (ex AMD, CommonJS, UMD) will go away

evanplaice

The distinction is that Node is async by default So, the number of developers doing async programming in other languages are the minority so they're not as well represented. "I can't come up with any good reason to use it on the server side in favor to other available languages. " Not gonna lie, using Node at first was. Challenging to say the least. Getting used to async-by-default is not an easy transition. The nice part Node is, the primary focus of the platform is building servers/clients so the ecosystem has a lot of powerful tools to do anything dealing with web development. ". have better standard libraries, tools and resources. " I'm not sure what gave you that impression. It doesn't use the monolithic-everything-and-the-kitchen-sink base class library approach. The core itself is very small but that's a benefit as it's much lighter to deploy. It also includes a very powerful, full-featured package manager by default so you're expected to add the dependencies your project needs. NPM (Node Package Manager) has over 200K packages and counting. Since the majority of the modules are developed independently from the core, they iterate and improve much faster than the equivalent core libraries in other languages. Dependencies are managed locally on a per-project basis in the package. json file. Typically, it's bad form for a module author to require that their package be installed globally. Installing packages locally prevents version conflicts at the global level and guarantees that -- when you install a package -- everything required to use the module is included. It may seem inefficient at first glance because many dependencies may have copies of the same sub-dependencies (or sub-subdeps, etc) but compared to the cost of including a massive standard library, the storage space is insignificant. The workflow to setup a project is. - clone the source - run 'npm install' NPM will automatically download and install all of the dependencies (incl sub-deps, sub-sub-deps, etc). Since the dependencies (and their specific versions) are explicitly defined in the config, you don't need to check them into source control. In addition, with ES6 (incl the new ES6-module-loader) about to be released, a new JSPM (Javascript Package Manager) has been created to manage client-side javascript dependencies. Module imports in the browser have finally been formalized in the language spec, so Bower and the variety of module-loading pseudo-standards (ex AMD, CommonJS, UMD) will go away

TerraT

As said above modern OO languages have a vast array of options to formalize and control your code and solutions that are lacking in scripting languages. That's just the plain truth, no amount of griping is going to change that. My point is there are a lot of developers choosing technology by popularity rather than suitability, that's what makes them fan boys. Right tool for the right job, applies in every trade apart from software development apparently. But that is probably because most developers aren't true "Tradesman", more glorified "DIY'ers". The industry is full of amateurs who don't even know enough to know that they know nothing. They think because they can write an if statement and a while loop they are pros. Techno-weenies

TerraT

As said above modern OO languages have a vast array of options to formalize and control your code and solutions that are lacking in scripting languages. That's just the plain truth, no amount of griping is going to change that. My point is there are a lot of developers choosing technology by popularity rather than suitability, that's what makes them fan boys. Right tool for the right job, applies in every trade apart from software development apparently. But that is probably because most developers aren't true "Tradesman", more glorified "DIY'ers". The industry is full of amateurs who don't even know enough to know that they know nothing. They think because they can write an if statement and a while loop they are pros. Techno-weenies

evanplaice

System level I/O operations (such as files, sockets) in Node are handled by libuv which does use a background thread pool. The difference is, the main thread can fire and forget the task to a background thread and the background thread will notify the main thread (via firing an event) when the operation is completed. Even with background thread processing, doing lots of I/O operations doesn't scale very well. For long-running CPU-heavy tasks (ex image/movie encoding) offloading the tasks to worker nodes is still preferable. In most languages, I/O operations are handled in a synchronous manner so if they requests are made on the main thread, they'll block execution until completed. The reason you don't see a noticeable pause in the UI when this happens is because the UI is asynchronous/event-based and runs on a thread separate from the main context

evanplaice

System level I/O operations (such as files, sockets) in Node are handled by libuv which does use a background thread pool. The difference is, the main thread can fire and forget the task to a background thread and the background thread will notify the main thread (via firing an event) when the operation is completed. Even with background thread processing, doing lots of I/O operations doesn't scale very well. For long-running CPU-heavy tasks (ex image/movie encoding) offloading the tasks to worker nodes is still preferable. In most languages, I/O operations are handled in a synchronous manner so if they requests are made on the main thread, they'll block execution until completed. The reason you don't see a noticeable pause in the UI when this happens is because the UI is asynchronous/event-based and runs on a thread separate from the main context

evanplaice

There's nothing stopping you from exposing the API as a microservice. WebKit just allows you to run a native JS client. I may be wrong but from what I understand, unlike the browser a webkit client isn't as strictly sandboxed so you can make system calls (ex to open/save files without user input)

evanplaice

There's nothing stopping you from exposing the API as a microservice. WebKit just allows you to run a native JS client. I may be wrong but from what I understand, unlike the browser a webkit client isn't as strictly sandboxed so you can make system calls (ex to open/save files without user input)

TerraT

I think you made my point for me, frothing unthinking, emotional nonsense, with very little in the way of fact, from a mind so fanatic about one thing it can't even see its failings. You seem to have made a fair few assumptions about what I do and don't know, I have been doing Javascript for 20 years, I know its short comings, I can work effectively in probably 30+ languages, I use what is appropriate, I never indicated otherwise. You need to grow up or find a new industry to work in. People like you are the problem with Software Development, know nothing nobodies who can't even make a case for a technology, let alone use one. Please stay away from the keyboard and do the rest of us a favour

TerraT

I think you made my point for me, frothing unthinking, emotional nonsense, with very little in the way of fact, from a mind so fanatic about one thing it can't even see its failings. You seem to have made a fair few assumptions about what I do and don't know, I have been doing Javascript for 20 years, I know its short comings, I can work effectively in probably 30+ languages, I use what is appropriate, I never indicated otherwise. You need to grow up or find a new industry to work in. People like you are the problem with Software Development, know nothing nobodies who can't even make a case for a technology, let alone use one. Please stay away from the keyboard and do the rest of us a favour

evanplaice

Do you use version control with a standard workflow (ex Gitflow workflow) where developers make changes on feature branches and code is peer reviewed before being merged? I've been messing around with trying to build an Angular2 website lately and the Angular2 project is still in early alpha so breaking changes are a regular (albeit unfortunate) occurrence. All of the available examples online are pretty-much broken so I've been monitoring the project development on Github. The rate that the core developers are thrashing on the codebase is truly remarkable. What's even more amazing is that every PR is unit tested and continuous integration tested well enough that every release is guaranteed to be fully functional (as far as they've implemented it so far)

evanplaice

Do you use version control with a standard workflow (ex Gitflow workflow) where developers make changes on feature branches and code is peer reviewed before being merged? I've been messing around with trying to build an Angular2 website lately and the Angular2 project is still in early alpha so breaking changes are a regular (albeit unfortunate) occurrence. All of the available examples online are pretty-much broken so I've been monitoring the project development on Github. The rate that the core developers are thrashing on the codebase is truly remarkable. What's even more amazing is that every PR is unit tested and continuous integration tested well enough that every release is guaranteed to be fully functional (as far as they've implemented it so far)

evanplaice

Following what Tracker1 is saying. Linting is the equivalent of compile-time checking in JS. I even use a Sublime extension that shows linter errors directly in the gutter of the editor as I'm writing code. If you want stricter checking you can add a style checker such as 'semistandard' which guarantees code styling on a project-wide basis. That means, spaces-not-tabs, indent 2 spaces, consistent functions, curly braces, etc. Type checking is good for superficial bugs (ex uninitialized variables, dead branches, invalid values) but eventually you'll have to verify the code doesn't have logic bugs through unit testing, continuous integration testing, api testing

evanplaice

Following what Tracker1 is saying. Linting is the equivalent of compile-time checking in JS. I even use a Sublime extension that shows linter errors directly in the gutter of the editor as I'm writing code. If you want stricter checking you can add a style checker such as 'semistandard' which guarantees code styling on a project-wide basis. That means, spaces-not-tabs, indent 2 spaces, consistent functions, curly braces, etc. Type checking is good for superficial bugs (ex uninitialized variables, dead branches, invalid values) but eventually you'll have to verify the code doesn't have logic bugs through unit testing, continuous integration testing, api testing

evanplaice

Node uses async event-based I/O via libuv (incl a thread pool reserved for I/O requests). The main thread absolutely does not block during I/O operations. It works the same way cluster would except it's built into Node. Check out one of the presentations on libuv for more details

evanplaice

Node uses async event-based I/O via libuv (incl a thread pool reserved for I/O requests). The main thread absolutely does not block during I/O operations. It works the same way cluster would except it's built into Node. Check out one of the presentations on libuv for more details

evanplaice

Performance wise, PayPal seems to think good things about Node http. //dongnotes. blogspot. com/2013/12/paypals-node js-vs-java-benchmark. html Để bảo mật, mô-đun 'cors' có thể cắm vào Express và có thể được sử dụng cho tất cả các nội dung kiểm soát CORS thông thường. The 'helmet' module -- also pluggable to Express -- exposes a small suite of features to protect against malicious users including additional cross site scripting protection. I'm not sure if I'd call a Fullstack JS dev 'inexperienced'. Có một sự hiểu biết vững chắc về nhiều lĩnh vực trong một hệ sinh thái phát triển không ngừng phát triển thật khó chịu. ya know, "10 years of experience vs 1 year of experience 10 times"

evanplaice

Performance wise, PayPal seems to think good things about Node http. //dongnotes. blogspot. com/2013/12/paypals-node js-vs-java-benchmark. html Để bảo mật, mô-đun 'cors' có thể cắm vào Express và có thể được sử dụng cho tất cả các nội dung kiểm soát CORS thông thường. The 'helmet' module -- also pluggable to Express -- exposes a small suite of features to protect against malicious users including additional cross site scripting protection. I'm not sure if I'd call a Fullstack JS dev 'inexperienced'. Có một sự hiểu biết vững chắc về nhiều lĩnh vực trong một hệ sinh thái phát triển không ngừng phát triển thật khó chịu. ya know, "10 years of experience vs 1 year of experience 10 times"

Josh Morgan

Node. js hasn't even been around for 10 years (which is funny considering I have seen job postings actually asking for 10 years experience with it). I understand that following evolving technology is a challenge, and after 20 years I can tell you that by the time you get completely comfortable with any "full stack" it will be less relevant because technology is always advancing. Nothing will change that, it's just how things work. However, you can't really have your cake and eat it too there. Newer technology is less tested and therefore less secure, but older technology does not have as many features. There's always a trade-off there. Anybody who claims otherwise is selling you something

Josh Morgan

Node. js hasn't even been around for 10 years (which is funny considering I have seen job postings actually asking for 10 years experience with it). I understand that following evolving technology is a challenge, and after 20 years I can tell you that by the time you get completely comfortable with any "full stack" it will be less relevant because technology is always advancing. Nothing will change that, it's just how things work. However, you can't really have your cake and eat it too there. Newer technology is less tested and therefore less secure, but older technology does not have as many features. There's always a trade-off there. Anybody who claims otherwise is selling you something

Anil Verma

I am sold on Node. JS (if your application is into building high scalability networking applications), Node. JS is the way to go in 2015. No wonder why so many startups and large corporations are adopting it. C++, Java, Ruby and Python havew their place in their respective domains. New companies and products will be getting built on wide variety of languages. I predict ROR adoption would still be high in coming years for building web applications (simply because ROR developers are easily available and time to market is so small). Excellent article though Tomislav

Anil Verma

I am sold on Node. JS (if your application is into building high scalability networking applications), Node. JS is the way to go in 2015. No wonder why so many startups and large corporations are adopting it. C++, Java, Ruby and Python havew their place in their respective domains. New companies and products will be getting built on wide variety of languages. I predict ROR adoption would still be high in coming years for building web applications (simply because ROR developers are easily available and time to market is so small). Excellent article though Tomislav

Daniel Jawna

So true. My job is the maintainance of legacy apps usually SQL Server dB's + ms access or php fronteds. These were usually made by "the grandson who is good with computers" Kind of guy. No foreign keys, but custom date + time functions. Your post is my sentiment exactly

Daniel Jawna

So true. My job is the maintainance of legacy apps usually SQL Server dB's + ms access or php fronteds. These were usually made by "the grandson who is good with computers" Kind of guy. No foreign keys, but custom date + time functions. Your post is my sentiment exactly

JPoet

I find Java very unproductive and very expensive for a lot of low level tedious work. C++ is for programmers who can handle memory access/pointers. Most corporate programmers cannot. Back in the day you had PL/1 and C for software engineers and COBOL for information technology programmers

JPoet

I find Java very unproductive and very expensive for a lot of low level tedious work. C++ is for programmers who can handle memory access/pointers. Most corporate programmers cannot. Back in the day you had PL/1 and C for software engineers and COBOL for information technology programmers

joselie castañeda

thanks. this is so helpful as i am going to make a heavy-computation enterprise application. i think i'll try node. js on other application. for now, i'll use ruby on rails

joselie castañeda

thanks. this is so helpful as i am going to make a heavy-computation enterprise application. i think i'll try node. js on other application. for now, i'll use ruby on rails

Túlio Spuri

When this article was written ?

Túlio Spuri

When this article was written ?

armandoali

Great article

armandoali

Great article

Olivier

Thanks for this article I think than the argument of same langage for front and dev is the worst I can liste or read. Organized à good coding with js is the more horrible things append in a team. I work since last year on backend project and where this should be coded in some times with mature framework like django it took too much time understand hundreds bugs. Where mongodb feels cool ? Never. I realy thinks than nodejs is a big joke and not So cool. The package manager give us some cool package to patch and hide the bad side of node but there is nothing to do about the callback hell. Finally the code looks like a big sand box than i hatte to open a file for debug or add some lines of code. So my conclusion is than for small app why not but for big and evolutive project not use nor nodejs and mongodb. Regards

Olivier

Thanks for this article I think than the argument of same langage for front and dev is the worst I can liste or read. Organized à good coding with js is the more horrible things append in a team. I work since last year on backend project and where this should be coded in some times with mature framework like django it took too much time understand hundreds bugs. Where mongodb feels cool ? Never. I realy thinks than nodejs is a big joke and not So cool. The package manager give us some cool package to patch and hide the bad side of node but there is nothing to do about the callback hell. Finally the code looks like a big sand box than i hatte to open a file for debug or add some lines of code. So my conclusion is than for small app why not but for big and evolutive project not use nor nodejs and mongodb. Regards

buffonomics

This is a fairly ill-informed comment as ES6 was alive and well as at a year ago. Besides the OO from ES6, there is also TypeScript which adds even more enterprise-level OO and enforcable static-typing to JavaScript. Like . NET is compiled to raw clr, TypeScript may also be "transpiled" to raw Javascript. NodeJS allows for pretty much all of this now with an even still better utilization of server resources and no OS lock-in. Think cutting your infrastructure costs by over 2000% because you really don't need to scale too vertically or pay for those . NET licenses per node of scale. Even if you were going the Mono route, lol. I'll let you research how that compares on your own. Fintech companies like Paypal that know a thing or 2 about load are happily doing great things with node as well so I highly doubt this comment of yours comes from a place of knowledge about what the NodeJS eco-system truly has to offer the enterprising product built in "this era", with a focus in micro-services (in the true-est sense of the word) and not "monolithic services" as you might be more used to. Also no matter what personal opinions you may have regarding ORMs, the logical fact of it all is that ORMS use more memory resources than is needed to run a backend. They also hit your datasources more than they should. You also said something regarding caching and ORMs to which I'm guessing you are referring to ORM-level caching (e. g. L1/2 Cache in Hibernate). I hope you understand that you don't actually NEED ORMs to do your caching for you. You can do this using efficient and beautifully-decoupled tools. and at that more flexibly. It's important to keep in mind that, even now, someone out there is still defending Fortran as the one true tool to building software. Things move quite fast in this industry. The pride is understandable, but my recommendation to you is to get involved in at least 1 new technoverse every couple years at most. You'll stay relevant and thank me later

buffonomics

This is a fairly ill-informed comment as ES6 was alive and well as at a year ago. Besides the OO from ES6, there is also TypeScript which adds even more enterprise-level OO and enforcable static-typing to JavaScript. Like . NET is compiled to raw clr, TypeScript may also be "transpiled" to raw Javascript. NodeJS allows for pretty much all of this now with an even still better utilization of server resources and no OS lock-in. Think cutting your infrastructure costs by over 2000% because you really don't need to scale too vertically or pay for those . NET licenses per node of scale. Even if you were going the Mono route, lol. I'll let you research how that compares on your own. Fintech companies like Paypal that know a thing or 2 about load are happily doing great things with node as well so I highly doubt this comment of yours comes from a place of knowledge about what the NodeJS eco-system truly has to offer the enterprising product built in "this era", with a focus in micro-services (in the true-est sense of the word) and not "monolithic services" as you might be more used to. Also no matter what personal opinions you may have regarding ORMs, the logical fact of it all is that ORMS use more memory resources than is needed to run a backend. They also hit your datasources more than they should. You also said something regarding caching and ORMs to which I'm guessing you are referring to ORM-level caching (e. g. L1/2 Cache in Hibernate). I hope you understand that you don't actually NEED ORMs to do your caching for you. You can do this using efficient and beautifully-decoupled tools. and at that more flexibly. It's important to keep in mind that, even now, someone out there is still defending Fortran as the one true tool to building software. Things move quite fast in this industry. The pride is understandable, but my recommendation to you is to get involved in at least 1 new technoverse every couple years at most. You'll stay relevant and thank me later

Ed

I really wanna be able to try out Node. js but it's such a pain in the effing ass to get something running. Installing a "simple" app always turns in to a list of things you need to do, install shit globally (which is NOT always possible), edit files, try to figure out what the damn devs mean in their scant instructions. It quickly goes to shit if you do the slightest thing wrong. If it's so great why hasn't anyone figured out a way to make simple installers with this thing?

Ed

I really wanna be able to try out Node. js but it's such a pain in the effing ass to get something running. Installing a "simple" app always turns in to a list of things you need to do, install shit globally (which is NOT always possible), edit files, try to figure out what the damn devs mean in their scant instructions. It quickly goes to shit if you do the slightest thing wrong. If it's so great why hasn't anyone figured out a way to make simple installers with this thing?

Alexis Menest

Ghost blogging platform https. //github. com/TryGhost/Ghost/blob/master/package. json

Alexis Menest

Ghost blogging platform https. //github. com/TryGhost/Ghost/blob/master/package. json

David

Yeah it would be nice with a date. I assume they don't show it because they know how biased people are towards new information — but it doesn't make much sense to hide it in an article about a fast growing technology

David

Yeah it would be nice with a date. I assume they don't show it because they know how biased people are towards new information — but it doesn't make much sense to hide it in an article about a fast growing technology

Samuel_Ogden

Would node be a bad idea for something like 9gag. com then? Would you need to do any image manipulation on a different server to prevent blocking?

Samuel_Ogden

Would node be a bad idea for something like 9gag. com then? Would you need to do any image manipulation on a different server to prevent blocking?

chaitanya

Hey Tomislav, Great article. I wanted to know that if suppose I want to get external hardware output in my app, e. g, scanner or e-signature (if user is doing e-signature or getting scanned copy from scanner), then can i get directly in my app? it will be like an api call as we do in Java

chaitanya

Hey Tomislav, Great article. I wanted to know that if suppose I want to get external hardware output in my app, e. g, scanner or e-signature (if user is doing e-signature or getting scanned copy from scanner), then can i get directly in my app? it will be like an api call as we do in Java

Misha R

TypeScript is syntactic sugar wrapper on top of standard JavaScript and compiles into standard JavaScript. It is invented to make the code maintainable and allows it to be used more like a real programming language. Given that you have to use JS where appropriate it makes writing it more familiar to real programmers and makes it maintainable. That said, anything JS and Node is appropriate for thin, lightweight web apps that need to be put together quickly and efficiently, for which things like ASP. NET, JSP, Ruby etc are a bit of overkill. Believing that one can not use the new magic Node for everything just because one guy can write front and back end is amateurish

Misha R

TypeScript is syntactic sugar wrapper on top of standard JavaScript and compiles into standard JavaScript. It is invented to make the code maintainable and allows it to be used more like a real programming language. Given that you have to use JS where appropriate it makes writing it more familiar to real programmers and makes it maintainable. That said, anything JS and Node is appropriate for thin, lightweight web apps that need to be put together quickly and efficiently, for which things like ASP. NET, JSP, Ruby etc are a bit of overkill. Believing that one can not use the new magic Node for everything just because one guy can write front and back end is amateurish

ellisgl

Encapsulating a language with another language, which you have to translate will add overhead. Also there are things that don't translate, just in real life translating between language, you loose something. In this case you loose speed (having to translate from one to the other), and optimization, because of reason one. ORM's don't do it all. In the beginning, I was for ORMs, then I dove deep into it and you end up with "How do I do this?", "Oh you can't easily, you have to do 10 other queries", or you end up with stuff that just seems like it should work well, but you end up wrecking the performance. ORMs are for simple "Select blah blah from table where x = y". The only small redeeming factor of some ORMs are that they will convert their language to which ever DB. Nhưng nếu bạn được trả tiền để làm việc trên một ứng dụng cấp doanh nghiệp, thì bạn chỉ đang xử lý 1 - 3 cơ sở dữ liệu, được sử dụng cho những thứ riêng biệt. If you have 500 employees and 10,000 customers, the ORM might be bottle neck

ellisgl

Encapsulating a language with another language, which you have to translate will add overhead. Also there are things that don't translate, just in real life translating between language, you loose something. In this case you loose speed (having to translate from one to the other), and optimization, because of reason one. ORM's don't do it all. In the beginning, I was for ORMs, then I dove deep into it and you end up with "How do I do this?", "Oh you can't easily, you have to do 10 other queries", or you end up with stuff that just seems like it should work well, but you end up wrecking the performance. ORMs are for simple "Select blah blah from table where x = y". The only small redeeming factor of some ORMs are that they will convert their language to which ever DB. Nhưng nếu bạn được trả tiền để làm việc trên một ứng dụng cấp doanh nghiệp, thì bạn chỉ đang xử lý 1 - 3 cơ sở dữ liệu, được sử dụng cho những thứ riêng biệt. If you have 500 employees and 10,000 customers, the ORM might be bottle neck

Nils Orbat

Hey, is there a library/tool you used to creste the graphics ?

Nils Orbat

Hey, is there a library/tool you used to creste the graphics ?

Praveen kumar Pamani

Thank you for this article , I would suggest this article if people want to know what is node and what can we do with nodejs

Praveen kumar Pamani

Thank you for this article , I would suggest this article if people want to know what is node and what can we do with nodejs

dohkoo

Great article, thanks for the overview. http. //www. steshadoku. com

dohkoo

Great article, thanks for the overview. http. //www. steshadoku. com

subkuchsell. com

thanks for great article really very helpful to understand the node. js subkuchsell. com

subkuchsell. com

thanks for great article really very helpful to understand the node. js subkuchsell. com

Tomislav Capan

Yes, this is true, article was authored and published in August 2013. (sorry for such a late confirmation, haven't seen this earlier)

Tomislav Capan

Yes, this is true, article was authored and published in August 2013. (sorry for such a late confirmation, haven't seen this earlier)

golfman484

In what universe can Mongo DB be referred to as an Object DB? It doesn't support inheritance. It's a Document Oriented DB not an Object Oriented DB. I just don't want any of the kiddies to get confused

golfman484

In what universe can Mongo DB be referred to as an Object DB? It doesn't support inheritance. It's a Document Oriented DB not an Object Oriented DB. I just don't want any of the kiddies to get confused

golfman484

We switched to one language for backend and UI but we decided to keep the language that runs lightning bolt fast at runtime and has type safety and supports standard ORMs with lazy loading etc. , We didn't want to throw all those things away, which is what you have to do when you go with a JS solution on your backend. Java on the backend is a no brainer (so long as you don't over engineer and over complicate your app with memory and CPU sapping Spring). The key to using Java for the UI is use a Java framework that does all the JS for you - so you can live in a world devoid of having to deal with JS and stick with compiled, typesafe, enterprise suitable code. This solution is also scalable - J2SE has supported clustering for nearly two decades now. One such Java UI framework that covers all our JS needs and gives us all the 'partial updates' goodness with an AJAX event driven model with websockets option is Wicket

golfman484

We switched to one language for backend and UI but we decided to keep the language that runs lightning bolt fast at runtime and has type safety and supports standard ORMs with lazy loading etc. , We didn't want to throw all those things away, which is what you have to do when you go with a JS solution on your backend. Java on the backend is a no brainer (so long as you don't over engineer and over complicate your app with memory and CPU sapping Spring). The key to using Java for the UI is use a Java framework that does all the JS for you - so you can live in a world devoid of having to deal with JS and stick with compiled, typesafe, enterprise suitable code. This solution is also scalable - J2SE has supported clustering for nearly two decades now. One such Java UI framework that covers all our JS needs and gives us all the 'partial updates' goodness with an AJAX event driven model with websockets option is Wicket

Rumana Amin

Hi Tomislav, your article is really nice and informative. It helped me a lot to understand Node. js and it's uses

Rumana Amin

Hi Tomislav, your article is really nice and informative. It helped me a lot to understand Node. js and it's uses

WarrEagle

The simple answer is do not use Node. js for that. What part of that are you missing? You want to serve GEO data coordinates to 500K connected clients?. easy. Do a massive JOIN statement across a million rows on a RDBS? You're screwed. Surgeons do not work with chainsaws. Neither should programmers

WarrEagle

The simple answer is do not use Node. js for that. What part of that are you missing? You want to serve GEO data coordinates to 500K connected clients?. easy. Do a massive JOIN statement across a million rows on a RDBS? You're screwed. Surgeons do not work with chainsaws. Neither should programmers

golfman484

You underate ORM as most of the people who have never built an OO system with a decent highly performant ORM that rocks do (and by 'decent' ORM I'm NOT referring to the ORM most people think of using, Hibernate. )

golfman484

You underate ORM as most of the people who have never built an OO system with a decent highly performant ORM that rocks do (and by 'decent' ORM I'm NOT referring to the ORM most people think of using, Hibernate. )

golfman484

I agree - this article and associated comments by the JS fan boys confirms my fears that most JavaScript apps must have anemic domain models (https. //martinfowler. com/bliki/AnemicDomainModel. html) that are quite trivial and virtually expression less - all the work will be done in disassociated (not encapsulated and definitely not polymorphic) business logic

golfman484

I agree - this article and associated comments by the JS fan boys confirms my fears that most JavaScript apps must have anemic domain models (https. //martinfowler. com/bliki/AnemicDomainModel. html) that are quite trivial and virtually expression less - all the work will be done in disassociated (not encapsulated and definitely not polymorphic) business logic

golfman484

I'm guessing your experience with 'ORMs' is limited to Hibernate. I had a similar experience until I thought there must be better ORMs out there - look around - others exist

golfman484

I'm guessing your experience with 'ORMs' is limited to Hibernate. I had a similar experience until I thought there must be better ORMs out there - look around - others exist

golfman484

Good points Adin - I was about to make the same ones. In regard to the article's claim that traditional frameworks "spawn a new thread for each connection (request)". So, so wrong. Must have made more than a few people livid to see such an error which either a) the author knows is clearly wrong and persists with the view or b) has never used any other backend framework and so doesn't realize that he is so wrong. The conflation of connection with request is also interesting. Does his knowledge not extend to understand the concept of connection "keep alives". A connection does not have a one to one relationship to requests as he suggests. This kind of skewed, twisted view of how intelligent, mature, highly evolved frameworks (eg. , Java/Tomcat and I'm sure . net/ASP) handle requests makes me feel like this article is tainted and not representing the truth about alternatives. In regard to moving away from the Request/Response mentality - many existing frameworks have done this also and created a component oriented architecture that supports asynchronous model based updates. eg. , Java Wicket or Angular JS. It's almost like running JS (a type unsafe, non OO language - if you're a believer that manual, self assembly 'prototype' inheritance is in the true OO spirit) on the server is not a concept that has enough merit without twisting the truth about how traditional server side frameworks work. It's like that or maybe it is that

golfman484

Good points Adin - I was about to make the same ones. In regard to the article's claim that traditional frameworks "spawn a new thread for each connection (request)". So, so wrong. Must have made more than a few people livid to see such an error which either a) the author knows is clearly wrong and persists with the view or b) has never used any other backend framework and so doesn't realize that he is so wrong. The conflation of connection with request is also interesting. Does his knowledge not extend to understand the concept of connection "keep alives". A connection does not have a one to one relationship to requests as he suggests. This kind of skewed, twisted view of how intelligent, mature, highly evolved frameworks (eg. , Java/Tomcat and I'm sure . net/ASP) handle requests makes me feel like this article is tainted and not representing the truth about alternatives. In regard to moving away from the Request/Response mentality - many existing frameworks have done this also and created a component oriented architecture that supports asynchronous model based updates. eg. , Java Wicket or Angular JS. It's almost like running JS (a type unsafe, non OO language - if you're a believer that manual, self assembly 'prototype' inheritance is in the true OO spirit) on the server is not a concept that has enough merit without twisting the truth about how traditional server side frameworks work. It's like that or maybe it is that

golfman484

Not every client who has an active session needs to be allocated their own thread - threads are shared and each user only needs a thread to service requests. Requests come in in short bursts and don't need to tie up a thread for very long if the back end code is executing in a highly optimized, compiled language and a fast database. For this reason you can't say "System A can support 10,000 threads therefore it can only support 10,000 clients". The number of clients supported is orders of magnitude greater than the number of threads available because of diversity. Most UI's, if well written, only 'phone home' to the server when absolutely necessary - not "all the time"

golfman484

Not every client who has an active session needs to be allocated their own thread - threads are shared and each user only needs a thread to service requests. Requests come in in short bursts and don't need to tie up a thread for very long if the back end code is executing in a highly optimized, compiled language and a fast database. For this reason you can't say "System A can support 10,000 threads therefore it can only support 10,000 clients". The number of clients supported is orders of magnitude greater than the number of threads available because of diversity. Most UI's, if well written, only 'phone home' to the server when absolutely necessary - not "all the time"

golfman484

It sounds like the node. js people think that JS is the only language that supports concurrency (although they promote a single threaded web server solution -WTF?) and non blocking I/O - of course it's not that case but you seem so excited about such things that I can only assume you have just discovered concepts that have existed in other languages for 2 decades or more

golfman484

It sounds like the node. js people think that JS is the only language that supports concurrency (although they promote a single threaded web server solution -WTF?) and non blocking I/O - of course it's not that case but you seem so excited about such things that I can only assume you have just discovered concepts that have existed in other languages for 2 decades or more

Tomislav Capan

Of course, you understand this is an illustration. In practice, it's a thread pool, which is limited by memory available, and is magnitudes of order less than what an event look can support. Thanks for the comment, though

Tomislav Capan

Of course, you understand this is an illustration. In practice, it's a thread pool, which is limited by memory available, and is magnitudes of order less than what an event look can support. Thanks for the comment, though

Dean Radcliffe

Damn, this is an oldie but goodie. I give talks just like this, and may borrow your slides. In light of these original intentions of node to do awesome things like queued db writes, and server-push, it's surprising how most node apps today are still built on the request/response model and synchronously (but non-blockingly) waiting on db writes

Dean Radcliffe

Damn, this is an oldie but goodie. I give talks just like this, and may borrow your slides. In light of these original intentions of node to do awesome things like queued db writes, and server-push, it's surprising how most node apps today are still built on the request/response model and synchronously (but non-blockingly) waiting on db writes

Ulyana

Great insides, thanks for the article. Node. js do has plenty of advantages. it's lightweight, efficient, and gives an ability to use Javascript on both front-end and backend opens new possibilities. However, it also has drawbacks you should keep in mind. We have tried to describe some in the article https. //www. netguru. co/blog/pros-cons-use-node. js-backend Your opinion would be appreciated a lot

Ulyana

Great insides, thanks for the article. Node. js do has plenty of advantages. it's lightweight, efficient, and gives an ability to use Javascript on both front-end and backend opens new possibilities. However, it also has drawbacks you should keep in mind. We have tried to describe some in the article https. //www. netguru. co/blog/pros-cons-use-node. js-backend Your opinion would be appreciated a lot

Maq Said

Điều tuyệt vời. MongoDB I have never explored. Can you tell more about it and why does it go well with Node. Js

Maq Said

Điều tuyệt vời. MongoDB I have never explored. Can you tell more about it and why does it go well with Node. Js

Misha Kov

This is exactly the article I was looking for, Examples where Node. js can be used. Thanks

Misha Kov

This is exactly the article I was looking for, Examples where Node. js can be used. Thanks

Jessica Barnes

Node.js has the concept of asynchronous execution of Input-output based events through a thread pool. And it concentrates in execution and topping well for low-CPU, highly I/O-bound operations. Just starting to work on Node.js will allow a developers to analyze how to exploit it for maximum performance.

Jessica Barnes

Node.js has the concept of asynchronous execution of Input-output based events through a thread pool. And it concentrates in execution and topping well for low-CPU, highly I/O-bound operations. Just starting to work on Node.js will allow a developers to analyze how to exploit it for maximum performance.

Janguk James Lee

This is a pretty good article motives me to take on Node. js

Janguk James Lee

This is a pretty good article motives me to take on Node. js

Magdalena Mbn

if they ca'tn learn how to handle pointers they can't program

Magdalena Mbn

if they ca'tn learn how to handle pointers they can't program

Orderama Web

TwaT - can you tell me which pub/bar you visit so I can avoid you. I wouldn't be surprised if you OrgASM when you read back your comments

Orderama Web

TwaT - can you tell me which pub/bar you visit so I can avoid you. I wouldn't be surprised if you OrgASM when you read back your comments

philippe

I'd rather have more Java to the client side than more Javascript on the server side. Refactoring Javascript is a nightmare. Whoever work on software with 4000 - 10000 classes like i did knows what i am talking about. I see the threading management as a plus ( if you target to run a site like Facebook otherwise you dont care. Your static content will use cloud flare are 4000 connections AT THE SAME TIME is just insane traffic so i would not compromise maintenance VS scalability ) Not valid from intranet applications at least. I curious if future version of Tomcat will use the reactor pattern, Java itself does provides support for this. You can deal with static content using Nginx which has the reactor pattern implemented https. //www. pascaldimassimo. com/2011/02/10/java-and-the-reactor-pattern Vẫn cho các trang động, tôi chưa tìm thấy bất kỳ manh mối nào. A thread does not hold the session context so i am really skeptical about having 2Mb in there. Trừ khi được mã hóa kém

philippe

I'd rather have more Java to the client side than more Javascript on the server side. Refactoring Javascript is a nightmare. Whoever work on software with 4000 - 10000 classes like i did knows what i am talking about. I see the threading management as a plus ( if you target to run a site like Facebook otherwise you dont care. Your static content will use cloud flare are 4000 connections AT THE SAME TIME is just insane traffic so i would not compromise maintenance VS scalability ) Not valid from intranet applications at least. I curious if future version of Tomcat will use the reactor pattern, Java itself does provides support for this. You can deal with static content using Nginx which has the reactor pattern implemented https. //www. pascaldimassimo. com/2011/02/10/java-and-the-reactor-pattern Vẫn cho các trang động, tôi chưa tìm thấy bất kỳ manh mối nào. A thread does not hold the session context so i am really skeptical about having 2Mb in there. Trừ khi được mã hóa kém

Cody Donelson

Event though the article is a few years old it brings up some great points about Node. js. Reading through the comments I've seen some posts about how Node. js is a wonderful thing, and others about how the leading languages are C#, Java, or Ruby. We know that JavaScript is going to offer some complexities as it relates to Object Oriented Programming, Object Relational Mapping, relational databases, and more. Tôi nghĩ rằng hầu hết các nhà phát triển/người quản lý dự án đang đánh mất điều gì tạo nên JavaScript và Node. js (cũng như AngularJS) thật tuyệt vời. Chúng tôi có thể triển khai ngôn ngữ phía máy khách ở phía máy chủ và làm cho nó thực hiện chính xác như bất kỳ ngôn ngữ phía máy chủ nào khác. Cá nhân tôi thích sử dụng Node. js, mặc dù thật khó để tôi hoàn toàn chìm đắm trong một ngôn ngữ không có kiểu chữ. Một khi tôi nắm bắt được thực tế rằng bầu trời là giới hạn khi nói đến các đối tượng của tôi và tôi không phải ánh xạ các đối tượng của mình từ loại này sang loại khác (như bạn làm trong C# hoặc Java), khả năng viết mã của tôi đã thực hiện . Gần đây tôi đã dạy một vài kỹ thuật viên PC tại công ty mà tôi làm việc về lập trình. Sếp của tôi rất kiên quyết rằng Node. js là con đường của tương lai (đặc biệt là việc ngừng sử dụng các trình cắm Java trong những năm tới) Tôi có xu hướng đồng ý. Tôi không hiểu tại sao lại có một cuộc tranh luận như vậy khi có liên quan đến các đối tượng trong Node. js/JavaScript. Tôi thấy việc sử dụng các đối tượng dễ dàng hơn và tôi có thể sử dụng chúng linh hoạt hơn VÌ có JavaScript. Tôi sẽ sớm triển khai các thuộc tính HTML trong các đối tượng cho các ứng dụng Express 4 của mình. Tôi nhận thấy rằng PUG (trước đây là Jade) cực kỳ có khả năng xử lý các đối tượng và mảng, do đó, giúp ai đó dễ dàng thay đổi động loại, giá trị hoặc thẻ dựa trên đối tượng được gửi qua GET hoặc . Tôi tin rằng một khi mọi người tham gia với sự hiểu biết về cách Node. js hoạt động, cách bạn có thể triển khai hiệu quả các tiêu chuẩn thường được thực thi bằng ngôn ngữ đánh máy và thực tế là Node. js có một số điều kỳ quặc về nó, liệu chúng ta có thực sự có thể tiến lên phía trước và làm cho ngôn ngữ này trở nên mạnh mẽ như các ngôn ngữ trước nó không. Cuối cùng, tôi sẽ nói thêm rằng khả năng sử dụng Node. js hầu như ở mọi nơi làm cho nó tốt hơn nhiều. Cho dù đó là ứng dụng Express được triển khai trên máy chủ Linux, ứng dụng Electron được triển khai trên máy chủ đầu cuối, Node. js is practically a perfect fit for whatever amount of work that needs to be done

Cody Donelson

Event though the article is a few years old it brings up some great points about Node. js. Reading through the comments I've seen some posts about how Node. js is a wonderful thing, and others about how the leading languages are C#, Java, or Ruby. We know that JavaScript is going to offer some complexities as it relates to Object Oriented Programming, Object Relational Mapping, relational databases, and more. Tôi nghĩ rằng hầu hết các nhà phát triển/người quản lý dự án đang đánh mất điều gì tạo nên JavaScript và Node. js (cũng như AngularJS) thật tuyệt vời. Chúng tôi có thể triển khai ngôn ngữ phía máy khách ở phía máy chủ và làm cho nó thực hiện chính xác như bất kỳ ngôn ngữ phía máy chủ nào khác. Cá nhân tôi thích sử dụng Node. js, mặc dù thật khó để tôi hoàn toàn chìm đắm trong một ngôn ngữ không có kiểu chữ. Một khi tôi nắm bắt được thực tế rằng bầu trời là giới hạn khi nói đến các đối tượng của tôi và tôi không phải ánh xạ các đối tượng của mình từ loại này sang loại khác (như bạn làm trong C# hoặc Java), khả năng viết mã của tôi đã thực hiện . Gần đây tôi đã dạy một vài kỹ thuật viên PC tại công ty mà tôi làm việc về lập trình. Sếp của tôi rất kiên quyết rằng Node. js là con đường của tương lai (đặc biệt là việc ngừng sử dụng các trình cắm Java trong những năm tới) Tôi có xu hướng đồng ý. Tôi không hiểu tại sao lại có một cuộc tranh luận như vậy khi có liên quan đến các đối tượng trong Node. js/JavaScript. Tôi thấy việc sử dụng các đối tượng dễ dàng hơn và tôi có thể sử dụng chúng linh hoạt hơn VÌ có JavaScript. Tôi sẽ sớm triển khai các thuộc tính HTML trong các đối tượng cho các ứng dụng Express 4 của mình. Tôi nhận thấy rằng PUG (trước đây là Jade) cực kỳ có khả năng xử lý các đối tượng và mảng, do đó, giúp ai đó dễ dàng thay đổi động loại, giá trị hoặc thẻ dựa trên đối tượng được gửi qua GET hoặc . Tôi tin rằng một khi mọi người tham gia với sự hiểu biết về cách Node. js hoạt động, cách bạn có thể triển khai hiệu quả các tiêu chuẩn thường được thực thi bằng ngôn ngữ đánh máy và thực tế là Node. js có một số điều kỳ quặc về nó, liệu chúng ta có thực sự có thể tiến lên phía trước và làm cho ngôn ngữ này trở nên mạnh mẽ như các ngôn ngữ trước nó không. Cuối cùng, tôi sẽ nói thêm rằng khả năng sử dụng Node. js hầu như ở mọi nơi làm cho nó tốt hơn nhiều. Cho dù đó là ứng dụng Express được triển khai trên máy chủ Linux, ứng dụng Electron được triển khai trên máy chủ đầu cuối, Node. js is practically a perfect fit for whatever amount of work that needs to be done

Gage Poon

Lightening fast, lightweight, smoother development and better performance these are some of the revolutionary changes brought by Node js in the web development field. Node js offers the freedom to creativity, abundant resources like NPM (Node Package Manager), which is a shared library of modules and tools. Additionally, web applications developed using this web development framework are more scalable. This JavaScript framework is very popular among the startups. However, big names like Netflix, Paypal, eBay, Microsoft, Uber, DivBox. in etc. are also using this feature-rich web development framework

Gage Poon

Lightening fast, lightweight, smoother development and better performance these are some of the revolutionary changes brought by Node js in the web development field. Node js offers the freedom to creativity, abundant resources like NPM (Node Package Manager), which is a shared library of modules and tools. Additionally, web applications developed using this web development framework are more scalable. This JavaScript framework is very popular among the startups. However, big names like Netflix, Paypal, eBay, Microsoft, Uber, DivBox. in etc. are also using this feature-rich web development framework

rajivkumar bonam

what is node js how to write code in node js

rajivkumar bonam

what is node js how to write code in node js

Minarchism Leads To Freedom

Great article, thanks

Minarchism Leads To Freedom

Great article, thanks

csps1343

Nice node.js tutorials, thanks for sharing.

csps1343

Nice node.js tutorials, thanks for sharing.

Rahul Raut

thank you so much. learn node https://monkelite.com/what-is-node-js-learn-step-by-step/

Rahul Raut

thank you so much. learn node https://monkelite.com/what-is-node-js-learn-step-by-step/

Chapter247- Software Dev

"Why The Hell Would I Use Node.js? A Case-by-Case Tutorial". Every beginner must required to read this article. It's so easy to understand main Node.Js concept and programming overviews. Hire Node js development company

Sam Watt

Wow, this is a very detailed and insightful article based on cases. I loved reading it, and hoping to see more such articles. Thank you

ThinkStart Pvt Ltd

Useful post. Thanks you for sharing this wonderful information

w3villa

Hi, I like to read your informative blog. Thanks for sharing

Marie adams

I made several successful investments with this broker before losing 40% of my savings to the trading scam. It cost me so much money and pain to invest in an investment that was not even real. I was able to recover the majority of the funds, and we are still attempting to recover the rest. I highly recommend SECURE TO INVEST WELL for anyone involved in an online trading scam Trading scam $350,000 recovered BELOW IS THEIR CONTACT. secure2investwell@gmail. comcall/whatsapp. +14638887391

Marie adams

I made several successful investments with this broker before losing 40% of my savings to the trading scam. Tôi đã tốn rất nhiều tiền và đau đớn khi đầu tư vào một khoản đầu tư thậm chí không có thật. I was able to recover the majority of the funds, and we are still attempting to recover the rest. I highly recommend SECURE TO INVEST WELL for anyone involved in an online trading scam Trading scam $350,000 recovered BELOW IS THEIR CONTACT. safe2investwell@gmail. comcall/whatsapp. +14638887391

Joshua Flynn

Very well written but you could do the same thing using a regular lamp stack with JQuery via AJAX calls like all instant messengers in the past have done with no complications? Even after reading this article I still believe that a Lamp stack with JavaScript and AJAX calls could do the job just as easily but without the complications of understanding the overly complex ecosystem that Node has become. I have read hundreds of articles around the web about why someone should use node but they all cover something that could be done with technology we had back in the 90s. so what is so special about node that I should learn it verses staying with 30 year old technology that has powered the same types of applications that you mentioned in this article 15 years before node came about and back when dial-up was fast. Vì vậy, nếu nó đủ nhanh để thực hiện điều tương tự qua kết nối quay số thì nút đã làm gì để cải thiện hệ sinh thái của internet