What we think about MySQL
The title of this article was our reaction when we heard MySQL was coming to IBM i. Actually, our reaction was much more strongly worded—we cleaned it up for publication! The DB2 database on our system is so robust, so integrated, so simple—why on earth would anyone ever want to put another database management system (DBMS) on this platform?
Becoming Fans
After getting more detail, we’ve now become fans of the idea and we'd like to share the reasons why. For those whose horizons may not yet have expanded beyond the more traditional RPG/COBOL/DB2 realm of applications, MySQL is one of the most popular DBMSs today. And it's open source (as in free, at least in one of its incarnations). Perhaps to a great extent because of that fact, MySQL has been embraced by developers in many environments—especially those programming in languages that are themselves widely used to develop open-source applications, such as PHP and Java.
So what does this mean to us on the world's best business application platform, largely due to the power and flexibility of our particular flavor of DB2? It means access to a whole new world of applications. Remember the AS/400—as in "Application System"—was so named because of the large number of application solutions available for it? We may have moved away from the name AS/400 (at least some of us have), but the need for an easy-to-manage application platform hasn’t changed. Now, there’s whole new world of application availability—some for fee, many for free—and they’re more easily available to our platform thanks to MySQL on the i.
Easy Integration?
Some of you may be thinking, "Yes, but implementing another completely different database sounds difficult and it would surely be a nightmare to integrate data from that system into my other applications on IBM i." But what if it weren’t difficult to implement? And what if you could integrate the MySQL databases with RPG/COBOL/DB2 and/or your favorite reporting tools by simply accessing the same data using all your familiar interfaces, such as READ, CHAIN, UPDATE or with embedded SQL?
Could such a thing happen? How could the same data be accessible with completely different kinds of interfaces? It shouldn’t be that surprising if you remember DB2 has the unique flexibility of having two completely different types of interfaces: the native programming language operations originally designed for non-relational "flat file" access and relational database access via SQL.
In the case of MySQL, the integration potential was helped along by a rare feature of this database—the concept of supporting multiple "storage engines" for the data that’s managed by MySQL. With any implementation of MySQL, on any platform, you have your choice of several ways to store the data—different storage engines—each of which has its unique strengths and weaknesses in specific application scenarios. One could even write an application using MySQL that utilizes different storage engines for different tables. It's an interesting and powerful flexibility option that has much merit, especially for a DBMS that’s supported on so many different types of operating systems and application environments.
The IBM i implementation of MySQL also has a choice of several different storage engines, including the intriguing option of using DB2 for i as a MySQL storage engine. This means that a PHP or Java application using MySQL can create and manipulate data that resides in the DB2 for i database (e.g., physical file/table objects in libraries/schemas that our RPG or COBOL programs and our favorite i-based report writing tools can also access).
What we think about MySQL
Best of Both Worlds
Think about it. If we could do that, it would be like having the best of both worlds—the flexibility of implementing applications written using MySQL while still having that same data available to our own native applications in the same ways we’ve always had. No need to give up our beloved DB2 database; we just further expand its usefulness and flexibility.
It would mean that a huge virtual warehouse of applications written using PHP or Java with MySQL can not only run on IBM i, but can integrate with our native applications with the simplicity of "ordinary" DB2 interactions. It could even mean that many tools for creating and administering databases written for MySQL (many that can be used for free) could be utilized as interfaces to DB2 for i.
Does this mean that PHP and Java can’t just access DB2 for i directly without going through MySQL? Of course not. Many applications are written to talk directly to DB2 and having the DB2 for i storage engine for MySQL doesn’t change the advantages of doing that. For those applications using MySQL, this provides an easy and effective point of integration for our native applications and databases.
Lest we get carried away in painting a picture of a utopia where everything is freely integrated with no effort, issues or considerations, you should know there are currently many rough edges to this connection point between MySQL and DB2 for i. Some of the more obvious rough spots relate to the fact that MySQL databases can have table and column names longer than 10 characters and are case sensitive. This presents some challenges for native application interfaces with solutions and/or workarounds that are often not particularly pretty. Some challenges can make the integration between the two worlds far from seamless.
More DB2 Power
We hope better solutions to some of these issues will be forthcoming as the connection between MySQL and DB2 for i becomes more popular. In the meantime, who would’ve thought that one of the world’s oldest relational databases (after all, System/38 may not have called it DB2, but it first implemented what became DB2 for i) would find such a close connection with one of the newest relational databases?
Support of MySQL on IBM i is by no means an indicator of some future demise of DB2. Quite the opposite; it’s yet another proof of the flexibility of DB2 on our platform and of the power that comes from integration. It's simply the best of both worlds.