MySQL Database Overview - MySQL from the Application Developer's Perspective

MySQL Database Overview - MySQL from the Application Developer's Perspective
« Prev
Next »

MySQL from the Application Developer's Perspective

What options are available to a developer who wants to write a client applica­tion interfacing with a MySQL server? Client API libraries exist for C/C++, PHP, Perl, Python, TCL, Ruby, and Eiffel. Java is supported through a JDBC driver. You can also connect to MySQL using the ODBC standard, which opens up MySQL for use with Visual Basic, ADO, ASP, Delphi, ColdFusion, and any other ODBC-capable language, protocol, or development environment. If you are wondering about the use of a particular tool with MySQL and there is no explicit mention of MySQL support anywhere in this book, in the MySQL online documentation, or in the documentation of the tool itself, check to see whether the tool is ODBC-capable. If it is, it can be used with MySQL.

If a certain language or tool currently does not have native or ODBC support to connect to MySQL, there is still hope. If the language or tool is capable of accessing routines in an external library, you can invoke the code from the

 

Overview of MySQL Integration with Other Industry-Standard Software

MySQL C API library to get the job done. Even in the case of not being able to interface with external libraries at all, you can implement the MySQL client- server protocol on the application level, thus creating a low-level MySQL driver for that language or tool. In practice, the latter has happened only once in the history of MySQL, when Java support was created. APIs for other languages were implemented by simply calling routines from the MySQL C API.

What about the option of extending the server? Unlike many other database servers, MySQL has its source code available, so this is actually an option. As we mentioned earlier, work on MySQL server source can be a challenge. Luck­ily, the flexibility of MySQL allows you to solve most problems without ever having to consider extending the server. However, in some cases adding code to the server could be beneficial.

 

Overview of MySQL Integration with Other Industry-Standard Software

How well does MySQL coexist with other industry-standard software? Instead of merely rattling off a long list of products it can work well with, let’s examine the principles of integration that determine how well application X will inte­grate with MySQL.

The key word to remember and focus on is standards. What standards does the application support? Does it support ODBC? If so, MySQL will integrate with it rather smoothly. This means MySQL will work with Access, Excel, Visual Basic, ASP, Crystal Reports, Delphi, ColdFusion, and many other applications, lan­guages, and development tools.

Although ODBC is a great portability standard, the price to pay for portability is performance. For a desktop application connecting to a remote MySQL server, the performance reduction can be neglected for all practical purposes. How­ever, if ODBC connections are established from a busy application server—in which case performance might be more important than portability—it would be advisable to consider an alternative that would use the native MySQL API.

How well will Web server X integrate with MySQL? Again, we go back to the concept of a standard. Most Web servers support the CGI standard, which per­mits an application executable residing on the Web server to be invoked through a Web request. Thus, the problem is reduced to being able to create an executable on the Web server that can talk to MySQL, which can be done using your language of choice. MySQL, therefore, can be integrated with any Web server that supports CGI, which includes Apache, Roxen, IIS, iPlanet, Web­Sphere, and a multitude of others.

Although CGI will do the job of integration for most Web servers—thus making it easy to move from one server to another—as you would expect there is a price to pay, just as in the case of ODBC: reduced performance. If the Web server is a busy one, this can be a serious concern, to the point of outweighing the issues of portability. An alternative solution using MySQL’s internal server API (such as PHP for Apache and ASP for IIS) might be advisable.

Web applications making the use of Java (JSP, servlets, or applets) can use MySQL using the MySQL Connector/J JDBC driver. The portability of JDBC facilitates porting to MySQL from other databases, and allows you to write code supporting multiple databases.

When making a decision between portability and performance, first perform a set of benchmarks simulating the application to get an idea of what kind of per­formance difference solution paths can provide and compare it with the per­formance requirements of the application. Realistic analysis of capabilities versus requirements will help save a lot of development time and other resources.

« Prev
Next »
Comments (0)
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Suggested Locations