How to use Node.js?
What is a Node server?
With Node.js you can build fully-fledged scalable web servers that can handle HTTP requests, WebSockets, or API requests. You can also use Node.js to build proxy servers or front-end load balancers for other servers (Apache) and use them for routing client requests.
Why use Node.js?
Who uses Node.js?
In 85% of cases, Node.js is used for the development of web apps. There are examples of successful projects that were built with Node.js from the ground up, like Trello, as well as those who moved to Node.js after trying other solutions, like LinkedIn. Among the most famous enterprise-scale Node.js app examples you’ll find Netflix, Twitter, and PayPal.
How secure is Node.js?
Node.js is as secure as the code that is written using it. Most probably you’ll reuse code packages written by others and available in the Node.js ecosystem. The problem is when your project contains code from hundreds of different packages, it can be hard to spot a vulnerability. The good news is since 2018 the Node Security Platform (NSP) has been integrated directly into the npm library and runs security audits for every new module added. Anyway, for better security, make sure to use the latest maintainable versions of frameworks and modules, dive deep into the code package dependencies, and study the licensing information carefully. To mitigate the risk of attacks, hire experienced Node.js developers whose code is not vulnerable to the most common attacking techniques, such as man-in-the-middle, code injection, Advanced Persistent Threat, Cross-Site Scripting, Cross-Site Forgery Requests, and others.
What is Node.js not good for?
Being a single-threaded runtime environment, Node.js is not suitable for the execution of CPU-intensive tasks. As all incoming requests are processed one by one, a heavy-computation task can block the main thread from processing all the subsequent requests. To cope with this drawback, Node.js offers a Worker Pool that summons a few separate threads for the execution of expensive tasks. However, if your app requires resource-consuming computation, it’s better to use other languages (for example, Java) on its backend.