The Bankwest Core Banking System is based on loosely-coupled, CICS PL/I programs running on IBM System z. These have stood the test of time, running for more than 20 years and are still going strong today. With the advent of the burgeoning API economy, the time came to expose our Core Banking Data in a modern standards compliant manner direct to HTML5 apps and business partners. Whilst leveraging the existing PL/I programs, we wanted to dove-tail with modern RESTFul Web Services. This case study will cover how we've combined the light-weight Liberty Profile Application Server, a RESTful framework, CICS Channels and Containers and the JCICS library, to create a loosely-coupled modular architecture to deliver business value at pace.
How Bankwest delivers business value through modern RESTful APIs with Java in CICS Liberty (IBM Interconnect 2016)
1. PZS-5155:
How Bankwest Delivers Business Value through Modern
RESTful APIs with Java in CICS Liberty
Rob Crowley
API Technical Product Owner
Bankwest
IBM InterConnect 2016 Conference
InterConnect 2016
2. Page 2
Goals for the session
Share Bankwest’s journey as one of the first companies worldwide to
leverage Java and Liberty on the mainframe to deliver modern RESTful
APIs.
Provide insights into how a continuous delivery pipeline can be
implemented for these APIs.
Empower you with new ideas for modernising your organisation’s
investment in mainframe technologies.
Outline business outcomes achieved to date.
6. Page 6
Business Context: Why we chose RESTful APIs with Java in CICS Liberty
“It is not necessary to change. Survival is not mandatory.”
- W. Edwards Deming
7. Page 7
Current Architecture: Core Banking System & PRIME
Middle Tier Middle TierPRIME PRIME
Core Banking
System (CBS)
9. Page 9
High Levels Goals for PRIME 2™
Modern API delivering a world class developer experience.
No major upfront upskilling of existing developer group required.
Facilitate incremental modernisation of our core banking system.
Enable delivery at speed.
Evolvable.
10. Page 10
PRIME 2™ Web App
DB2
CBS
BPR
RACF
JAX-RS
App
Filters
-
TAI
JCICSHTTP GET /
LIBERTY PROFILE
CICS TS 5.2 CICS TS 5.1
12. Page 12
RESTful APIs 101 - Resources
HTTP as protocol (generally the case but doesn’t have to be)
Model entities as Resources
Assign each resource a Uniform Resource Identifier
Client Server
GET
/accounts/1
{ … }
13. Page 13
RESTful APIs 101 - Actions
GET read
POST create
PUT replace
PATCH partial update
DELETE delete
Map actions to HTTP methods
Client Server
GET
/accounts/1
{ … }
14. Page 14
RESTful APIs 101 - Hypermedia
“It seems we’ve got a mental block when it comes to hypermedia
in web APIs. This is a big problem, because hypermedia is the
feature that makes a web API capable of handling changes
gracefully.”
- Leonard Richardson, author of RESTful Web APIs
18. Page 18
Continuous Delivery Pipeline – How we ship code
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
19. Page 19
JSON as the format for resource definition
Human readable / machine understandable
Bullet proof JSON parsers and tooling available for the JVM
Browsable in source control system
RESTful Resource
Definition
1 .. * 1CICS Copybook
CICS Copybook
CICS Copybook
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
We chose JSON
for this
Resource
Modelling
20. Page 20
Built using PL/1 with green screen user interface.
Leverage core skill set of developers with knowledge of existing
mainframe programs and CICS Copybook structures.
Initial consumers were other CICS developers so provides a familiar user
experience.
Smallest upfront effort required to prove viability of approach.
Mapping Engine
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
21. Page 21
Impedance mismatch between legacy and RESTful interfaces.
Volatility of data affects the cacheability of entire representation.
Include capability for defining cache strategy in resource definition. This
is vital to harnessing the power of HTTP.
Design for cacheability
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
Client Server
Browser Cache Caching ProxyEdge Proxy
22. Page 22
“There are only two hard things in Computer Science:
cache invalidation and naming things"
- Phil Karlton
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
23. Page 23
Include capability for aliasing fields in the mapping engine.
Ensure barrier of entry for API is low (pit of success).
Technical governance process can help.
Keep consumers of API front of mind (internal vs external).
Leverage existing vocabularies i.e. Schema.org and Dublin Core®
Consistent naming is key
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
24. Page 24
When dealing with legacy programs it’s not always possible to get
optimal outcome through mapping alone.
Determine what an acceptable level of compromise is and when a re-
write is required.
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
Define how much compromise is acceptable
25. Page 25
Continuous Integration Build
CI Server
JGIT
Team City
Version Control
System
Master
z/OS
FTP
Pulls
cies
Artifact Repository
Resolve
Nexus
Code Generation
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
Resolve / Publish /
26. Page 26
We generate a number of outputs for each resource bundle
› Java classes
› Documentation / API Descriptions
› Manifests
Code generation tooling should be scalable and robust. We chose Xtend
a component of the Xtext Eclipse project.
Generated code still needs to be debugged occasionally. Focus on
producing idiomatic Java code.
Don’t generate everything. Be pragmatic and avoid putting complex
business logic in templates.
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
27. Page 27
Abstract consumers from legacy data through thin data transformations
Leverage standard formats for values to keep barrier for consuming data
low.
Use ISO8601 for dates. We massage these values quite extensively.
For monetary amounts we use currency base unit as String plus ISO4217
currency code.
Protect consumers from legacy data inconsistencies
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
28. Page 28
Ensure your APIs are easily accessible to consumers.
Provide a service catalogue detailing root URI for each API.
We leverage Open API Initiative (f.k.a. Swagger) for API descriptions.
› UI module provides listing of endpoints available in each environment
and test harness to invoke them.
› Extensive tooling around the standard (i.e. AsciiDocs, IBM DataPower).
› Version 2.0 is not a perfect fit for hypermedia APIs.
Discoverability and Description
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
29. Page 29
Model
Resource
Continuous
Integration
Code
Generation
Migrate
Resource
The resource bundle is associated with corresponding PL/1 programs
and promoted as an atomic unit.
Dependency mapping ensures that Copybook and corresponding Java
resources remain in sync.
CICS bundles installed using direct JCL commands. DFHDPLOY offers
support for this ‘out of the box’.
31. Page 31
Liberty Profile
Lightweight dynamic profile of WebSphere
Application Server (WAS).
Modular architecture based on OSGi.
Fast start up. ~5 seconds fully configured.
Strong RACF Integration.
Regular release cycles.
Great development tools and integration with
Eclipse.
Sensible default configuration.
33. Page 33
The Road To Production
Feb 2015:
Project Kick-off
July 2015: Liberty deployed
to Production with 1 bundle
September 2015:
1st App/System Consumer
October – Dec 2015:
Weekly bundle releases
Jan 2016:
15 bundles deployed
20 RESTful operations
CORE DEVELOPMENT TEAM:
JAVA PL/1 SYS PROG
March 2015:
Dual version
CICSPlex
March 2016:
28 bundles deployed
52 RESTful operations
34. Page 34
Where to next - Scaling Horizontally
PRIME2
Document
Database Customer
Relationships
Graph Database
Customer
Search
Customer
Reporting
Denormalised
Relational Schema
READS WRITES