The tale of two forks: GlassFish and Payara

Shantanu Mohanti
5 min readAug 16, 2021

--

If you know Java EE (now Jakarta EE), you may know GlassFish and Payara. They have a common ancestry. Let us take a look at them.

GlassFish was the server from Sun, until Sun was purchased by Oracle, which already had several other servers. For this Oracle dropped support for GlassFish and stopped most investment of it. A clever UK engineer Steve Milledge forked Glassfish 4, called it Payara 4, and continued with development.

Oracle didn’t completely stop with GlassFish and continued with it for some time. Whenever Oracle added something, Payara merged the changes from upstream. For a long time Payara advertised itself as a drop-in replacement derived from and sourced from GlassFish.

With GlassFish 5 and Payara 5, both Oracle and Payara have independently updated their servers to Java EE 8. Payara 5 is no longer a direct fork of GlassFish 5. But then something unexpected happened, and Oracle donated GlassFish and all of Java EE to Eclipse. See this story for more information.

Following the donation, and after some time, Payara’s former technical lead Arjan Tijms and another former Payara engineer continued with GlassFish and released new versions with updated components more frequently.

Now we sum up some differences in a table:

╔══════════════════════════╦════════════╦═══════════════════╗
║ - ║ GlassFish ║ Payara ║
╠══════════════════════════╬════════════╬═══════════════════╣
║ Run on JDK 11 ║ V ║ V ║
║ Run on JDK 17 ║ V ║ X ║
║ Compile on JDK 11 ║ V ║ X ║
║ Compile on JDK 17 ║ V ║ X ║
║ Jakarta EE 9.1 compliant ║ V ║ X (V for 6 alpha) ║
║ MicroProfile 4 compliant ║ X ║ V ║
║ Jakarta MVC (Krazo) ║ V ║ X ║
║ JDK 11 safe Weld SPI ║ V ║ X ║
║ Official Docker image ║ X ║ V ║
║ Commercial support ║ X ║ V ║
║ Latest upstream (Mojarra)║ V ║ X ║
║ Runnable jar version ║ X ║ V ║
║ Embedded DB ║ V (Derby) ║ V (H2) ║
╚══════════════════════════╩════════════╩═══════════════════╝

For previous versions, we see that the GlassFish team focuses more on compatibility with newer JDK versions. Payara runs on JDK 11, but it does not compile on it. This is important, and means that it depends on compatibility in the JDK which has been removed in later JDK versions. Running Payara on JDK 17 means redoing all the work done by Glassfish. From the commit history on GitHub we can see that this is much work.

GlassFish is also compatible with Jakarta EE 9.1. Payara is working on it, but it has only compatibility in an alpha version, which is Payara 6 Alpha. Here again, Payara is behind Glassfish. But perhaps this is not so important for end users, as Jakarta EE 9.1 is an intermediate version for tool vendors, according to both Mr. Tijmes and Mr. Milledge.

A big difference between GlassFish and Payara is MicroProfile, which are additional APIs, which for some reason are not in Jakarta EE, even when everyone thinks they should. The reason here is political and it is a long story. GlassFish does not have any MicroProfile API, but Payara has. Also, all MicroProfile API implementations are developed by Payara themselves. GlassFish has one extra API Payara does not have, which is Jakarta MVC. Jakarta MVC is like Jakarta Faces, but different. This is again a long story, but fans of server side rendering know the difference.

When we look at the embedded DB we can see that Payara has changed to H2. Maybe because H2 is more famous. GlassFish uses Derby. Both of these Java DBs are probably not optimally supported, but we have seen more recent releases of Derby (March 2020 for Derby vs October 2019 for H2) H2 have fallen into what we call the refactor trap. The sole developer started refactoring, but is now afraid to release new versions, because he thinks it’s never enough for compatibility (risk losing data). This has been discussed on H2’s GitHub, where many users ask for the new H2 version.

Another difference is runnable jar support. Here we see that there is Payara Micro version of Payara. Glassfish doesn’t have this. But Glassfish has embedded Glassfish, which is probably 95% of Payara Micro. No one even thought of making it usable just for Glassfish, so it’s a big win for Payara. A new development here is called Piranha Cloud. This is not based on GlassFish, but uses GlassFish components. We can think about this as an even smaller runnable jar. Payara Micro is almost full application server, but you use it in a simple way. Piranha Cloud is runnable jar from the ground up, so much smaller. Also, Piranha Cloud is by same main developer as GlassFish.

To better understand the efforts of both, let’s look at the commitment program on GitHub for this year (2021).

For GlassFish we have:

GlassFish commitment

For Payara we have:

Payara Commitment

For GlassFish we see top committer is Arjan Tijms with 99 commits, and then David Matějček who has almost the same with 86 commits.

For Payara we see top committer is Andrew Pielage with 49 commits and then Lenny Primak with 36 commits. Strangely we do not see Steve Milledge anymore, but when you look in full historical commits, we see him.

For GlassFish we see Mr Tijms many times online. He writes books on Java EE and more. Mr Pielage we do not see so much online. It was strange to find out he is Payara top developer and not Mr. Milledge, but of course he is a good coder, just a little bit more quiet. Mr Milledge we do see many times online and he gives very good presentations, but we do not see him in Payara commits for some reason. We do see Mr Milledge in GlassFish commits too in full history and we see Mr Tijms in Payara commits. Why is this important? It shows the two forks have worked together in some way long after the split.

Looking at the commits, we see that Glassfish and Payara are equally active. But the division of labor can be different. Is this important too? Now it is difficult. I would like to see for myself the pledge plans to get an idea of the project health, but we must understand it is only one aspect.

So we have seen that there are two servers which started from the same ancestor. Now they have different characteristics. GlassFish is more up to date with newer JDKs and new components and new Jakarta EE API compliant most of the time. But Glassfish doesn’t have a MicroProfile, so you only have a one-time choice when it matters. If professional support is important to you, you also have one option, which is Payara.

Therefore we cannot declare a single winner, and that was not the intention of this text. Hopefully now you have come to know the difference and similarity between these two a little better.

--

--

Shantanu Mohanti
0 Followers

Java developer, architect, interested in new things.