13
Wed, Nov
5 New Articles

Application Server Architectures

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

It's hard to be an iSeries programmer these days. Even if you want to move out of the green-screen paradigm, there are a number of things holding you back. Today's topic, Web application architectures, is a microcosmic example of the whole issue.

It's clear that we need a Web interface. A few fervent but somewhat fringe voices are demanding a "native GUI" for the iSeries, but that battle is long lost. Considering the fact that UNIX doesn't have a "native GUI" (real UNIX programmers use the command line), it's pretty clear that a combination of browser-based and rich-client interfaces marks the future of all server-based programming, whether it's the iSeries' midrange-centric style or Microsoft's server-farm style.

And since we need Web applications, we need a Web application server. And since we need a Web application server, we need a Web application server architecture. And this is where things generally come to a screeching halt. Why? Because there are at least three major competing architectures, with a number of new ones (or variants) on the horizon. Not only that, but the issues that favor one approach from a tactical standpoint often favor a different direction strategically.

In this column, I'll present the "Big Three" of Web application architectures and the various sub-genres:

  • Java-based Web application servers—Non-certified and J2EE certified
  • Common Gateway Interface (CGI)—RPG and other languages
  • Microsoft .NET
  • Other options

Java-Based Web Application Architectures

Let's start off with a disclaimer: Java-based servers and especially J2EE-compliant servers are my personal favorites. By the end of this article, you may or may not agree with me, but I think it's only fair to make my bias clear from the beginning.

Let's also get some terminology issues out of the way. Now that the whole world finally has its head around the term "J2EE" to refer to Sun's enterprise-level Java platform, Sun has changed the naming conventions again. The "2" is gone, as is the Java 1.x numbering scheme. The current release of Java (Tiger) is Java 5, and the editions are Java SE (Standard Edition), Java EE (Enterprise Edition) and Java ME (Micro Edition). To fully name a Java platform, you specify the edition and version, so the latest and greatest enterprise platform is now Java EE 5. The Mustang release currently in the works will be Java 6, so its enterprise platform will be Java EE 6. Got it? Good!

On to the architectures. All Java Web servers work the same way: They use servlets, which may or may not have persistent connections to the browser. With a persistent connection, the application can basically become stateful and store information about the current browser session in memory without having to constantly either load it from disk or from a cookie. While there are a number of technical details with this concept, it is far more efficient for running business applications than the traditional stateless approach of standard HTTP communications. Note also that while JavaServer Pages (JSPs) seem to be more like "super HTML pages" than Java programs, JSPs are converted to servlets at runtime and thus have all the benefits (and drawbacks) of the Java Web application architecture.

There are currently two distinct flavors of Java Web servers: those that are Java EE-certified and those that are not. And within the Java-certified versions, there are levels of certification. For example, the vast majority of application servers are J2EE 1.4-certified. The only server I know of that is Java EE 5-certified is the open source GlassFish server. Since a certified server is really a superset of a non-certified server, let's start with the non-certified Java Web application servers.

Non-Certified Java Web Application Servers

I currently know of three of these: Tomcat, Jetty, and Resin. You've probably heard of Tomcat: It's the free application server available from the Apache Software Foundation. Tomcat has been around for awhile and for a short time it was even "sort of" supported by IBM on the iSeries. Jetty is a small-footprint server that is often embedded in completely portable applications and is nearly as fast as Tomcat. Resin is a bit of a niche player. It gets mixed reviews on benchmarks but is generally a more "nerd-worthy" architecture: Generated JSP code is more elegant and faster but at the cost of not being 100% compatible with the J2EE specifications.

Java EE Certified

What does "Java EE certified" mean? It means among other things that a whole range of specifications has been met, which includes a wide variety of "optional" Java packages. While I'm no expert, it's clear to me that the amount of work already done for Java EE developers is significant.

Most application servers are currently certified for the J2EE 1.4 platform. These include packages like IBM WebSphere, JBoss, BEA WebLogic, ObjectWeb JOnAs, Oracle 10g, and Apache Geronimo. A very interesting recent development is that IBM has just released a completely free version of WebSphere called WebSphere Community Edition that is based on Apache Geronimo!

There is only one Java EE 5-certified server that I know of, GlassFish. Here's a list of the packages that must be available for a Web application server to be Java EE 5-certified:

  • Common Annotations 1.0
  • Connector 1.5
  • EJB 3.0
  • JACC 1.1
  • JAF 1.1
  • Java EE Management 1.1
  • Java Persistence 1.0
  • JavaMail 1.4
  • JAXB 2.0
  • JAXR 1.0
  • JAX-RPC 1.1
  • JAX-WS 2.0
  • JMS 1.1
  • JSF 1.2
  • JSP 2.1
  • JSP Debugging 1.0
  • JSTL 1.2
  • JTA 1.1
  • SAAJ 1.3
  • Servlet 2.5
  • StAX 1.0
  • Web Services 1.2
  • Web Services Metadata 2.0

While some of these—Servlet, JSP, JSF—are obviously required by a JSP container, others are really powerful pieces that give the Java EE programmer a lot of pre-written code to use. And these are not snippets that you download off the Internet and hope work in your application; these are rigorously defined APIs. A couple that jump out immediately are JavaMail and the various JAX APIs. JavaMail provides a robust but easy-to-use mail interface, while the various flavors of JAX provide very specific extensions to basic XML handling procedures. JAXB is a way to bind XML and Java objects, which makes it very easy to write good, readable Java code to communicate with XML documents (such as for Web Services).

The big issue here is that Java EE certification provides a wealth of ready-to-use APIs that simplify the job of Web application development.

Common Gateway Interface (CGI) Servers

This is something of a misnomer; a CGI server isn't really a server. It's a way to allow HTTP requests to be routed through the HTTP server and to a specific program. CGI predates the servlet model and is a bit more basic. In general, every time the HTTP server receives a CGI request, a new process is "spawned" and the request is passed to it. Data is generally passed in via "pipes," which are special mechanisms designed to allow a stream of data to be sent from one process to another.

RPG

While primarily a UNIX concept, this process and pipes architecture has been replicated on Windows and even on the iSeries, although the overhead associated with creating new processes for each request is quite expensive, especially if you are using a non-multi-threaded language, such as RPG. Without extensive modification of this process, the overhead for multiple calls is quite high. Note that the use of AJAX, which essentially breaks up a single Web page into multiple small calls, only exacerbates the problem.

There is an alternative, by the way. The free software package called FastCGI is designed to mitigate the overhead issue somewhat by creating a "pool" of jobs that will process requests in a round-robin fashion and then go quiescent while waiting for another request. This means the startup penalty is incurred only once. From all accounts, this approach works quite well, although it's yet another failure point you've added to your system. I'm not sure how support works with the FastCGI product.

Script Languages

Another entire set of CGI approaches uses script languages. These include Perl, PHP, Python, and Ruby. Each of these languages requires some sort of native interpreter on the host system. A reasonable analogy for these languages is to think of them as "BASIC-like." They allow you to sort of "feel" your way through the design process, adding bits and pieces as you see fit, without requiring much in the way of a rigorous up-front design. Thus, they're eminently well-suited for things like proofs of concept or rapid prototypes. However, these languages are not particularly appropriate for large-scale development and maintenance unless you put a lot of procedures in place. I once talked to a Python developer and I mentioned that the primary tool I used in development was a text-scanning utility, and he laughed and agreed. That's because most scripting language applications consist of dozens and dozens (if not hundreds or thousands) of small script files. And unlike Java, which is a strongly typed language and has a very specific methodology for grouping, organizing, and inspecting code, most script languages are simply text-based. If you want to find the code that uses a given procedure, scan all of your source with a text scanner.

That issue aside, many of these script languages (Ruby and Python in particular) have large pre-written libraries of code that can be used to develop Web applications. I've heard it said that it takes one line of code to write an HTTP server in Python. I'm not sure of that claim, but I can't categorically deny the possibility. It just means that someone has built a very easy-to-use HTTP server library with a lot of defaults built in.

Other Compiled Languages

I should note at this point that any compiled language can conceivably be used as a CGI language. In fact, lots of C code has been used over the years on UNIX machines. Since you have both C and C++ compilers available on the iSeries, there's nothing stopping you from using them. You could even use COBOL if you're so inclined.

Microsoft .NET

It's a nice day, a nice time of year, a nice holiday (happy belated Fourth of July), and I refuse to get all worked up. That being the case, I'm not going to spend a ton of time on the .NET option. It's sufficient to say that .NET is the Microsoft solution. If you want to go all Microsoft all the time, then by all means use .NET. But don't be blinded by so-called compatibility options: I've heard about Mono, and I've heard about IKVM, and neither of them is completely supported by anybody, so entrusting your mission-critical systems to either one is a risk that you will have to justify.

If you do choose the Microsoft approach, .NET allows you to invoke any of the CLR-capable languages in response to Web interactions from the user. I haven't taken a lot of time to test this particular approach; with the constant slipping of both Office and Vista, it seems a little dangerous to me to count on viable software from Microsoft anytime in the near future. Of course, I'm a Java EE bigot, so what would you expect me to say? Perhaps someone with more time using these tools can respond in the forums and give you a more informed opinion.

Other Options

There are a few other options out there. I mentioned Python awhile back; well, Python has an entire Web-application-serving environment that is packed with features and designed from the ground up to build Web applications. The tools are Plone and Zope, and in literally hours, I had an entire Web site built on this platform. The problem is that at the time I tried it, the iSeries didn't support a recent enough version of Python, but I'm thinking about trying it again in the near future.

I should also mention the various macro languages, which include the granddaddy of them all, ColdFusion, as well as one near and dear to many iSeries developers, Net.Data (most definitely not to be confused with anything .NET). With these languages, you embed tags into your HTML, which are in turn used to run programs that access data and perform business logic, ultimately returning data back to the Web page. The problem with this design is the fact that it is diametrically opposed to what we currently recognize as the "optimal" approach of separating model, view, and controller (MVC). With macro languages, the business logic is often embedded directly into the HTML, making for some really difficult-to-maintain applications.

The Verdict

If you simply refuse to have anything to do with Java, then your choices are pretty straightforward: RPG or scripts. It's a little strange to me that you would be willing to learn a completely foreign language like Ruby but not Java, especially since you need to understand basic Java syntax to add JavaScript to your HTML pages and JavaScript is a necessity in business applications. So to me, if you don't go Java, go RPG. IBM's CGIDEV2 is a complete package that will help you develop CGI-based business applications, and there are also some commercial packages out there and people willing to teach them to you for a fee.

On the other hand, if you want to go the Java route, I'd tell you to go with something supported, like WebSphere. You could skip WebSphere and go with something like Tomcat or JBoss or even Resin, but be careful to keep your code vanilla enough to switch between servers easily, because the biggest problem with this decision is not application design but server lock-in. But if you code basic JSP Model II architecture and avoid implementation-specific techniques, you ought to be good to go on any Java-based server.

Note that JSPs were originally intended as the Java response to this architecture, but because the non-MVC nature was so counter-productive, a new approach (JSP Model II) evolved in which a servlet builds Beans that are sent to a JSP for display. As I mention often in my seminars, this is really the 5250 programming model, only inside a browser. And that is perhaps the final reason that I love JSP Model II and the Java EE architecture: We've been proving that this architecture works for 30 years now. We just added a new terminal type: the browser.

Joe Pluta is the founder and chief architect of Pluta Brothers Design, Inc. and has been extending the IBM midrange since the days of the IBM System/3. Joe uses WebSphere extensively, especially as the base for PSC/400, the only product that can move your legacy systems to the Web using simple green-screen commands. He has written several books including E-Deployment: The Fastest Path to the Web, Eclipse: Step by Step, and WDSC: Step by Step. Joe performs onsite mentoring and speaks at user groups around the country. You can reach him at This email address is being protected from spambots. You need JavaScript enabled to view it..

Joe Pluta

Joe Pluta is the founder and chief architect of Pluta Brothers Design, Inc. He has been extending the IBM midrange since the days of the IBM System/3. Joe uses WebSphere extensively, especially as the base for PSC/400, the only product that can move your legacy systems to the Web using simple green-screen commands. He has written several books, including Developing Web 2.0 Applications with EGL for IBM i, E-Deployment: The Fastest Path to the Web, Eclipse: Step by Step, and WDSC: Step by Step. Joe performs onsite mentoring and speaks at user groups around the country. You can reach him at This email address is being protected from spambots. You need JavaScript enabled to view it..


MC Press books written by Joe Pluta available now on the MC Press Bookstore.

Developing Web 2.0 Applications with EGL for IBM i Developing Web 2.0 Applications with EGL for IBM i
Joe Pluta introduces you to EGL Rich UI and IBM’s Rational Developer for the IBM i platform.
List Price $39.95

Now On Sale

WDSC: Step by Step WDSC: Step by Step
Discover incredibly powerful WDSC with this easy-to-understand yet thorough introduction.
List Price $74.95

Now On Sale

Eclipse: Step by Step Eclipse: Step by Step
Quickly get up to speed and productivity using Eclipse.
List Price $59.00

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: