© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
1
DB2 Trends and directions for developers
Jørn ThyssenTechnical Sales and SolutionsAnalytics on System z
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
2
• Traditionally:l CICS/IMS transactions written in Cobol or PL/1 accessing DB2 l Batch programs accessing DB2l Normally well written and good performing SQLl Everything on System z
• Today also:l Dynamic SQL from distributed applications
l Hand-coded or generated SQL (loved by every DBA)l All kinds of programming languages
l Native stored procedures (next session!)l Mobile apps – driving a lot of the growth on System zl Analytics
2
DB2 for z/OS Applications
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
3
Agenda
• JDBC, ODBC, .NET API• Scripting languages
PhP, Ruby, Python, Perl Node.js
• Hibernate/iBatis Accelerators • DB2 Connect Licensing Updates• DB2 JSON support• Tooling
Rational Data Studio
• Cloud/Mobile update Cast Iron z/OS Connect
3
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
4
DB2 supports all of the top 10 popular programming languages
SQL PL curently #17 and going upCobol not on the list...
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
5
DB2 Drivers – Panoramic View
5
PhP Python/Jython Ruby/JRubyJavascript
node.jsScala
Zend framework adapters
SqlAlchemy/Django Adapter
DB2
DB2 CLI and ODBC driver DB2 JCC JDBC driver
Rails Adapter
Liftnode-odbc node.jsJSON driver
c
Python interpreter
java c
Ruby interpreter
java
Java
JDBC API
pureQueryAPI
JSON API
Hibernate
JPA
C based
Java (Type 4)Native (Type 2)
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
6
DB2 Connect Simplification
Server based licensing– DB2 Connect Unlimited Edition– One time install to server, no need for license key on client
workstations
Lightweight client packages utilized throughout the enterprise
http://www-01.ibm.com/support/docview.wss?uid=swg27016878
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
7
Microsoft ADO.NET
MS OLE DB.NET
IBM Data Server (DB2 z/OS,
DB2 LUW, IDS*, DB2 for i)
* Only DB2 CLI & DB2.NET provider support IDS
IBM DB2 ODBC/CLI Driver
IBM DB2 OLEDB Driver LINQ
Entity Framework / EDM Visual Studio Integration/ RAD tooling
Connection
Command
Data Reader
Data Adapter
IBM DB2.NET Data Provider
Select Command
Insert Command
Update Command
Delete Command
IBM DB2 DS Driver
• Language-Integrated Query (LINQ), is a convenient means to execute queries against data sources, including XML, CLR objects, DataSet objects in ADO.NET.
• The Entity Framework automatically generates lightweight .NET classes that map to relational database structures. The Entity Framework provides all the database-specific plumbing code that would otherwise need to be written and maintained
• Visual Studio Integration offers Rapid Appl Development through data modeling UI tools.
MS ODBC.NET
DB2 Connect APIs - .NET
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
8
DB2 Connect APIs - CLI
• C and C++ application programming interface• DB2 CLI is based on the Microsoft® Open Database Connectivity (ODBC)
specification, and the International Standard for SQL/CLI. • Also provides number of DB2-specific APIs which are not a part of the ODBC
standards to improve DB2 access
8CLI Framework
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
9
Scripting Languages
• Node.js Server side JavaScript Popular uptake in mobile app development Fast, scalable, lightweight application solution for data-intensive real-time applications
9
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
10
Scripting Languages
• Perl Legacy scripting language Still #12 on the list
10
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
11
Scripting Languages
• PhP Many web pages developed and maintained in PhP
11
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
12
Scripting Languages
• Python Robust programming language with rich set of libraries for most tasks Well embraced by the enterprise world. Different options like SQLAlchemy and Django available for particular database access needs
12
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
13
Scripting Languages
• Ruby on Rails Popular framework for web app development
13
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
14
Java common layer, SQLJ runtime
T4 subsystem builds/parses
DRDA requests/replies
T2z subsystem calls intonative z/OS APIs
T2u subsystem calls native LUW
APIs
JDBC Application
SQLJ Application
CCC
RRS
DB2, IDS
DRDA overTCP/IP
DRDA Shared memory to local UDB
DB2 for z/OS
DB2 Connect APIs - JDBC
l © 2013 International Business Machines Corporationl 1
5
• Dynamisk SQL in Java with JDBC
http://www-01.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/com.ibm.db2z11.doc.java/src/tpc/imjcc_tjvjcccn.dita
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
16
pureQuery Runtime – every Java application benefits!• JDBC – acceleration for any JDBC application
Convert dynamic SQL to static SQL Replace problem queries without changing the source
• Hibernate/OpenJPA/iBatis – acceleration for persistence layers Improved SQL “batch” performance Auto-tuning of Hibernate and OpenJPA peristence options
• SQL-friendly APIs for OO access to relational Object to relational mapping APIs that can be tailored to return XML, JSON, arrays, etc.
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
17
Client OptimizationImprove Java data access performance for DB2 – without changing a line of code
• Captures SQL for Java applications Custom-developed, framework-based, or packaged applications
• Bind the SQL for static execution without changing a line of code New bind tooling included
• Delivers static SQL execution value to existing DB2 applications Making response time predictable and stable by locking in the SQL access path pre-
execution, rather than re-computing at access time Limiting user access to tables by granting execute privileges on the query packages rather
than access privileges on the table Aiding forecasting accuracy and capacity planning by capturing additional workload
information based on package statistics Drive down CPU cycles to increase overall capability
• Choose between dynamic or static execution at deployment time, rather than development time
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
18
DB2 Java Data Access Frameworks Acceleration
• Hibernate: http://www.ibm.com/developerworks/data/library/techarticle/dm-1008hibernateibatispurequery1/index.html?ca=dnw-1133&ca=dth-i
• iBatis: http://www.ibm.com/developerworks/data/library/techarticle/dm-1009hibernateibatispurequery2/index.html
• Spring: http://www.ibm.com/developerworks/data/tutorials/dm0806hsing/index.html
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
19
• Updated packaging with client management capabilities of Optim Configuration Manager for z/OS
• New capabilities position this as an ideal edition for enterprise customer to manage and improve performance of distributed application workload
• Soft bundle of the following products
DB2 Connect Unlimited Advanced Edition for System z
2. InfoSphere Optim pureQuery for LUW
1. DB2 Connect Unlimited Edition for System z
3. InfoSphere Optim Configuration Manager for DB2 for z/OS
New
DB2 Connect Unlimited Advanced Edition
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
21
Rational Developer for System z:An Integrated development Environment for Sys z
Rational Developer for System z
A modern IDE for productive development of cross-platform applications written in COBOL, PL/I, ASM, Java, EGL or C/C++ in System z CICS, IMS, DB2, Batch applications
Access to typical System z sub-system functionality in z/OS, CICS, IMS, DB2, WAS
Out of the Box debugger and code coverage capabilities
Integration with Fault Analyzer for Dump Analysis Integration with File
Manager for file and test data handling
Integration with IBM Data Studio for DB2 data access and tooling capabilities
PL/I Integration with Team
Concert for Lifecycle and Source Management
Integration with RD&T for flexible access to System z environment
New
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
22
RDz – Data Studio Integration Participate in the SQL Outline View with actions from the RDz COBOL, PLI editors Gathers the SQL from the source file, as well as any copy/include files containing EXEC SQL
statements, and loads the SQL Outline View. SQL Outline View Features:
Navigate source selecting nodes in the view Run SQL Tune SQL Explain SQL
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
24
JSON is the Language of the Web
• JavaScript Object Notation Lightweight data interchange format Specified in IETF RFC 4627 http://www.JSON.org
• Designed to be minimal, portable, textual and a subset of JavaScript Only 6 kinds of values! Easy to implement and easy to use Text format, so readable by humans and
machines• Language independent, most languages have
features that map easily to JSON• Used to exchange data between programs
written in all modern programming languages
{ "firstName“ : "John", "lastName" : "Smith", "age" : 25, “active” : true, “freqflyer_num : null,
"address" : { "streetAddress“ : "21 2nd Street", "city" : "New York", "state" : "NY", "postalCode" : "10021" },
"phoneNumber“ : [ { "type" : "home", "number“ : "212 555-1234" }, { "type" : “mobile", "number“ : "646 555-4567" } ] }
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
25
New Era Application Requirements
• Some apps need very few database features, but need high scale
• Desire to avoid data/schema pre-design altogether for simple apps
• Store data from web/mobile apps in it's native form • New web applications use JSON for storing and
exchanging information Very lightweight – write more efficient apps It is also the preferred data format for mobile application back-ends
• Move from development to production in no time! Ability to create and deploy flexible JSON schema Gives power to application developers by reducing dependency on IT; no need to pre-determine schemas and create/modify tables Ideal for agile, rapid development and continuous integration
DB2
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
26
• Combine data from “systems of engagement” with core enterprise data Simplicity and agility of JSON + enterprise strengths of DB2 Simplify data access when a single application’s data has different access
characteristics
• Maintains JSON simplicity and agility Interoperate seamlessly with modern applications Flexible schemas allow rapid delivery of applications
• Leverages DB2 Qualities of Services Security Management, operations High availability
• Delivers the best of both worlds Schema Agility and Enterprise Quality of Service
DB2 for z/OS Enterprise-class JSON DatabaseAgility with DB2 Qualities of Service
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
27
JSON in SQL – First StepsExtend JSON API Building blocks for external use
New functions released in DB2 11 only
JSON2BSON - convert JSON string into BSON format BSON2JSON - convert BSON LOB into JSON string JSON_VAL - retrieve specific value from inside a BSON
object
INSERT INTO EMPLOYEE(data) VALUES (SYSTOOLS.JSON2BSON (‘{ name: "Joe", age:28, isManager: false, jobs :[“QA”, “Developer”] } ’))SELECT SYSTOOLS.BSON2JSON(data) FROM EMPLOYEEUPDATE EMPLOYEE SET DATA = SYSTOOLS.JSON2BSON('{ name: "Jane", age:18, isManager: false, jobs :["Developer", "Team Lead"] } ')
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
282828
System BSystem B
JSONJSON
XMLXML
Both XML and JSON:- Make schema evolution
simple in the database- Coexist with relational data
JSON is used with human interfaces and mobile applications and more making it straight-forward to pass data structures back and forth
XML is typically used for data exchange or shred between multiple parties, systems or institutions providing the ability for 3rd parties to define portions of data structures independently – e.g., banking, insurance
System ASystem A
JSON:1) Easy to work with2) Smaller in size 3) Suffices for most applications
XML and JSON : Choosing between the Two
http://www.ibm.com/developerworks/data/library/techarticle/dm-1403xmljson/index.html
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
29
DB2 JSON – providing the best of both worlds
29
JSONAPI
SQLAPI
SQL + JSONAPI
JSON
{“Product”: { “SKU”: 11213, “Name”: “Google Glass”, “Category”: {}, “Size”: [ “S”, “M”, “L” ] }}
RelationalReferential IntegrityCheck constraintsTransactionsGeo-spatialScalabilityTemporalSecurityJoins
Tunable Consistency
Performance & Scalability
Tools for higherProductivity
Established Security
Announced inDB2 AccessoriesSuite for z/OS
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
30
Mobile/Cloud Initiative
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
31
WebSphere Cast Iron Integration
31
CloudApplications
On-premiseApplicationsCloud
Applications
On-premiseApplications
Speed &Simplicity
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
34
Mobile/Cloud support – Problem Statement• Cloud and Mobile providers need a uniform way to interact with z-
based middleware for discovery, provisioning, data transformation, and service invocation.
• Customers have expressed an interest in a common way to interact with all z/OS business and infrastructure assets using REST and JSON technology REST – Representational State Transfer … the Other use of HTTP URLs
that map to a ‘service’, such as ‘query account’ or ‘update data’ JSON – JavaScript Object Notation … a standard of representing data as a
set of name/value pairs. This is passed back and forth along with REST request/responses
• Ability to track and handle large spikes of new requests originating from any number of almost instantly available clients.
34
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
35
Solution – Introducing z/OS Connect• Mobile and Cloud connectivity to backend z/OS assets • Provides a consistent way to discover and call in to application assets on
z/OS• Runs in Liberty profile • Uses RESTful service and JSON payloads. • Capable of converting JSON to data format required by backend service• No additional cost, packaged with WAS, CICS and IMS• Java, so runs on speciality engines• Example of invocation
http://<hostname>:<port>/zosConnect/services/CUSTOMER_INQ?action=invoke<JSON payload>
35
{"firstName": "John","lastName": "Smith"}
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
37
Tooling for zOS Connect – end to end development and testing
Data Web Services of Data Studio or RDz
Config.xml
WSDL
Deploy to bundled zOS Connect
Data Web ServicesTest Client
Deploy to remotezOS Connect
CICSIMSWASDB2
z/OSConnect
Database operations
ZOS Connect artifacts
ZOS Connect on LPAR
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
38
On-Premise API Enablement
Mobile Applications
DataPower GW
appliance
DMZ
Enterprise APIs
API Management
Web Services or REST based
services
Enterprise Transaction Processing
Enterprise API s
Cloud - Integration Services
Mobile, Web, Cloud App
Enablement
Service Enablement:• Enables invocation of Z
services or applications by remote applications using standard protocols (REST)
API Enablement: • Consumability by internal
and external developers (creation and look up)
• Entitlement Management (securing, workload enforcement)
• Usage monitoring & Analytics
Cloud Integration Enablement: • Enabling integration with
APIs as well as technical services
Remote Application Development:• Invokes services and APIs
discovery
discovery/invocation
discovery/invocation
DB2CICSIMS
Batch
Cloud-based Services
Cloud APIs
IBM Worklight
Server
DB2CICSIMS
Batch
z/OS Connect
Access to systems of records and enterprise data via APIs
End to End Architecture for Mobile, Web, Cloud applications invoking Z services using APIs
© 2015 IBM Corporation
zAnalytics DB2 Update Day 2015 – March 23-27, 2015
39
Summary
DB2 for z/OS is the database of choice for
l Distributed appsl Mobile appsl Cloud enabled appsl Analytics