Blog Summary

  • Learn about Node.js and why it is useful for you
  • Find out when Node.js in CICS is the best choice
  • Explore how to run Node.js application in CICS


What is Node.js?
Node.js is a server-side JavaScript runtime platform. It is lightweight, efficient, and designed to build scalable network applications.

What is JavaScript?
JavaScript is a high-level, interpreted programming language used by most websites to run code inside web browsers to create exciting and responsive pages. This has led to JavaScript becoming one of the most widely used languages today.

Why should I choose Node.js?
Node.js enables JavaScript developers to use their skills to write applications that run on the server, for example to host the RESTful API components that are called by JavaScript running in the browser.

Node.js encourages JavaScript applications to be written using modules, for example Express provides a web framework, and LoopBack provides an API framework. There are many Node.js modules available for free on the NPM public registry for most tasks, saving considerable time for application developers. Most modules are written in JavaScript and a few are written in C/C++. The npm utility supplied with IBM SDK for Node.js – z/OS can download, compile and install these modules on z/OS from the public or a private repository.

There is a large community of full-stack developers able to design and code the UI, APIs and server components, and Node.js is their preferred runtime. The Node.js Foundation claim there are 9 million instances of Node.js.

When should I host my Node.js applications in CICS?
Node.js is a very popular runtime for JavaScript applications on server platforms. It is very efficient at handling intensive network and database interactions. For example, full-stack developers already use Node to serve web applications and APIs that consume information from backend systems such as CICS and Db2.

Hosting Node.js application in CICS brings together those components onto one platform, making it easier for development and operations staff to manage them. This reduces the number of moving parts and latency between components, and takes advantage of the world-class strengths of the mainframe such as security, resilience, and cost effective scalability.

Some additional benefits of IBM SDK for Node.js – z/OS are outlined in article Reasons to Host your Node.js Applications on z/OS, including that it is eligible for IBM Z container pricing.

When is Node.js the best choice to use with CICS?
Many CICS customers expose their core business applications as RESTful APIs, for example using CICS web services or z/OS Connect Enterprise Edition. In some cases APIs need additional logic for example to combine several APIs, or to augment them with data from other sources.

Although Node.js applications can be hosted on many operating systems and cloud environments, it can be more efficient, secure, and have fewer moving parts in the overall solution when hosting them on z/OS together with the applications and data they consume.

CICS already supports applications in several languages. Why do I need Node.js?
CICS has always been unique in providing developers the choice to use the language most appropriate to tackle the business and technical requirements – be it with Java, COBOL, PL/I, C/C++, or Assembler. CICS TS V5.5 is extending this choice by adding support for Node.js.

How does Node.js differ from other languages supported by CICS?

Node.js applications are inherently asynchronous, they don’t share in the implicitly single-threaded mentality of traditional CICS languages and programs. For example after enabling the Node.js runtime, the application is started and typically defines listener code to be called when an HTTP request is received, and then returns to the runtime. For each HTTP request, a new instance of the listener code is called to process it. Similarly the Node.js application can use this event-listener model to process other API or database requests that involves I/O delays. This allows the runtime to efficiently run all JavaScript code in a single thread and delegate I/O to a few worker threads. This model may sound familiar, it’s similar to what CICS itself offers for other languages; Node.js applications are written to expect this type of high volume workload, and the Node.js runtime implements the sub-dispatching that is required within that single application.

The integration of Node.js with CICS brings two diverse user communities together; the ecosystem of CICS products and tools can be used to manage a collection of Node.js applications, and the power and flexibility of a modern language is brought to CICS.

Although Node.js application can call CICS programs using network services, for improved response times they can also use a locally optimized memory transport provided by the ibm-cics-api module.

Which type of IBM Z processors does the Node.js application run on?
Node.js applications are run on general purpose CPs, and some operations use the Integrated Cryptographic Services Facility (ICSF). See Installing and configuring IBM SDK for Node.js – z/OS.

In what ways can Node.js ensure CICS and its COBOL applications stay relevant?
Node.js is ideally suited for integrating services and if those services or microservices expose useful function from COBOL applications, it keeps your business responsive and able to quickly fulfill business requirements from your existing CICS application estate. Keeping the COBOL applications, their services and APIs and the Node.js integration code in one place makes management easy and minimizes the likelihood of communications performance degradation.

How do I run my Node.js application in CICS?
A Node.js application typically consists of a .js file that is the initial script, a package.json file that describes the modules the script requires, and other scripts, modules, and web site files.

First create a CICS bundle using CICS Explorer V5.5, copy the Node.js application into the bundle, then start the CICS bundle editor. Select New > Node.js Application and the wizard will guide you through selecting the Node.js application start script and creating a profile. The profile is used to configure the environment for Node.js and the environment variables the application requires, such as a TCP/IP port and working directory for log files.

Next export the CICS bundle to zFS. If your application requires modules that are not already installed in zFS, use the utility Node Package Manager (npm) that is provided with IBM SDK for Node.js – z/OS to install them into either a global location or the CICS bundle.

Finally define and install a BUNDLE resource in CICS. The Node.js application will be started. The BUNDLE resource and the new NODEJSAPP can also be used to monitor the application.

What do I need to try hosting Node.js applications on my system?

Can I try this out without installing anything?
Yes – sign up at the page “Join our CICS early access program” and the beta team will provide a system you can access via your browser to try this out.

Join The Discussion

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.