Getting Started with Node.js

Sean Delaney
3 min readMay 11, 2021

In my software engineering bootcamp, our progression from back to front end full stack engineering started with Ruby and Rails and moved on to vanilla JavaScript and React. After deploying several projects with a Rails API backend, I started wondering about different backend technologies as I started my job search and saw how in-demand Node.js programmers were in the current market. There’s a ton of articles which discuss the performance benefits, and pros and cons of Ruby on Rails and Node.js as backend technologies, but this blog mostly focuses on my experience as a Node.js beginner and what I’ve learned so far.

What is Node.js?

The official definition states that Node.js is “a JavaScript runtime built on Google’s open-source V8 JavaScript engine.” But what does that mean? While most full-stack developers have experience running JavaScript in the browser, which natively understands it and is its runtime; Node.js simply takes JavaScript out of the browser and executes it without the browser’s restrictions. Node.js is a runtime, an environment, that allows us to write and execute JavaScript code outside of the browser. The V8 engine developed by Google is now what executes our JavaScript code outside the browser in a semi-standalone environment. These are the conditions which allow Node.js to be a web server that can build fast, and highly scalable data-intensive network applications.

Why should I use Node.js for my back end?

One of the main reasons for using Node.js as your application’s back end is being able to use one language for your full stack, JavaScript. As noted above, Node.js is perfect for building fast and scalable data-intensive applications like an API with a database behind it, or a data streaming application like Netflix, a real-time chat application, or a server-side web-application. What Node.js isn’t good for is applications with heavy server-side processing that are CPU-intensive: intense image-manipulation, video conversion, or file compression. Rails, PHP, or Python are better options for applications like these.

What makes Node.js so fast?

Node.js is single-threaded, based on event driven, non-blocking I/O model. What does this mean? Single-threaded code is executed in the same thread with every client request, whereas other languages such as PHP or Ruby instantiate new threads with each client request. Node.js is extremely fast because it operates asynchronously by using callbacks; instead of waiting for a response from a GET request, Node.js uses a callback function to come back and complete that request while going on to do other things. That means that when a user triggers an event in our application, clicking a button to fetch some data, the single-thread which all other users are interacting with isn’t blocked by one user’s request.

As I continue learning Node.js, I hope to share more of its features and benefits in the future. I’m currently working on an application with a Node.js backend and React front end to further my understanding of Node and build JavaScript on the server-side.

--

--