Java EE vs. Spring: Which is More Popular?
One of the most important debates in the Java community revolves around web frameworks. More precisely, it's the debate on Java EE vs Spring.
A couple of months ago, we released our annual Developer Productivity Report, where we looked at the results of asking Java developers about what tools and technologies they use. Among all kinds of cool findings, like what IDE is the most popular, whether microservices offer a salvation from solving hard problems, and so on, we got the data about the web frameworks our respondents use.
Get the 2021 Java Developer Report for up-to-date insights and trends.
We saw that both Spring and Java EE are pretty popular choices, and the general consensus is that both are quite excellent. That realization made us ask a deeper question. What components of the platform do you actually use?
Think about it, if someone uses servlets, do they use Java EE? It's a part of the specification, sure, but really? Would you call it a Java EE application? What about if you sprinkle your model with some JPA annotations? Where's the line drawn?
The same question is valid when applied to the Spring framework. There are tons of projects and subprojects in it: Spring data, Spring integrations, MVC, Reactor, Security, Spring Boot… we can continue naming them almost until the time Java EE 8 comes out.
About the Survey
So to improve our understanding of what developers actually mean when they say "I use Spring" or "I use Java EE", we ran another survey with just a couple of questions: do you use the technology and what components do you use. Also, if you'd have a chance, would you migrate from one stack to the other or not.
Here are the results. When I was envisioning this post, I wanted to do the analysis and offer you some conclusions. Now, however, I think that it'll be for the best to just offer the data and describe it a bit. Conclusions, should you chose to draw them, will be your own. And we made the gathered data publicly available, so you can totally look for yourself.
The survey was open for about two months, and we got almost two thousand responses all together. Let's look at the data about the Spring Framework usage we received.
Don't have time to read the report right now?
We covered the key insights in a webinar, available to view on-demand here.
Spring Framework Survey Results
If you're interested in how up-to-date the participants are, here's a short reference on the release dates for the Spring framework major releases:
- 3.0 - December 2009
- 3.1, 3.2.5 - November, December 2011
- 4.0 - December 2013
- 4.2 - July 2015
- 4.3 - June 2016
- 5.0 - December 2016
And now the most important bit, Spring technologies used by developers. The percentages in the graph below are computed based on the number of people who specified what version of Spring do they use. Indeed, since the same survey contained the results for Java EE developers, this is a reasonable approach. In total, we had about 1200 responses that indicated the use of Spring Framework. Here's the breakdown of the components by popularity.
Almost 90% of people who say they use Spring, use the Spring Framework for it's core functionality, dependency injection, components model, beans, and the default annotations. I wonder what other 10% are using for that, Guice?
One thing to notice here, is that a large group of developers said they use just the core, MVC, Security and Data. And the rate drops pretty quickly, one in five uses Spring Cloud, JMS, integrations or similar.
Java EE Survey Results
Now if we look at the Java EE side of the survey, we get a similar picture. We got about 1600 responses about the use of Java EE. Here is the spread of the versions Java EE developers use.
To refresh your memory, here are the release dates for the specifications in the table above:
- J2EE - November 2003 (I'd love not to include this number from the last century, but my editor made me do it)
- Java EE 5 - May 2006
- Java EE 6 - December 2009
- Java EE 7 - June 2013
Let’s be smart about it, the libraries implementing the spec have been updated after that, so don't get snarky about the age of these standards without a proper reason!
Java EE Specifications Survey Results
Now the distribution of the underlying technologies is a bit different in the Java EE world. Perhaps it shows a more monolithic approach or perhaps Java EE developers know better what underlying technologies they use.
JPA is a clear winner here, together with Servlets. No wonder, since almost of the developers we reached in the original report are web app developers, and web apps typically have a database they access and some sort of mechanism that can write the HTML output, aka servlets.
What is more interesting is that a larger proportion of the responses said they use JMS. And approximately the same portion of the respondents use transactions: JTA here, and the Spring Tx in the data above.
So, when you hear someone saying they use Java EE, you can be pretty certain that they use JPA, some bean validation, 1 in three does mess with the EJBs (which are totally not like the EJBs you remember from the nineties).
The CDI usage is surprisingly low, compared to how popular dependency injection is in Spring. JMS is twice as likely to be used, in relative numbers, than in the Spring projects.
What should we make of the data? We can be certain that when people say they use Java EE, they don't actually throw everything and the kitchen sink into their application. So I can believe how their code could be quite lightweight and modern. And when developers say they use Spring, they most probably use the basic pack: the core, spring data, security etc.
Java EE to Spring and Spring to Java EE Migration Statistics
Our final question was about whether you'd abandon your current stack for the alternative. The results are approximately as revolutionary as the next iPhone announcement. Most of the developers would not migrate their stack. Possibly being cautious of the additional work it requires to make the things stable again, or maybe just better the devil you know. However, if we look at the brave ones that would, we can see that most of them are using Java EE currently.
In this short post we looked at the data we gathered in the Spring vs. Java EE survey about which components of these large ecosystems developers actually use. We looked at Spring Framework vs Java EE landscapes separately, and tried not to offer any judgement to avoid creating a new spin of the arguing which is better.
Looking for the latest Java technology usage statistics? Our latest Java survey explores which Java frameworks, IDEs, application servers, and build tools developers use most. See a breakdown from our team, below.
Looking for additional reading on the Java technology? These resources are worth a look.
- White Paper - Full 2021 Java Developer Report
- Blog - Java Web Frameworks Comparison
- Blog - 2021 Java Technology Report
Save Developer Time On Your Project
If you're working with an enterprise Java application, rebuilds and redeploys can take up a significant amount of developer time. JRebel skips redeploys, saving developers a significant amount of time.
See how much time JRebel can save you with a free, 10-day trial.