Open Source on IBM i

Components of the iAMP stack. PHP is an easy-to-use open-source platform-independent scripting language designed primarily with application development in mind. PHP essentially is the data-manipulation language for Web-based applications. PHP facilitates imbedding business-logic inside of the HTML stream that comprises a Web page. It is estimated that there are approximately 2.5 million PHP developers with upwards of 22 million Internet domains leveraging PHP to some degree in their application portfolio.

MySQL is the leading open-source database in the industry with more than 11 million installations. Thousands of applications are written to the MySQL database engine, including PHP applications. The MySQL development environment consists of millions of developers around the world. MySQL on IBM i brings a wide range of additional applications to the IBM i community.

MySQL is an important and viable open-source component for IBM i customers interested in deploying open-source applications. The MySQL database engine continues to be available as an open-source solution and current versions of Zend Server are bundled with a Zend DB2i component, which is actually the source of MySQL compiled for IBM i.

IBMDB2i is a storage engine for MySQL that enables the storage and retrieval of data from applications written with the MySQL API set to DB2 on i schemas. IBM developers built upon the storage engine architecture of the MySQL database to implement a storage engine that processes the query plan resulting from MySQL against a DB2 schema. What this means is that applications written to the MySQL API set (i.e., a large percentage of the open-source LAMP-based applications) can be deployed on IBM i and the resulting data will be stored in DB2 as illustrated in Figure 3.

Note the application written to the MySQL API set doesn’t change, which means that any open-source application deployed on IBM i that’s written to that API set can store its data in DB2 for IBM i tables and that data then becomes available to other applications.

The IBMDB2i storage engine is included with the MySQL (Zend DB2i) included with Zend Server. Keep in mind that just like MySQL, the code for the storage engine is open source. It’s maintained by IBM and is available on the Young i Professionals website. Click on the wiki link and find DB2 Storage Engine in the list.

One of the integration possibilities provided by the IBMDB2i storage engine is the capability to leverage IBM i applications to provide analysis and reports on open-source data that the open-source application itself may not provide. For example, suppose that the popular open-source SugarCRM application has been deployed on IBM i for providing a Customer Relationship Management system. Further suppose that one of the reports required is a graphical representation of the spread of customer contacts geographically to help determine the best approach for a targeted marketing campaign. While the SugarCRM application has the data necessary to generate such a report, it doesn’t provide the report itself. With the IBMDB2i storage engine, the data would be available to both the SugarCRM application and DB2 Web Query, illustrated in Figure 4.

Since the data resides in a DB2 for IBM i database table, DB2 Web Query could be used to produce the desired report. This integration could be taken further by using the Web Query Software Development Kit (SDK) to build the report into the open-source SugarCRM application.

Development Tools

In addiction to the iAMP stack, PHP on IBM i affords us the iADP stack (IBM i, Apache, DB2 and PHP) for development of Web-centric applications with dynamic content tied to DB2. The stack would be similar to Figure 5.

PHP Toolkit. Releases of Zend Core and Zend Server (through version 5.6) included a set of APIs for accessing IBM i objects, data and programs. With version 5.6 of Zend Server, the PHP toolkit is no longer included in favor of support for XMLService through the ToolkitService() PHP call.

The long-term strategy is to make use of the ToolkitService() support (see next section) for XMLService within PHP programs that need to integrate with IBM i objects, data and programs. Existing customers that upgrade from an earlier version of Zend Server will be able to maintain the toolkit and thereby their programs will continue to function. Zend Server 5.6 also includes a compatibility switch with the PHP toolkit. When the compatibility switch is enabled, those programs that have PHP toolkit calls will continue to function even if the PHP toolkit isn’t installed. What occurs is that the PHP toolkit function is translated by the compatibility switch to a corresponding ToolkitService() call.

XMLService. XMLService is an open-source RPG extension that enables Web XML scripting calls of IBM i resources, programs and service programs, commands, PASE utilities, and SQL DB2. Integration with XMLService is supported over various driver transports including DRDA, ODBC and REST and can be used as a single tier (IBM i) service or as a two-tier (Linux/Windows) service. Generally XMLService consumers will be scripting languages such as PHP, Ruby and Python; IBM i languages such as RPG; or simply HTML/XML.

ToolkitService. ToolkitService() is an object-oriented class provided with version 5.6 of Zend Server that provides the interface into XMLService. ToolkitService() and the corresponding XMLService can be viewed as a multi-step process illustrated in Figure 6.

Here’s how it works:

  1. ToolkitService() is responsible for hydrating the parameters and desired function into XML and calling XMLService with the corresponding XML.
  2. XMLService is responsible for dehydrating the received XML and making the appropriate call with the parameters provided.
  3. XMLService is responsible for hydrating the results back into XML.
  4. ToolkitService()/PHP is responsible for dehydrating the results received in the XML. Zend Server 5.6 includes several sample programs utilizing the new ToolkitService() object that can be used to investigate and learn about the capabilities of this new class.

Great Choice

All of the offerings I mentioned in this article are available at no charge. The only possible exception would be Zend Server for IBM i, which has a free community edition (Zend Server Community Edition). Zend Server, which has additional capabilities, has a cost. Keep in mind that while open-source solutions are generally free to obtain, costs can be associated with items such as support.

Whether implementing infrastructure solutions, deploying Web-centric applications or developing your own homegrown Web-based solutions tied to IBM i resources, the IBM i platform is a great place to host your open-source solutions.

Also I want to mention that if you desire assistance with your open-source implementation on IBM i, STG Lab Services offers Linux-skilled resources. Contact or visit the Lab Services website.

Erwin Earley is an advisory software engineer for IBM assigned to the POWER AIX/Virtualization Delivery practice in Rochester, Minn.

comments powered by Disqus



2019 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

A PHP Partnership

Zend and IBM team up to deliver open-source solutions to IBM i

Making the Net More Inclusive

IBM hopes to help disabled and illiterate users surf the Web

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
IBMi News Sign Up Today! Past News Letters