Connecting to XPages NoSQL DB from the Node.js Runtime in Bluemix

by Victoria FedzkovichAugust 31, 2015
In this tutorial, Gary Marjoram of IBM shows how to access the experimental XPages NoSQL Database service from the Node.js runtime via a RESTful API.
Why read this?

Deploying an application to Bluemix requires certain preparation. Watch the video and learn about adjusting a Node.js application behavior to run it both locally and in the PaaS. Plus, grasp the general idea of how to create an application manifest and work with the Cloud Foundry CLI.


IBM has introduced three experimental additions to the Bluemix catalog—the XPages runtime, XPages NoSQL Database service, and XPages Web Starter that combines the runtime environment and the database service. Watch this video if you are interested in using XPages NoSQL Database from other runtimes in Bluemix, such as Node.js.


This tutorial from Gary Marjoram of IBM explains how to interact with the XPages NoSQL Database service instance from the Node.js runtime via the RESTful API provided by the database service. In addition, it focuses on how to configure a Node.js application running locally for deployment to Bluemix.

The scenario executed in the video includes:

  1. Creating a database service instance and enabling RESTful API access to it
  2. Building a Node.js application to communicate with the database service
  3. Extending the application functionality and accessing the database instance through a RESTful API
  4. Configuring the application for deployment to Bluemix
  5. Pushing the application to Bluemix

To go through the tutorial steps, you need:

  • Bluemix account
  • Cloud Foundry CLI
  • Eclipse IDE with the Nodeclipse plugin
  • IBM Domino Designer
  • IBM Notes client


Add IBM XPages NoSQL DB and access it via an API

The following path is suggested for a Bluemix user to complete the first part of the demo:

  1. Add the XPages NoSQL Database service from the experimental section of the Bluemix catalog.
  2. Launch the database service from the Bluemix UI.
  3. Enable RESTful API access to the database from IBM Domino Designer.

The last step assumes that prior to enabling the access, the user has switched to the ID provided by the XPages NoSQL Database service and has created a connection document in the IBM Notes client for the Domino server where the database resides. Take a look at the video that guides you through the process of connection to the database service from IBM Domino Designer.

You can find reference resources for Domino Data Service, which is a RESTful API that accesses databases on Domino servers, and further explore IBM Domino Access Services here.


A Node.js app: build, extend, and push to Bluemix

Let’s now move on to a Node.js application created as an Express project with the Nodeclipse plugin for Eclipse IDE.

From the tutorial, you can understand the logic of communication with the XPages NoSQL Database service via a RESTful API. In particular, the POST method for adding a document to the database and the GET method for retrieving information on the entries in a view are used in the demo.

Refer to the final part of the video to get the details about configuring the application to push it to Bluemix while preserving the ability to run locally. What is important to mention here is that a package.json file must be present in a Node.js application because it allows Bluemix to detect the right buildpack for the application. For deploying the application with the Cloud Foundry CLI, you also need an application manifest file.

Altoros Take

The IBM Notes and Domino family of products has been on the market for 20+ years. In effort to improve the software user experience with web and mobile capabilities, IBM released XPages (2008) positioned as a platform for building modern versions of Notes and Domino applications and extending the old ones. Today, bringing XPages to the cloud seems to be the next logic move from IBM, and this certainly is a good news for XPages developers. Although the additions to Bluemix are experimental, their launch means that now users can leverage a scalable PaaS environment for XPages applications running on IBM Domino.

Additionally, one of the core foundations of Bluemix architecture as a PaaS solution is the opportunity to combine different runtimes and services, which allows using XPages NoSQL Database outside of the XPages runtime. In other words, you can work with your Domino databases (NSFs) from the Node.js runtime or others.

Visit the IBM Bluemix Dev resource to scrutinize the experimental XPages additions more carefully. IBM Bluemix documentation has some sections dedicated to XPages, as well. The XPages development community manages its own website.

Want details? Watch the videos!

Table of contents

  1. Adding an XPages NoSQL Database service instance (0:47)
  2. Enabling RESTful API access to the database (1:36)
  3. IBM Domino Access Services documentation (3:15)
  4. Creating a Node.js application (6:37)
  5. Extending the application (7:41)
  6. Configuring the application for deployment to Bluemix (21:40)
  7. Pushing the application to Bluemix (26:07)


About the expert

Gary Marjoram joined IBM and the IBM Domino Designer team in April 2013. He has more than 18 years of experience in the software industry and works as a Senior Software Engineer at IBM Ireland.


The post was written by Victoria Fedzkovich and then edited by Alex Khizhniak.