IBM Support

Tips and tricks on using a DB2 LUW data source with Data Science Experience (DSX)

Technical Blog Post


Abstract

Tips and tricks on using a DB2 LUW data source with Data Science Experience (DSX)

Body

Data Science Experience is an extremely powerful and flexible platform for exploring a wide variety of tools and capabilities related to data science. For example, DSX brings together all the assets you need (including working code, sample data sets, and in-depth tutorials) to explore the power of machine learning.

With the introduction of DSX Local, you now have many possible combinations of platform and data source to explore, including:

  1. All public cloud: DSX Public Cloud with data source in public cloud (e.g. dashDB)
  2. Private cloud/local: DSX Local with private cloud / local data source (e.g. DB2 LUW or dashDB local)
  3. Hybrid: DSX Public Cloud with private cloud / local data source (e.g. DB2 LUW)

A rich set of information is available to help you create connections in scenario #3, including:

However, even with these resources, it can be a bit tricky to navigate the objects that you need to create and the credentials that need to be used to exploit on-premises data sources (like a DB2 database) with DSX Public Cloud. This blog augments the information linked to above with some additional details that you need to know about to take advantage of scenario #3: using DSX Public Cloud with a private cloud / local data source.

To start with, let's look at the objects that you need to create for scenario #1 - all public cloud. In this simple scenario (e.g. dashDB as a data source for DSX Public Cloud), the only DSX object that you need to define in addition to the Notebook containing the connection code is a Connection object for the data source:

Object

Where created

Credentials

DSX Notebook

DSX

Service credentials for dashDB in the Bluemix dashboard

DSX Connection

DSX

Both these objects use the same set of credentials: the host, port, database, ID and password that you get from the Service Credentials section in Bluemix for your dashDB service. The following screen shot shows these credentials highlighted in red:

image

Now consider using a DB2 LUW data source in DSX Public Cloud. In this scenario, there are a total of four objects that you need to define. In addition to the DSX Notebook and Connection that you needed in the all public cloud scenario, you also need to create a Secure Gateway object in Bluemix as well as a client on the system where you private cloud / local data source resides:

Object

Where created

Credentials

Secure Gateway

Bluemix

Local host and port (for definition of the Destination within the Secure Gateway)

Client

Local system for DB2 db

NA

DSX Notebook

DSX

Local ID & password; Cloud host & port (as shown in the Destination of the Secure Gateway)

DSX Connection

DSX

In the information resources linked to at the beginning of this blog, there are a few key points that aren't entirely clear. Following is a list of the key points that you need to remember when you're setting up a private cloud / local data source for DSX Public Cloud:

  • The Secure Gateway that you need to access a local data source from DSX is defined in Bluemix, not DSX.
  • The credentials used in the DSX Notebook and Connection come from two different sources:
    • ID, password, and database are the same ones you would use to connect to the database locally
    • Host and port are not the local host & port for the database. Instead, the host and port to use in this context are the Cloud host & port as shown in the Destination in the Secure Gateway - see red highlighting in the following screen shot of the Destination properties in the Secure Gateway service in Bluemix:

image

 

 

 

[{"Business Unit":{"code":"BU029","label":"Data and AI"}, "Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11140532