Programming Against Hybrid Databases with Java Handling SQL and NoSQL. Brian Hughes IBM



Similar documents
What new with Informix Software as a Service and Bluemix? Brian Hughes IBM

Useful Business Analytics SQL operators and more Ajaykumar Gupte IBM

Session D15 Simple Visualization of your TimeSeries Data. Shawn Moe IBM

Development Environment and Tools for Java. Brian Hughes IBM

Leveraging WebSphere Commerce for Search Engine Optimization (SEO)

Focus on the business, not the business of data warehousing!

IBM Tivoli Network Manager V3.9

Name: Srinivasan Govindaraj Title: Big Data Predictive Analytics

An Informix TimeSeries based Telco Data Retention Solution: Lessons Learned

IBM Tivoli Provisioning Manager V 7.1

Industry Models and Information Server

IBM Tivoli Service Request Manager 7.1

IBM WebSphere Application Server Communications Enabled Applications

SINGLE SIGNON FUNCTIONALITY IN HATS USING MICROSOFT SHAREPOINT PORTAL

Web servers and WebSphere Portal

How To Choose A Business Continuity Solution

Tivoli Endpoint Manager for Security and Compliance Analytics

Hadoop Basics with InfoSphere BigInsights

Big Data Analytics with IBM Cognos BI Dynamic Query IBM Redbooks Solution Guide

WebSphere DataPower Release DNS Enhancements

Ten questions to ask when evaluating contract management solutions

IBM Lotus Enterprise Integrator (LEI) for Domino. Version August 17, 2010

Performance Testing Web 2.0

Business Process Management IBM Business Process Manager V7.5

IBM TRIRIGA Application Platform Version Reporting: Creating Cross-Tab Reports in BIRT

Tivoli Endpoint Manager for Security and Compliance Analytics. Setup Guide

IBM WebSphere Application Server

WebSphere Business Monitor

Database lifecycle management

Virtualization and the U2 Databases

Single Sign-on (SSO) technologies for the Domino Web Server

Four keys to effectively monitor and control secure file transfer

Tivoli Endpoint Manager for Configuration Management. User s Guide

WebSphere Commerce V7 Feature Pack 2

FileMaker 13. ODBC and JDBC Guide

The IBM Archive Cloud Project: Compliant Archiving into the Cloud

C05 Discovery of Enterprise zsystems Assets for API Management

IBM WebSphere Application Server

IBM Configuring Rational Insight and later for Rational Asset Manager

z/os V1R11 Communications Server system management and monitoring

DataPower z/os crypto integration

Communications Server for Linux

Memory-to-memory session replication

Integrating ERP and CRM Applications with IBM WebSphere Cast Iron IBM Redbooks Solution Guide

IBM FlashSystem. SNMP Guide

WebSphere Business Monitor

IBM Tivoli Identitiy Manager 5.1: Writing Java Extensions and Application Code

Rational Reporting. Module 2: IBM Rational Insight Data Warehouse

IBM WebSphere Partner Gateway V6.2.1 Advanced and Enterprise Editions

A proven 5-step framework for managing supplier performance

IBM Tivoli Network Manager 3.8

Analytics March 2015 White paper. Why NoSQL? Your database options in the new non-relational world

Security of Cloud Computing for the Power Grid

Three significant risks of FTP use and how to overcome them

IBM s Cloud Platform : IBM Bluemix

IBM Rational Rhapsody NoMagic Magicdraw: Integration Page 1/9. MagicDraw UML - IBM Rational Rhapsody. Integration

IBM Enterprise Marketing Management. Domain Name Options for

FileMaker 12. ODBC and JDBC Guide

FileMaker 11. ODBC and JDBC Guide

IBM RATIONAL PERFORMANCE TESTER

IBM Enterprise Marketing Management. Domain Name Options for

IBM Endpoint Manager for OS Deployment Windows Server OS provisioning using a Server Automation Plan

IBM Security QRadar Version (MR1) Checking the Integrity of Event and Flow Logs Technical Note

Unified XML/relational storage March The IBM approach to unified XML/relational databases

MNB-5587 : imobile by ICICI Bank - The First Foray into Servicing Customers on Mobile by Any Bank in India

Windows 2000 / NT 4.0 / 95 / 98, MS-DOS, Suse Operating Systems

FileMaker 14. ODBC and JDBC Guide

Developing Exceptional Mobile and Multi-Channel Applications using IBM Web Experience Factory IBM Corporation 1

Linux. Managing security compliance

IBM Cognos Controller Version New Features Guide

Practical Performance Understanding the Performance of Your Application

IBM z13 for Mobile Applications

WebSphere Business Monitor

Reading multi-temperature data with Cúram SPMP Analytics

Application Security from IBM Karl Snider, Market Segment Manager March 2012

How To Connect A Java To A Microsoft Database To An Ibm.Com Database On A Microsq Server On A Blackberry (Windows) Computer (Windows 2000) On A Powerpoint (Windows 5) On An Ubio.Com

IBM TRIRIGA Anywhere Version 10 Release 4. Installing a development environment

Getting Started with MongoDB

Rational Asset Manager 7.2 Editions and Licensing

IBM Software Hadoop Fundamentals

Failover Support. DataDirect Connect for ODBC Drivers. Introduction. Connection Failover

WebSphere Commerce V7 Feature Pack 3

IBM WebSphere Adapter for PeopleSoft Enterprise Quick Start Tutorials

Web application security: automated scanning versus manual penetration testing.

IBM FileNet System Monitor FSM Event Integration Whitepaper SC

IBM Security QRadar Version (MR1) Replacing the SSL Certificate Technical Note

Tivoli Automation for Proactive Integrated Service Management

FileMaker 8. Installing FileMaker 8 ODBC and JDBC Client Drivers

Hadoop Basics with InfoSphere BigInsights

Analytics Powered Smarter Merchandising

IBM VisualAge for Java,Version3.5. Remote Access to Tool API

Installing and Configuring DB2 10, WebSphere Application Server v8 & Maximo Asset Management

An Oracle White Paper June RESTful Web Services for the Oracle Database Cloud - Multitenant Edition

z/os V1R11 Communications Server System management and monitoring Network management interface enhancements

Minimizing code defects to improve software quality and lower development costs.

Transcription:

Programming Against Hybrid Databases with Java Handling SQL and NoSQL Brian Hughes IBM 1

Acknowledgements and Disclaimers Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. Copyright IBM Corporation 2015. All rights reserved. U.S. Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. IBM, the IBM logo, ibm.com are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol ( or TM), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at Copyright and trademark information at www.ibm.com/legal/copytrade.shtml Other company, product, or service names may be trademarks or service marks of others. 2

New Types Tables with NoSQL Mongo BSON Classes JDBC Demo database SQL and Strings New data types (BSON, JSON???) Mongo-Java Wire Listener Collections 3

New Type JSON JSON (Javascript object notation) A lightweight data-interchange format Easy to read and write Informix server has JSON data type JDBC driver has no special support for JSON Considered a text string from the driver Need 3 rd party libraries to parse into usable objects 4

New Type BSON BSON - a binary form for representing simple data structures and associative arrays Short for Binary JSON BSON is efficient for data transfers, space and traversability Most new Informix functions/functionality is around supporting BSON JDBC driver has first class support for BSON as an extended type 5

Tables with NoSQL Easy to add JSON/BSON types to existing or new tables Create them as a normal columns CREATE TABLE names (id bigserial, info JSON) CREATE TABLE names (id bigserial, info BSON) 6

Mongo BSON Classes BasicBSONObject Base class for holding BSON data BSON/Java data can represented as Maps of objects Map<String, Object> specifically Extends LinkedHashMap BasicBSONList Represents arrays in BSON structures No real value Extends List<Object> so casting to a List works just fine BSONObject High level interface to represent a BSON object 7

Informix JDBC BSON Informix JDBC driver has bundled a number of BSON classes Subset of Mongo s org.bson package Missing DBObject Informix JDBC Driver Mongo Driver 8

Native Java Mapping Informix JDBC driver maps BSON objects to the IfxBSONObject class IfxBSONObject is a hybrid class Holds both byte [] representation of a BSON as well as the Mongo BasicBSONObject structure 9

Demo Database Basic Structure for JDBC A simple database using UTF-8 10

Demo Database (cont) A simple data with basic and NoSQL data types Includes varchar, json and bson columns 11

Handling NoSQL as Strings Using SQL casts we can treat our NoSQL objects as strings for inserting and querying 12

SQL Statement with NoSQL as Strings Final resulting string is difficult to read and long Could use a Prepared statement with setstring() to simplify 13

Querying Data as Strings Both JSON and BSON types can be viewed as Strings JSON maps to a native Java String BSON maps to a IfxBSONObject which has a sane tostring() method 14

Getting back JSON/BSON as a String 15

Getting back JSON/BSON as a String 16

Demo JSON/BSON with JDBC and Strings 17

Query Data with Native Types JSON is a String BSON comes back as an IfxBSONObject Informix JDBC UDT for the extended type BSON Cast getobject() to IfxBSONObject 18

IfxBSONObject A UDT, a BSONObject, and a SQLData object Allows for easy manipulation of BSON as well as insertion/retrieval the from JDBC driver 19

Processing an IfxBSONObject For most operations, you can use the object directly Sometimes you might want to convert to a BasicBSONObject which directly extends LinkedHashMap 20

Handling Complex BSON BSON objects in Java can hold objects, lists and other BSON objects (subdocuments) 21

Handling Complex BSON Resulting JSON document 22

Demo JSON/BSON with JDBC Native Types 23

Mongo Drivers If you work heavily in NoSQL you might prefer the use of Mongo Drivers Requires the setup of the Informix Wire Listener to understand Mongo protocols Allows you to create collections of documents easily and index 24

Index Creation on BSON Creating indexes on BSON documents in a collection is easy Basic Mongo create index Informix extension for indexing specific data types 25

Checking for Indices used Mongo API has an explain() method Ties directly into Informix optimizer plan 26

Getting Relational data from Mongo API s You can point to a relational table in a database and query with Mongo s API s 27

Execute Complex SQL via Mongo API s Using SQL pass through you can execute pure SQL via the Mongo API s secure.sql.passthrough=true Uses the virtual collection system.sql and the custom command $sql 28

Demo BSON with Mongo Java Drivers 29

Links http://www- 01.ibm.com/support/knowledgecenter/SSGU8 G_12.1.0/com.ibm.json.doc/json.htm http://mongodb.github.io/mongo-javadriver/2.13/getting-started/quick-tour/ 30

Questions? 31