Why WebSocket Apps Are In Your IBM i Future

April 13, 2016
Alex Woodie

Do you pine for the simpler days of the AS/400, when RPG was king and data was served through super-efficient 5250 interfaces? If so, you’re not alone–the relentless crush of modern technologies takes a toll on all of us. But while the world isn’t likely to go back to RPG and 5250, you might find something that works in a similar way in a new technology called WebSockets.

KrengelTech‘s Aaron Bartell had a great description of WebSocket during a recent BCD webinar on Node.JS and other open source technologies for IBM i.

“It’s basically full duplex communication from client to server, but then also from the server to the client,” Bartell said. “Once a handshake has happened, where an agreed upon WebSocket is made, the server can actually notify the client of data, without the client having to poll the server. That’s one of the cool things about Nodejs is that it has very excellent WebSocket capabilities.”

WebSocket was officially proposed as an HTML5 standard by the Internet Engineering Task Force back in 2011, and WebSocket Protocol is in the process of being standardized in HTML5 by the World Wide Web Consortium. WebSocket has already been adopted by all major Web browsers, where it’s viewed as a big improvement over previous attempts to do full-duplex communication on port 80, namely AJAX (Asynchronous JavaScript and XML) and Comet (also called Reverse AJAX).

IBM has adopted WebSockets technology within its HTTP Server (powered by Apache), as well as within the Integrated Web Application Server for i, the lightweight Java application runtime based on the Liberty profile of WebSphere. Developers can create WebSockets applications using either Java or Node.js.

“The HTTP protocol only allows a client to send a request to the server, and the server side can’t initialize a request to the client,” write the paper’s authors, IBM software engineers Tian Gant, Xu Meng, and Zheng Chang Qing. “Now, by using the new WebSocket technique, we have the ability for the server to send a request to the client.”

So, what can you do with WebSockets on IBM i? The IBM software engineers say it’s very useful for real-time Web applications, such as gaming. While gaming is great, it isn’t necessarily applicable to the average midrange shop struggling to run a business while avoiding technical complexity.

Bartell had his own examples of WebSockets in action, including one based on IBM i Dash, an open source project he created at https://bitbucket.org/litmis/ibmidash. IBM i Dash was written in Node.JS and provides a Web-based dashboard interface for the DB2 for i Services that IBM made available to basically provide SQL-based methods for IBM i administrative functions, such as the Work with Active Jobs command.

Bartell describes how WebSockets fits into the picture:

“Instead of calling a system API, I call an SQL view asking for WRKACTJOB info, and it returns back a result set,” Bartell said in the BCD webinar. “What’s intriguing is I can let the screen sit there and because it’s written in WebSockets, every two seconds it automatically refreshes for me. What’s even more interesting is, because of how WebSockets work, I only do one WRKACTJOB request for the 20 people that are on the same page, and that one request is delivered to those 20 people via an event emitter mechanism. . . There’s some very cool technology going on with very small network footprint.”

As open source technology improves, it’s giving everybody–including IBM i programmers–the power to tap into new sources of data and insight. One could even use the combination of WebSockets and Node.js to hook an IBM i application up to IBM’s Watson cloud service to automatically transcribe the audio content of customer service calls into text, and then do sentiment analysis upon the text. Bartell tried it with a free developer license to Watson, and he found it surprisingly easy to get it hooked up and running.

But within the context of WebSockets specifically, it’s fascinating how much it bears a resemblance to IBM’s 1970s era System Network Architecture (SNA) protocol, which was killed by the ubiquity of Ethernet and the TCP/IP protocol. The similarity wasn’t lost on Bartell.

“This is a significant evolution in the browser programming space because we no longer need to do the polling, which adds additional CPU cycles and bandwidth,” Bartell notes. “We’re starting to gain more efficiencies, which is kind of humorous because we’re getting back to the realities that we’ve already had with the 5250 approach. Again, IBM i had it all figured out way back in the day and the rest of the world is now catching up.”

At Fresche, modernization and efficient management of IBM i environments is what we do. It's our specialty. We provide highly experienced modernization services in conjunction with tools such as the X-Analysis suite (for deep understanding of your applications, data models, code complexity, business rules, etc.) and the looksoftware suite (to modernize your application UI and improve the complete user experience). Most IT departments have limited modernization experience and are not aware of all the pitfalls that can occur on a modernization journey. Fresche has already met and overcome most obstacles, including difficulties in testing, project management and integration.

Experience shows that there are six main steps that lead up to a successful modernization effort.

1. Analyze your application environment
In large IBM i shops, it is very likely that no one has a complete picture of the application environment. Knowing what you have - and how it currently supports (or doesn't adequately support) the business - is crucial in deciding how to proceed. There are many decisions involved in a well-planned modernization project, and those decisions cannot be made if you do not have accurate metrics about application and database size, quality and complexity, interdependencies, obsolete and redundant code, backup procedures, etc. Using automated tools like X-Analysis to perform a highly detailed analysis of your IBM i application portfolio provides you with a clear picture of what is used in your system and how. This information is crucial before planning your modernization journey.

In addition, you need to begin evaluating target technologies. Remember that one size does not fit all. Not all of your legacy technology needs to move to the same target technology, and some of it does not need to move at all. Hybrid solutions are the key: rarely is there one monolithic solution to a company's modernization needs.

Consulting an experienced vendor such as Fresche can help you with both aspects of this phase. Through Fresche's Strategy and Discovery service, or even by purchasing X?Analysis, you can learn everything you need to know about your IBM i environment and begin reviewing recommendations for modernization.

2. Find the Right Strategy
There are a variety of modernization strategies, and you need to decide which ones are right to support each part of your business. Among the strategies and solutions:

Retire Some applications can be decommissioned when newer technology on the platform has
superseded the older functionality

Again, help from an experienced vendor such as Fresche can be invaluable in determining how to proceed. Most companies do not have an abundance of modernization skills and experience and benefit greatly from a vendor's knowledge.

3. Align IT Projects to Business Value Creation
Fresche's experience has shown that willingness on the part of IT and some users is not enough to sustain a thorough and on-going modernization strategy. It is absolutely essential to link each modernization project with a business improvement that will benefit one or more parts of the business. As you are building out your strategy, keep the following points in mind:

• What does the business get out of it?

• Move from an IT-centric perspective to a business-centric one

• Existing IT budgets are rarely adequate to fund mid-to-large scale modernization initiatives;
the business will need to sponsor and fund the project

• A professional and strategic approach to the business is required

You must be able to show what business problems you are solving with each part of the modernization project. You must also be able to show business the return on the investment.

4. Define a Phased-Approach Timeframe that Includes Quick Wins
Organizations typically do not like to invest in multi-year programs where the benefits only appear at the end of an extended period, so it's in your best interests to create a milestone-based plan where each milestone shows a specific business value. Establish one or more quick and visible wins early in the process to show business that the modernization strategy has definite and beneficial goals. These quick-win projects can include rapid Web enablement, UI and workflow customization, database modernization (long names, for example), and a published data model. A variety of tools from Fresche and looksoftware can help with all of these projects.

5. Seek input from line-of-business application stakeholders
In fact, this is something that you need to do throughout your modernization journey. We have already stressed how important it is to define projects in terms of their business value. But it is also important to include business analysts and users as early in the discussion as possible to validate the direction that you are considering and to ensure buy-in. Projects that succeed are ones where business analysts fully understand - and are looking forward to - the benefits that the project will provide.

6. Seek External Validation on Strategy and Approach
Planning and running a modernization project is very different from net new development. It requires in-depth knowledge of the existing system and an understanding of where some of the scope creep and problematic areas could potentially arise. We always recommend obtaining external validation of your approach and strategy from sources that specialize in modernization. Fresche can help, no matter what stage of modernization you are currently considering.

Do you have questions? Do you want some helping building your plan?Talk to an expert.