This split complicated application development, because it required having two sets of software developer talents—or even two separate software developers or teams—one for client-side and one for server-side application development.
You might have heard about node.js from other sources. It’s getting a lot of press in the developer world lately. As far as popularity, according to the 2017 Stack Overflow Developer Survey, Node.js is growing in popularity, while the usage of languages like C# and C has been shrinking. In the same survey, node.js also ranked as the second most-loved language and first most-wanted language among developers.
Now let’s take a minute to unpack all of that so we can get a real understanding of how and why node.js has become so popular. And why you, an automation professional or potential IIoT developer, should have it on your radar.
Node.js, also commonly referred to simply as node, is built around an asynchronous design. Which means that node doesn’t have to wait for file I/O or database operations to continue processing before it can do something else, which increases its processing speed.
Database I/O is traditionally one of the slowest processes web applications have to deal with. Imagine in our IIoT application that one of our edge computing devices needs to query a database to figure out if it should shut down a machine. If we have delays from database I/O, it might not be shut down when it should be.
Asynchronous design also means node can handle millions of concurrent connections at once. Millions. Node is also able to support real-time applications, which is key for IIoT application development. For optimum performance, we want our devices and our cloud applications exchanging data and making decisions in real time.All right, so we understand node’s event-driven, non-blocking I/O model and that it makes it lightweight, efficient, and a great fit for IIoT applications. Now let’s delve into the world of Node.js' package ecosystem, npm—the largest ecosystem of open-source libraries in the world—to get a better understanding of how huge node could be in the realm of the Industrial Internet of Things.
But for us to understand where node.js could be going in the future, we should start with a lesson from the past.
Throughout the '70s and '80s, any number of Unix distributions were available on the market. There were BSD from AT&T, Solaris from Sun Microsystems, AIX from IBM, and a number of others. They were all essentially derived from AT&T's BSD and required various licensing schemes to legally use them on your computer systems.
Then in 1991 a really sharp student named Linus Torvalds started a small personal project that would ultimately become the Linux kernel. Fast forward to today, and Linux is used just about everywhere. There are loose derivatives of it in your smartphone, your cable box, probably even in your television and car entertainment system. Unix, on the other hand, not so much. Sure, it's still used to keep old mainframe systems running, but it's rare in my experience.
In fact, if you look at a lot of devices in industry today—sensors, barcode readers, edge computing gateways—there’s a massive surge towards using Linux as the base operating system for these devices. Perhaps even advanced automation controllers may run Linux someday. And why is that, you might ask? Because it’s open source.
That means there’s a huge number of people not only using it, but supporting it as well. So someday, it may become that much harder for a vendor to lock their customers into a particular hardware or software platform and price gouge them for product support and bug fixes. And I think you know which vendors I’m referring to.
It’s this same open-source community theme that node.js gets its power from.
See, when you start down the path of using node.js in your application, you’re not going on that journey alone. Accompanying you is the world of open-source software developers. And that world is full of some incredibly brilliant people. (Some even reside here at Opto 22 headquarters.)
The open-source community is happy to lend a hand in answering your software development questions. Or even lend you the code they’ve already created to help get your product or application to market that much faster. And that’s the real power of nodes.js’ npm ecosystem: the developer community and culture that come with it.
Take a trip over to node.js npm repository to see what I mean. This is where people upload software code they’ve developed for others to use in their application.
Want to develop an application to talk to your PLC? Search for your favorite automation controller vendor (Opto 22, of course) and see what you find.
My guess is you’ll find several contributions already there, ready to use in your application.
Want to move data from your control system into an SQL database? Run a search for SQL and see what you get back. In fact, run a search for whatever you want to do. There are currently over 450,000 contributed nodes in the npm repository. Surely there’s a node for you and your application in there.
After browsing through the npm repository, your head’s probably spinning with all of the amazing things you’re beginning to realize node.js has to offer.
And the answer is this. Twenty or so years ago, the Internet exploded, and every household in America scrambled to get connected to the digital word. But that wave of connectivity didn’t stop there.
Today we’re taking connectivity a step further and beginning to bridge the gap between traditional industrial devices like pumps and motors and the digital world of cloud computing. Through the boom of Internet connectivity in almost every home, we’ve learned that the world is a better place when information flows freely. And we’re beginning to apply what we’ve learned in our own homes to what we’re doing at work out in the field or in our plants and factories.
We’re asking questions like, what if that pump or motor could email the maintenance team for service before it breaks? What if operators could spot the conditions that statistically relate to an explosion on an offshore oil rig, but before the explosion ever happens?
We’re wondering what big data our plants and factories hold that could be used for competitive advantage. These advantages might be there waiting to be tapped into, but we just can’t spot them without tools like machine learning and artificial intelligence software to sort through monumental amounts of data for us.
But the point is this: there’s an overwhelming trend of adopting Internet technologies across all aspects of our lives. Internet technologies based around open standards have infiltrated the historically proprietary technology stacks of the industrial automation and process control industries.
But let’s say you absolutely hate writing code. Don’t worry, you’re not alone, and I totally get that. But the Industrial Internet of Things is still accessible to those of us who shy away from coding. Many years ago I started off as a computer science major in college. I loved writing code until I realized how much I loathe debugging it.
For folks like us, who maybe want to start building an IIoT application today without having to write any code, there’s a really handy software development tool called Node-RED, which we'll cover in our next post.