Red Hat JBoss Data Virtualization on OpenShift: Part 2 – Service enable your data

Welcome to the part 2 of Red Hat JBoss Data Virtualization (JDV) running on OpenShift.

JDV is a lean, virtual data integration solution that unlocks trapped data and delivers it as easily consumable, unified, and actionable information. JDV makes data spread across physically diverse systems such as multiple databases, XML files, and Hadoop systems appear as a set of tables in a local database.

When deployed on OpenShift, JDV enables:

  1. Service enabling your data
  2. Bringing data from outside to inside the PaaS
  3. Breaking up monolithic data sources virtually for a microservices architecture

Together with the JDV for OpenShift image, we have made available OpenShift templates that allow you to test and bootstrap JDV.

Introduction

In part 1 we described how to get started with JDV running on OpenShift. During the build phase of the pod several artifacts were downloaded from the provided GitHub URL in the JDV OpenShift template. We deployed two virtual databases (VDBs) called country-ws (external web service-based datasource) and marketdata-file (file-based datasource).

icon_rh_hardware_storage-a-stack-virtual_rgb_flatA VDB is a container for components that integrate data from multiple disparate data sources, allowing applications to access and query the data as if it is in a single database and, therefore, using a single uniform API.

A VDB is composed of various data models and configuration information that describes which data sources are to be integrated and how. In particular, source models are used to represent the structure and characteristics of the physical data sources, and view models represent the structure and characteristics of the integrated data exposed to applications.

This article will show the out-of-the-box user-experience to query the data from the JDV instance running inside the OpenShift pod through OData REST services. REST is commonly used by companies that have implemented service-oriented architectures. However, it does not provide unified calling semantics nor does it provide a data model, meaning that each company has needed to define its own. OData is a solution to this problem because it provides a specification that defines standard ways to define data source operations and also standardizes the way in which you define your data schema.

OData

odatalogo-96The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. OData is used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites. OData is consistent with the way the Web works, it makes a deep commitment to URIs for resource identification and commits to an HTTP-based, uniform interface for interacting with those resources (just like the Web). This allows OData to enable a new level of data integration and interoperability across a broad range of clients, servers, services, and tools. JDV 6.3 supports OData v2 and v4.

For more information on

Accessing data via OData

JDV can expose any data source as an OData-based service out-of-the-box. During the deployment phase as explained in part 1 the following routes are created as depicted in the image below.

screen-shot-2016-12-05-at-20-13-38

An OpenShift route exposes a service as a host name, like datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io, so that external clients can reach it by name.

OData-based services in JDV can be accessed either through http or https. When the pod including the JDV artifacts (i.e. VDB) has been successfully deployed and is running, the OData protocol support is implicitly provided by JDV without any further configuration/development.

Now, open up a browser and point it to the following OData URLs which are out-of-the-box available for your convenience.

Note: If you are requested to type in a username/password enter teiidUser/redhat1! or the combination you have used during the configuration of the JDV template of project jdv-demo in part 1.

OData v2

screen-shot-2016-12-07-at-08-57-40

screen-shot-2016-12-07-at-16-29-43

 

screen-shot-2016-12-07-at-08-58-02

screen-shot-2016-12-07-at-08-59-07

screen-shot-2016-12-07-at-08-59-26

OData v4

screen-shot-2016-12-07-at-09-03-21

screen-shot-2016-12-07-at-09-03-47

screen-shot-2016-12-07-at-09-04-04

screen-shot-2016-12-07-at-09-04-25

screen-shot-2016-12-07-at-09-04-39

The returned results from OData query can be in Atom/AtomPub XML format or JavaScript Object Notation (JSON) format. Default AtomPub based XML result is returned, by specifying the $format=JSON parameter in the OData URL the results will be returned in JSON output format.

Demonstration

In the following video we will show the above steps on how to connect to VDBs with financial information (file) and country information (web service) in OpenShift using the OData API provided out-of-the-box by JDV.  In part 1 we deployed two VDBs called country-ws and marketdata-file. These VDBs were extracted from the github repository (https://github.com/cvanball/jdv-ose-demo/vdb) using the templates variables

  • GitHub repository URL: https://github.com/cvanball/jdv-ose-demo)
  • Context directory: vdb.

These VDBs were downloaded and deployed during the build and deployment process of the pod.

Red Hat JBoss Data Virtualization on OpenShift: Part 2 – Service enable your data from Cojan van Ballegooijen on Vimeo.

Conclusion

You can leverage these OData-based REST services provided out-of-the-box by JDV running on OpenShift to integrate these data services with your existing applications and infrastructure like:

  • API Management
  • Enterprise Service Bus
  • Mobile applications
  • Web applications
  • etc.

Resources


Join the Red Hat Developer Program (it’s free) and get access to related cheat sheets, books, and product downloads.


For more information about Red Hat OpenShift and other related topics, visit: OpenShift, OpenShift Online.

Share