You Had Me At Node.js

You Had Me At Node.js

Ah, Node.js, the handy dandy, tried and true, fast and easy, lightweight and scalable, JavaScript runtime environment. (Yes, that’s the official technical definition 😆). There are a couple reasons I’d like to take a Node-first deep dive today:

The (actual) technical definition of Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser. (So, Node.js is actually not a framework or a library). Node came out around 2009, the npm package manager was released the following year, and the world has never been the same ever since. Ryan Dahl first introduced Node.js as an open-source project, which was then sponsored by Joyent. Now used for both front end and back end development, Node.js is highly performant and designed to build scalable network applications. It operates on a single threaded event based loop to make all executions non-blocking. It can handle tons of concurrent connections with a single server, avoiding the burden of managing thread concurrency. Node.js has a “unique advantage because millions of frontend developers that write JavaScript for the browser are now able to write the server-side code in addition to the client-side code without the need to learn a completely different language.”

Pros of Node.js

  • Easy to learn
  • Lightweight, scalable, and performant
  • Fullstack JavaScript, can serve both client and server-side applications
  • Support of large and active community; npm
  • Handles requests simultaneously

Why do developers love Node.js? The team at HarperDB can speak from experience, as they decided to build a database from the ground up in Node.js (you can learn more about this somewhat crazy endeavor here). Generally, Node is lightweight and scalable, enables rapid development, and npm has incredible packages. It promotes efficiency and overall developer productivity as well as code sharing and reuse. One amazing benefit of using Node is as technology is advancing, most of the cool stuff that you want and need is on npm. The community has already done the heavy lifting for you and there are tons of free tools available.

Node.js is great for use cases like real-time web apps, chat and messaging apps, social media, multiplayer games, collaboration tools, API, and even databases! :)

What about the other side of the coin? The list is short, but let’s discuss the potential downsides of Node.js.

Cons of Node.js

  • Does not have direct control of the Operating System/File System
  • May not be as performant as C/C++ (depending on project/use case)
  • Potential performance bottlenecks with heavy computation tasks
  • Relies on callbacks

One author states that one of the main drawbacks of Node.js is its inability to process CPU bound tasks. It is worth noting that there is a native Node.js threading library available that addresses this issue, but out of the box, node is single-threaded. Additionally, due to its asynchronous nature, Node.js relies heavily on callbacks, the functions that run after each task in the queue is finished. While callbacks can be a powerful feature, they open the door for complex and inefficient code if not properly understood. C/C++ can be faster, but can also be more complicated and not necessarily as scalable horizontally.

Global Livestream: Build a Node.js CRUD App with HarperDB!

What are your thoughts? Are you already a member of the Node.js appreciation group, or maybe you haven’t had a chance to check it out yet? Either way, you’re in luck! You can check out the livestream to learn about Node or expand upon your current skills, while building your own Node.js app.

We were excited to host Idris Olubisi, a Software Engineer and Speaker based in Nigeria, as he builds a Node.js CRUD application with HarperDB. HarperDB offers unrivaled flexibility, protection, and value for almost every use case, and we'll do it all with a single installation that can run in the cloud, on-premise, and at the edge. CRUD is essentially the basic functionality of an application that deals with Creating, Reading, Updating, and Deleting records. And you’re already familiar with the awesome benefits of working with Node.js!

As the HarperDB community continues to grow globally, this month's livestream will be at a time that is more accommodating for our friends in Europe, India, Africa, etc. Thanks for your loyalty! (We will also send a recording of the event to all RSVP's)

Meet Idris:

This month’s guest speaker, Idris Olubisi, is a Software Engineer, Technical Writer, and Speaker based in Lagos, Nigeria. He is a Contributor for GatsbyJS and Mentor & Technical Coordinator for She Code Africa. He has extensive experience in the entire project life cycle, from concept to implementation to integration. Idris is an expert at problem-solving, technical leadership, communications, and presentations.

All are welcome! This free virtual code along will be followed by Q&A with Idris and the HarperDB team, so bring your questions. (If you’d like, you can also check out HarperDB’s Node.js SDK available at the Marketplace or on npm).


0_K-3utN-vcdxKDZAH.gif