Connecting to XPages NoSQL DB from the Node.js Runtime in Bluemix
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:
- Creating a database service instance and enabling RESTful API access to it
- Building a Node.js application to communicate with the database service
- Extending the application functionality and accessing the database instance through a RESTful API
- Configuring the application for deployment to Bluemix
- 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
- Add the XPages NoSQL Database service from the experimental section of the Bluemix catalog.
- Launch the database service from the Bluemix UI.
- 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.
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
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.