Node.js Review What Are the Best and Worst Aspects of This Popular Platform
Since its original release in 2009, Node.js has become one of the hottest development platforms. It's the most commonly-used framework per a survey of developers by Stack Overflow (the second most-used is .NET), and it powers at least 20 million sites. As a startup founder or project manager, you're probably having discussions about whether you should use this framework for your next project. Whether that's a web app or even a desktop application (Electron), you can use Node.js pretty much everywhere. We aim to help guide those decisions with this in-depth Node.js review.
- Node.js Review: What, Exactly, is Node.js?
- What are the Benefits of Node.js?
- What are Some of the Disadvantages in this Node.js Review?
- How to Learn Node.js
- Node.js vs Ruby on Rails vs Django vs Symfony: See Which is Better in Our Node.js Review
- What Do You Need to Get Started?
- Node.js Review Conclusion: Choosing Node Requires Some Analysis
There's a lot to love (and hate) about this platform for building fast web applications. As we'll see, though, for the most part, the many Node.js advantages make it one of the best platforms available. Therefore, if you're thinking of building a web app, it's almost always a wise decision to use Node.js as your backend framework.
Node.js Review: What, Exactly, is Node.js?
If you have a Node installation, you can see this for yourself. Type "node" into the command line. You'll see something like:
Welcome to Node.js v14.16.0.
Type ".help" for more information.
Type console.log("Hello World");
Node.js will print this:
> console.log("Hello World");
Hello World undefined
Now, Node.js isn't just a single framework that you can run. It frequently refers to an entire ecosystem of robust, time-saving tools that help developers build and test apps efficiently.
So, with that in mind, let's continue with our Node.js review to see if this tech stack is right for you.
What are the Benefits of Node.js?
However, there are quite a few benefits of Node.js. Below are the top five benefits of this platform:
One of the Most Substantial Benefits of Node.js: Using the Same Language for Both Frontend and Backend
As alluded to earlier, one of the most significant benefits of Node.js is the fact that the frontend and backend only use one programming language. The benefits of this become more apparent the more you use the platform.
Consider a typical client-server application. The client calls an API to fetch some data — for this example, let's say that this is user information — and the server returns it in some format. Furthermore, suppose the client expects the server to return the user's name, age, and avatar.
Now, let's suppose we add a property called "created date" so that the client can display a message thanking the user for being with the service for however many years. We'll need to change this in two places. The client will need to change to expect this property, and the server will need to change it.
Another of Node.js Advantages is that it is Scalable
What this means is a fast and scalable architecture. Real-world testing frequently shows that Node is more rapid than PHP and Java — two popular server-side languages. It's also quicker than ASP.NET (although .NET Core does give Node.js a run for its money in terms of speed).
These types of tricks show the extensibility and scalability of the platform. Most people find that Node.js apps run exceptionally well.
Many Prominent Companies Back and Use Node
Earlier in this review, we mentioned the Node Package Manager (npm) that most Node applications use. This service has a parent organization of GitHub, which Microsoft recently purchased. The OpenJS Foundation, of which Node is one of their products, receives backing from Google, Microsoft, Netflix, Red Hat, IBM, GitHub, GoDaddy, Bloomberg, and many other large companies.
Node has quite a few prominent websites that use it, including PayPal, Groupon, Wall Street Journal, Ancestry, Zendesk, and Yahoo. Many other companies probably use Node.js in some additional capacity. Indeed, anyone that builds an Electron-based application uses a version of Node.js.
The bottom line is that Node has a strong corporate backing. This platform isn't going anywhere and is continuing to undergo active development. Therefore, anyone seeking to start a project using Node should feel comfortable with that decision.
Node.js Review: One Major Advantage is All the Packages
In April 2020, npm crossed the 1.3 million mark for the number of packages hosted on the platform. That's 1.3 million packages that any Node.js developer can avail themselves of to make prototyping, development, deployment, and testing easier.
Essentially, if there's something you want to do with Node.js, there's probably a package to help you.
If you need to write a simple API, you may wish to consider Express.js. Are you looking to do some scientific calculations? Well, there's rlab, a library that emulates R. Media encoding? Yep, you can use beamengine, a Redis-backed cloud media processing engine. Or, if you use Azure, you can use datafire's offering (you can even use this for 1900 other APIs.).
No matter what you're looking to build, there's a good chance that there's a package available on npm that can accelerate your development and ensure higher-quality code.
The npm repository is arguably Node's greatest strength. It's truly an example of leveraging open-source's power to build quality applications faster and with higher quality.
Node is Simple to Learn
Anyone with a text editor (or a free IDE like Visual Studio Code) can begin writing Node.js applications.
It's also worth noting that Node.js has a lower barrier of entry. For starters, it tends to run pretty well on almost all hardware. It doesn't take up too much memory (there are ways to run Node with even 128 MB of RAM).
Ultimately, this means that one of the benefits of Node.js is that it is accessible to all. Developers from all walks of life — even those that may not have the best internet connections or computers — can begin to learn how to code in Node.js. In turn, this leads to a more vibrant, diverse community of developers that can potentially work on your application. That's a big win for us in this Node.js review.
What are Some of the Disadvantages in this Node.js Review?
While Node.js has some positives, no platform is perfect. There are three areas, in particular, where people may find Node.js to be a little more challenging to use.
Performance Bottlenecks for Certain Computational Tasks
In this Node.js review, we already mentioned how single-threading could sometimes be a performance issue. While it's usually pretty easy to bypass this for serving requests, there are other potential performance bottlenecks for heavy computation tasks.
Consider how a single-threaded environment plays out with a task that requires heavy computation. Let's suppose you have a service that lets a user upload an image and
perform some processing on it (maybe your service makes the image brighter or makes the color appear more natural).
If you implement this the quickest way, you'll have an API with some pseudocode that looks like this:
Wait For Image
Wait For New Image
Here's the problem, though. Since Node is single-threaded, this simple implementation will block the main thread while the image processing completes. If a user uploads image A, then the API will be unresponsive until A's processing is complete.
To solve this problem, you'll need to spawn a child process to do the image processing. However, you'll need to use interprocess communication to communicate the results between the two processes (remember, these aren't threads but official NodeJS processes with more overhead to spin up).
Ultimately, with enough experience, you'll know exactly how to ensure your app gets peak performance — even with heavy computation. However, given Node's constraining single-threaded architecture, you may find that you have a bit of a learning curve if you come from another language, like C, that makes threading a breeze.
Node.js Review: Immaturity of Tooling
While Node.js has been around for a while, its usage didn't pick up until relatively recently. Its growth exploded around the 2016–2017 timeframe, so many of the tools that developers use are comparatively immature (for example, the Microsoft .NET and Visual Studio toolsets have been around for decades).
Therefore, it's not entirely unheard of to run into issues with the tooling. Node modules may conflict, TypeScript may compile something with an unintended side effect or incorrectly check some types (there's a reason why TypeScript has a @ts-ignore property.).
It's worth noting that these are not common issues, and indeed, they should not be a deterrent to using Node.js. However, it is something we needed to point out in this Node.js review. Please keep it in the back of your mind when selecting Node.js as your preferred platform (and for devs when creating estimates for how long work will take).
Finding and Hiring Developers
Since Node.js has had a significant increase in popularity recently, finding and hiring developers has also become significantly more challenging. High-quality Node developers are some of the most sought-after in the industry. These developers often find themselves able to work for big multinational tech companies to startups to everything in between. There's no shortage of work for the best Node.js developers out there.
Since Node.js can be a little trickier to work with (especially if you want to achieve top performance), finding and hiring the best developers becomes vital if you have a computationally-intensive application in mind.
If you are a founder or project manager looking to figure out whether or not to use Node.js for your next project, this is something to consider. Finding quality developers for Node.js will be much more challenging than finding developers for some of the other less-used tech stacks. That's not to say that there aren't good Node developers out there — there are many of them. However, you'll find yourself in a lot of competition. You probably won't be the only company or startup interested in them.
Fortunately, if you find yourself short on Node.js developers, you can always outsource the work. Indeed, some companies see the outsourcing model as more sustainable and predictable long-term than hiring talent in-house.
How to Learn Node.js
If you're interested in learning about Node.js after reading this Node.js review, you should know that there are quite a few free or low-cost resources that will make your journey significantly more straightforward.
First, start with the official documentation. Node has an extensive set of very detailed docs. If you want to know how something works on the platform, the official documentation is the place to go.
Next, consider reading some documentation and tutorials from trusted sites. W3Schools has an excellent Node.js tutorial that can help developers learn how Node works under the hood. It starts by explaining how to create the most basic of servers (no third-party frameworks). That is a great way to learn how Node.js works.
Even sites like Visual Studio Code have Node.js tutorials. These IDE-specific tutorials will help walk you through the basics of debugging and setting up a Node app.
If you feel that you might learn better by watching some more formal instruction, consider the courses available on Pluralsight or Udemy. These will give you a more in-depth look at the world of Node and provide more structure to your learning.
Finally, consider browsing places like Stack Overflow for questions related to Node.js. Sometimes looking at what other people are asking and looking into the solution yourself or reading what others suggest can be a great way to learn more about a platform.
Node.js vs Ruby on Rails vs Django vs Symfony: See Which is Better in Our Node.js Review
The four most popular web application frameworks are arguably Node.js, Ruby on Rails, Django, and Symfony. If you're debating about which one to use, here are the top pros and cons for each platform (including which type of app might be best suited for each tech stack).
Node.js Advantages: Node is fast, efficient, has a large community, and has strong corporate backing. Although Node itself is minimalist in what it includes, there's so much that npm comprises that you can write practically anything with it.
Disadvantages: Computationally-heavy tasks can be difficult to code. The asynchronous model can sometimes be challenging to learn.
Best For: Node.js is best for web backends that are not necessarily computationally-intensive. Node has a lot of speed, making it perfectly suited for a backend API that acts as an abstraction for your business logic.
Ruby on Rails
Advantages: Ruby is a simple, straightforward language. Rails tends to be suitable for fast development. Ruby also has Gems, which act like Node's npm repository.
Disadvantages: Ruby doesn't scale as well as Node. While it's possible to make high-performance applications with Ruby, it's most definitely more challenging than Node.
Best For: Sites, where scalability isn't as much of a concern, will benefit from Ruby's fast development and prototyping. Rails works well for MVPs.
Advantages: Django is one of the more comprehensive frameworks available. It creates a structured, secure, easy-to-modify app that works and scales well.
Disadvantages: For many uses, Django comes with a lot of stuff that you don't need. You might not need a user system or some of the middleware. While you can customize some of that, it's still not as flexible as Node.
Best For: Simple sites that need an admin panel and user system. Django also works with multiple database backends, which can be beneficial if you have a requirement to use a specific database provider (e.g., your company uses Oracle exclusively).
Advantages: Symfony is a fast, efficient PHP framework that is scalable, stable, and works well for large projects. Twig, Symfony's templating engine, is remarkably impressive.
Disadvantages: Like Django, Symfony includes many things that your app may or may not need. It naturally supports many CMS features that you may or may not need. If you're writing a backend API, the ability to do templates isn't that useful.
Best For: Frontend sites that need templating and other CMS functions. There are reasons why websites like Yahoo Answers, Dailymotion, and National Geographic use Symfony.
What Do You Need to Get Started?
If you are looking to get started using Node.js, here's what you'll need:
- The latest copy of Node.js. Node works on Mac, Windows, or Linux, so no matter what platform you have, you'll be able to run this platform.
- It's usually the simplest to get started with the official documentation, so pulling that up and keeping it open in a browser is always a good idea.
- You'll also need an IDE. While there are many to choose from, most people tend to use Visual Studio Code or Atom.
- The relevant frameworks. If you're just getting started, Express.js is usually an excellent place to begin. You can add and research other frameworks as you need them.
Once you have all the components above, you're all set to begin diving into the world of Node.js.
Node.js Review Conclusion: Choosing Node Requires Some Analysis
fine-tuning shines when put on the backend.
That makes it easy, on the whole, to recommend Node as a technology stack to use when building a new web or desktop application.
However, given that Node.js has some less-than-ideal traits, you have to weigh Node's advantages and disadvantages for your particular application. Other frameworks may work better for some use cases (like Django's admin panel and user system that comes out of the box).
At Impressit, we have experience with Node.js and its competing frameworks. If you currently have a Node.js project or you would like to figure out if Node is the right tech stack for your future project, please contact us. We would love to learn more about your project and see how we can make Node (or another tech stack) work for you.