If you have fallen for the hype that Java is going to retire, don’t jump to conclusions right away. Sure, some modern languages may be superior to Java in many ways, even in its primary uses. But Java is initially a great solution, rightly deserving of its colossal popularity and respect from professionals around the world. This is why Java development is actively ongoing, improving and extending its capabilities while third-party teams offer their own frameworks.
Today we discuss two frameworks, Spring Boot and Quarkus, and more specifically, who needs them and why. Let's compare Spring Boot vs Quarkus in terms of feature set, performance metrics, average development cost, market popularity, and other important aspects. This article will help you decide whether Spring Boot or Quarkus is better for your applications and more worth learning.
What Is Spring Boot
Let's pay tribute to the oldies. Spring Boot is the open-source Java-based framework supporting Java, Kotlin and Groovy, and JIT compilation, making it much easier to create, configure and run microservices enterprise web applications.
Its first version was released back in 2002 with the Apache 2.0 license. Since then, it has managed to develop a huge number of extensions, which simplify, improve or extend standard solutions for designing, writing, and maintaining enterprise-level applications.
Spring Boot features
Spring Boot is a part of the Spring Framework that allows you to use all the features of the Spring Framework, makes it easier to deploy and configure Spring applications, reduces the amount of code, and increases the speed of going to production. This is possible due to the automatic configuration of the application built on Java Annotations.
Here are some of the features of the Spring Framework you can use in your Spring Boot application:
- Inversion of control container offers a solution for configuring and controlling Java objects by linking them together. The main advantage is that such container-managed objects, known as beans, avoid creating XML files with prescribed configurations for them. However, it is possible to do everything manually and add them.
- The aspect-oriented programming framework adds the opportunity to program in an aspect-oriented paradigm, doing things that in an object-oriented paradigm are either too performance costly or not possible at all.
- The Model-view-controller framework using Serverlet API allows developing in an MVC pattern, simplifying the creation of micro-services applications, which is not as easy to do with standard Java tools as most developers would like.
- The Data Access framework using JDBC and ORM provides a solution for easy and rapid work with relational databases and NoSQL. It allows you to create an object interface to the database without writing code, and this feature makes it one of the favorites and most powerful frameworks on this list.
- The Batch framework offers a large set of out-of-the-box features for managing batches more efficiently, distributing the development of large amounts of data into smaller volumes that can also be chained together. These features are logging/tracing, transaction management, job processing statistics, and job restart.
- The Transactional management framework adds abstraction and allows you to work with local transactions without a server. Of course, working with global, nested, and savepoints is also possible. All this can be done without JTA or EJB, if used in conjunction with the previously mentioned Data access framework. However, of course, there are several ways for transactions, for example, using JDBC Connection, Object-relational mapping Units of Work, JTA TransactionManager and UserTransaction, and others like object databases.
- The Remote access framework using RPC introduces a level of abstraction for an easier and more efficient way of handlingobjects on servers. Thanks to the common use of the previously mentioned Inversion of control container and aspect-oriented programming framework as the main tool to interact with it.
- The Authentication and authorization framework provides many protocols and standards and uses the Spring Security subproject for authorization and authentication options.
- The Integration framework offers a set of out-of-the-box reusable functions for messaging, architecture compatibility, and event management. It offers routers, transformers, and adapters like AMQP, JMS, XMPP, SMTP, IMAP, FTP/FTPS/SFTP, filters, service activators, etc.
- The Testing framework offers functions and modules for unit and integration tests.
As you might have noticed, the Spring Boot team hasn't lost a minute during these 20 years judging even by the core set of modules. That's why many universal solutions use this framework. However, since we are comparing it with Quarkus, we are more interested now in its functionality related to containerization and microservices handling. Let's see what this newer solution has to offer for this.
What Is Quarkus
Quarkus is an open-source Java framework that supports Java, Kotlin, and Scala and provides AOT compilation. It was created to simplify the development and deployment of Java applications in containers like Docker and Kubernetes, as well as to create microservice Java applications with minimal consumption of resources.
Quarkus is very young, since it was founded in 2019. But it is actively developing with the same Apache 2.0 license and is very much to the liking of many because it lives up to its purposes very well. It is easy to use and significantly less demanding on the hardware resources to run applications.
The initial focus on working with containers, especially Kubernetes, is valued by many developers and companies. Also, Quarkus doesn't initially aim to develop its own framework for everything, as Spring did. Instead, they actively work to maximize integrations and effectively support other already reputable frameworks and services.
- Imperative and reactive programming became available for full use.
- Support of OpenJDK HotSpot and GraalVM allows you to compile code natively for containers and not run JVM inside them, greatly reducing the number of resources consumed. In the case of Linux and Kubernetes containers, the Quarkus application runs as a native Linux executable.
- Live coding offers the concept and implementation of automatic code deployment within a container, eliminating several traditional processes that make development longer and can cause problems. Instead of Write Code/Compile/Deploy/Refresh Browser/Repeat, the process will look like Write Code/Refresh Browser/Repeat.
- Zero configuration with dev services. Quarkus provides dev services that automatically start and configure the database when you develop or test your applications.
- The DEV UI from Quarkus is a command line-driven interactive developer interface where developers can quickly and easily get dependency updates, update configurations, and synchronize them.
- Continuous testing in Quarkus is implemented on the command line and using the DEV tool, doing it right during development, eliminates a lot of third-party tools and side processes for it.
- Based on the best standards like JAX-RS, Java Persistence API (JPA), Java Transaction API (JTA), Apache Camel and Hibernate, and several others.
It's important to understand that Quarkus is still just at the beginning of its journey, but it's already making great progress and, most importantly, meeting expectations. Now, having learned about the main technical aspects, let's look at the numbers.
Comparing Quarkus and Spring Boot
From the start, comparing these frameworks may not be entirely relevant, but it is necessary. On the one hand, they are in completely different weight categories. You could say Spring has earned the title of an alternative Java standard, redefining all standards up to JavaBeans. It has its own solution for all cases, which are incredibly good and work great together. Quarkus, on the other hand, is just getting started. But using reactive programming, AOT compilation, and the container-first approach has already shown amazing results, which is why it sparked discussions around itself as the heir to the throne.
One should not replace the other, at least not in the short term. Those are different approaches to solving issues; each has earned its place. Obviously, if you see something critical to your business in the list of main technical features offered, you already roughly know your choice.
But take your time. In addition to the theory, you need to look at the practical aspects of each solution, which are best expressed in numbers.
Spring Boot vs Quarkus performance
Generally speaking, we can immediately declare a winner when talking about performance and memory consumption. Still, everything is not quite clear, depending on whether we are comparing Spring Boot and Quarkus using JVM or Native.
|SPRING BOOT JVM
|SPRING BOOT NATIVE
|Startup time (sec)
|Build artifact time (sec)
|Artifact size (MB)
|CPU usage max (%)
|CPU usage average (%)
|Heap size startup (MB)
|Used heap startup (MB)
|Used heap max (MB)
|Used heap average (MB)
|RSS memory startup (MB)
|Requests per second
According to the test data, Quarkus is often better than Spring Boot, not only in the case of Native, where it should be better because it was initially designed for this approach, but even when using JVM, except for a couple of points.
- Startup Time, as promised by Quarkus, is faster than Spring Boot in all cases.
- Build Artefact Time in the case of using the JVM is significantly longer than Spring Boot. All in all, this is not surprising since, as was said before, good JVM handling and JIT compilation as the primary approach is more of Spring Boot's strong point.
- Artifact Size in the case of using JVM is again better than Spring Boot, though not by such a large margin.
- Loaded Classes is better than Quarkus even with the JVM but with Native by a good margin.
- CPU Usage Average is again better than Quarkus, both with JVM and Native.
- Heap Size Startup, in the case of JVM, Spring Boot performed better than Quarkus again.
- Used Heap Startup showed us that Spring Boot has something to surprise us in the case of Native as well because it took significantly less memory than Quarkus. And Quarkus, on the other hand, was better with the JVM.
- Used Heap Max also showed a little bit better than Spring Boot, especially in the case of Native.
- Used Heap Average performed better with Quarkus in the JVM, and Spring Boot performed better with Native.
- RSS Memory Startup, we see the expected victory of Quarkus in both JVM and Native cases.
- Max Threads, we notice less resource usage by Quarkus, both JVM and Native.
- Request Per Second is lower in Spring Boot in JVM, but in Native, it is lower in Quarkus.
As we said, everything is not as clear-cut as we would like, but we can catch the trend. Quarkus consumes fewer resources for running an application in almost every case when we talk about Native and sometimes in JVM. Spring Boot may perform better after application startup, especially with the JVM. It is also worth noting that support for native code was originally built into the Quarkus architecture, while Spring is in an experimental version. This fully explains the separation of Quarkus when working as a native application.
Spring Boot vs Quarkus Popularity
Of course, Spring Boot remains much more popular than Quarkus. We can say that most developers and companies mean Spring Boot when they develop enterprise Java applications. And likely, this will continue for a long time in the enterprise environment, where you need stable, tested, and complex solutions, like Spring Boot.
However, Quarkus is rapidly gaining popularity, especially in cases with Kubernetes, providing much lower resource consumption. All this is also important for businesses because resource consumption has to be paid for. Naturally,owners want to reduce it, which Quarkus does very well. Also, many developers and companies are starting to see it as the future because it makes development much easier and stays based on industry standards, unlike Spring Boot, which has redesigned all the standards.
We can conclude here that Spring Boot holds well-deserved popularity as a complete, universal solution for any task right out of the box and to use this in very large and busy enterprise environments. Quarkus is actively gaining it in business solutions, where a standalone solution, resource reduction, and excellent container handling are important. Quarkus performs well because it was originally designed as a native solution and special attention to Doker and Kubernetes.
Spring Boot vs. Quarkus Development Cost
Which one would be cheaper to develop with? This is quite a complicated question because you have to consider many factors, from the cost of developers to the complexity and duration of the project. Let's first try to figure out the cost of developers.
In the case of Spring Boot, it's not hard to find information. According to GlassDoor, the average salary of a Spring Boot developer in the United States is about $92,000 per year. Of course, this figure can vary greatly depending on experience and location, which may be helpful to you.
Quarkus developer costs, on the other hand, aren't that obvious since there aren't that many of them, and there's not much data on resources like GlassDoor. But for most jobs, the compensation starts at $100,000. And finding those who have already thoroughly learned and switched their specialization to Quarkus can be a challenge for your HR department.
Now let's look at the speed of development. Here everything is not so unambiguous. Spring Boot offers many quality out-of-the-box solutions, which noticeably speed up the development of microservices applications. However, Quarkus also greatly speeds up development due to features like Live coding, Dev UI, and very convenient and simplified handling of Kubernetes containers. Thus, the development speed of large and complex enterprise applications will be much faster on Spring Boot and much cheaper. But development on Quarkus may be cheaper in more specialized cases, especially with Kubernetes containers.
Moreover, the speed of development is strongly influenced by good documentation. Here it is worth noting that Spring Boot documentation is very rich, but surfing the forums, you may find concerns that it is not always up-to-date and may not keep up with the actual functions of the product.
In addition to the documentation, there's also a diverse Spring Boot community, which gives an answer to any question. Quarkus, on the other hand, of course, cannot yet boast such a huge community, although it is already quite large and very responsive.
All this, to some extent, affects the speed of development and, therefore, the final cost of development. And with a lot of nuances, we can say that development on Spring Boot is probably going to be cheaper in most cases.
Spring Boot vs. Quarkus Pros and Cons
Let's highlight each framework's main pros and cons to simplify the choice for those who do not want to get too deep into the numbers.
Spring Boot Pros
- Offers many solutions for automating the configuration of dependencies, objects, and containers, as well as out-of-the-box configurations solutions for just run.
- Performs better with JVM, where JIT compilation is handier.
- Provides an aspect-oriented programming capability.
- Кelies on the JIT compilation and can show better results under heavy load.
- A time-tested, deservedly beloved, and respected framework for developers and the entire enterprise industry.
- A huge community knows the answer to any question and is ready to provide it.
- Development can be much faster and cheaper in most cases.
Spring Boot Cons
- With an abundance of their own solutions, less control, and options for integrations
- More demanding on resources when running or building.
- Lots of internal dependencies between modules can also create complexity and require more resources to handle.
- Significantly simplifies and promotes work with containers, especially Kubernetes, allowing developers to avoid redundant processes in configuration and deployment.
- Reduces resource usage by using Graal or Substrate VM for autonomous native builds.
- Offers both imperative and reactive programming capabilities.
- Relies on AOT compilation and can run and work faster, using fewer resources.
- Lower space requirements for native images.
- Excellent, always up-to-date comprehensive documentation and actively growing support from the community and leading tech companies.
- Focuses on quality support for third-party integrations.
- Initial installation of Graal VM can be complex for some developers.
- Not as large a base of specialized developers, less choice, and possibly longer searches for suitable candidates.
- Development can be more expensive and slower compared to Spring Boot.
Of course, you can use any of these frameworks for most tasks, but each solution has advantages and disadvantages. So you need to decide which ones are important for your project. You can also look at other frameworks whose key advantages may suit you better than both of the previous solutions.
Spring Boot and Quarkus Alternatives
If you are not satisfied with Spring Boot or Quark, you may consider other alternatives such as:
If you are unsure what to choose, you can tell us about your project during a free consultation. Our Delivery Managers will carefully consider your case and offer the most suitable and profitable solution for the launch and growth of your business.
Micronaut is a Java-based framework that supports languages like Java, Kotlin, Groovy, and AOT compilation. Its main goal is to provide better performance and less resource consumption.
Micronaut is still young, founded in 2018 and published under the Apache 2.0 license, making its community active but not yet very large.
Knative is an open-source PaaS for enterprise-level serverless application development and automated deployment and scaling in Kubernetes.
Dropwizard is a Java-based framework for fast bootstrapping of Java REST services. It provides several other frameworks and support for Java libraries that will help make creating, running, and deploying your application much easier.
One of the well-known sponsors is JetBrains, which makes excellent IDEs for a variety of developers and also fully supports this framework on its platform.
In conclusion, both frameworks are awesome. No matter what you choose, you will be able to achieve your goals with the best quality. The only difference is how comprehensive or specialized your solution is and whether you prioritize the application's speed or development itself. And, of course, what key technical solutions are crucial to your project.