DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Java
  4. Tomcat Today, GlassFish Tomorrow?

Tomcat Today, GlassFish Tomorrow?

Alexis MP user avatar by
Alexis MP
·
Jul. 03, 08 · Interview
Like (0)
Save
Tweet
Share
120.95K Views

Join the DZone community and get the full member experience.

Join For Free

[img_assist|nid=3867|title=|desc=|link=none|align=right|width=151|height=67]While there are indeed several advantages to using GlassFish vs. Tomcat, it's probably useful to know that Sun is the original creator of Tomcat and that any application running today on Tomcat should run just fine (no modification whatsoever) on GlassFish.

Grizzly

Historically, if you wanted to get good HTTP performance from Tomcat you really needed to have a the Apache web server to sit in front of Tomcat which involved more setting up and extra administrative work. Since GlassFish v1 (May 2006), Grizzly is the HTTP frontend of the application server. It's a 100% Java nio framework that provides the same performance as Apache only it's written in Java and integrated straight into the application server. While using Apache or Sun Web Server in front of GlassFish is quite possible, it's certainly no longer needed for performance reasons. Grizzly is also used for other protocols such as IIOP and now SIP (project Sailfin). Finally, Grizzly is the key technology for implementing Comet (aka Reverse Ajax, aka Ajax Push) which enables so very interesting push scenarios (from server to clients).

Full Java EE 5 support

Support for Java EE 5 (and soon Java EE 6) has always been a key priority for the GlassFish project. It delivered its first Java EE 5- certified implementation more than two years ago. This allowed developers to enjoy the much simplified EJB 3.0 specification, JAX-WS, and more goodness early on but it also provided dependency injection in the web tier (in servlet or JSF managed beans). Tomcat is not a full blown application server so while it may be enough for some developments, many companies find themselves maintaining a stack of frameworks and libraries on top of Tomcat when a GlassFish provides a JPA persistence engine (Toplink), a full web services stack (Metro), an application model (EJB3), and more, all out of the box. Java EE 6 profiles should help improve that situation for the industry as a whole.

Admin Tools

Administration and monitoring tools is what GlassFish users coming from Tomcat get as an immediate benefit. From web tools to command- line tools, GlassFish has an extensive set of features ranging from application (un)deployment, to JNDI resource creation, to all sorts of configuration details. All is JMX-based, exposed using MBeans (called AMX) and usable from JMX tools such as JConsole or the new VisualVM (specific plugin for GlassFish there). GlassFish also provides a fully- integrated monitoring feature called Call-Flow which reveals very accurately where time is being spent in the application before a response is sent. GlassFish also comes with a self-monitoring framework capable of implementing administrative rules such as the addition of a new node to a cluster if the average response time goes beyond a certain threshold.

[img_assist|nid=3864|title=|desc=|link=none|align=undefined|width=600|height=433]

Documentation

Technical information for GlassFish comes in various forms complementing one another quite well. The official documentation is extensive and complete (20+ books, from Developer's Guide to Deployment Planning Guide). There's also the Java EE tutorial, Enterprise Tech Tips, GlassFish user FAQs, blogs from engineers, forums and mailing lists.

Clustering

Full clustering is built right into GlassFish with no need to move to some other codebase or for-pay version of the product. In fact, you can even upgrade from a "developer" profile to a "cluster" profile. Clustering in GlassFish means the grouping technology (heartbeats, centralized admin), the load-balancing, but also the stateful data in- memory replication. Project Shoal is the GlassFish sub-project that does the heavy-lifting for most of these features. It uses JXTA under the covers which has the nice side-effect or requiring little to no configuration. GlassFish clustering make no assumption about the load- balancing technology used - it provides Web Server plugins but also works with hardware load-balancers. Such load-balancers do not need to know where the replicas are. Finally, Sun also offers a 99.999% solution with an in-memory distributed database (HADB). It has greater performance degradation, but probably unmatched availability.

[img_assist|nid=3865|title=|desc=|link=none|align=undefined|width=564|height=458]

Performance

Sun has literally worked for years on the performance of GlassFish - Grizzly, EJB container, Servlet container, Web Services, OpenMQ implementation, etc... The best result of this has been the SPECjAppServer world record published late last year and putting GlassFish in first place ahead of Weblogic and WebSphere (Tomcat isn't a full app server and thus isn't listed there, while JBoss has never published results). This is the first time one could claim that you no longer need to choose between open source and performance, you can have both. Performance is a strong priority for Sun.

Support from Sun

GlassFish is free and open source (dual CDDL + GPLv2 license), but Sun also has a business strategy to monetize GlassFish thru services. One such service is the subscription that covers access to patches and interim releases, access to support and escalation of bugs as well as indemnification. Sun also recently announced the GlassFish and MySQL unlimited offering (see http://www.sun.com/aboutsun/pr/2008-06/sunflash.20080627.1.xml) .

Tooling

While the NetBeans/GlassFish integration is very good, there is clearly no "NetBeans prerequisite" to use GlassFish. In fact Sun is the main developer of an open source plugin for Eclipse WTP to use GlassFish v2 and even v3. Both NetBeans and Eclipse users can get the plugin right from the IDE (for Eclipse, it's a WTP plugin for Eclipse 3.3 or 3.4). There is also support for GlassFish in IntelliJ and Oracle has announced support in JDeveloper.

 [img_assist|nid=3866|title=|desc=|link=none|align=undefined|width=462|height=651]

Tomcat, GlassFish v3

GlassFish has made a lot of efforts to appeal to developers. Its a single, small download of about 60MB, has auto-deploy capabilities, starts pretty fast for an application server with GlassFish v2 (probably the best full-blown application server startup time). To be fair to Tomcat or Jetty, they are still perceived by many as lighter- weight and faster to start. GlassFish v3 is all about being modular (based on OSGi), extensible and very developer friendly. The recently released TP2 (Tech Preview 2) starts in less than a second, starts/ stops containers and resources as needed and provides support for scripting technologies such as Rails, Groovy, PHP and more. There is also an Embedded mode for GlassFish which enables developers to use GlassFish via an API for testing or embeddability purposes. GlassFish v3 is scheduled to be aligned with Java EE 6 and released mid-2009. In the mean time there will be regular refreshes.



 

GlassFish Apache Tomcat Java EE application Open source Java (programming language) Web Service Application server Web server

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Keep Your Application Secrets Secret
  • Testing Level Dynamics: Achieving Confidence From Testing
  • Fargate vs. Lambda: The Battle of the Future
  • Introduction To OpenSSH

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: