This article briefly describes three major frameworks which can be used for developing microservices using Java.
Spring Boot
Spring Boot, based on the Spring Framework, is the most popular java framework for developing microservices. Spring Boot can be used to conveniently implement applications that offer critical features for productive operation, such as health checks or a wide range of configuration options. Spring Cloud is a collection of modules that extends Spring Boot with functions specifically for the cloud. These functions include service discovery, distributed tracing or an API gateway. In addition to Spring Cloud, there is also Spring Cloud Netflix, which makes open source projects from Netflix usable in Spring Boot applications.
Those who know and use the Spring framework are inclined to use Spring Boot for microservices because the underlying framework is already known. Micronaut and MicroProfile are heavily influenced by Spring, so Spring-savvy developers should easily get along with these frameworks as well.
Advantages:
- Wide distribution, community and install base
- Largest feature set
- Extensive documentation ( reference, books, stackoverflow).
Disadvantages:
- Complexity of the ecosystem
- No standard
- Not all features work together flawlessly or configuration requires time-consuming customization. For example, in certain versions, simultaneous use of Service Discovery and Cloud Config did not work
Micronaut
Micronaut is developed at objectcomputing by the developers of the Grails Framework. The experience gained with Grails has been incorporated into the architecture of the Micronaut framework. Like Grails, Micronaut is a fullstack framework, but it is designed for microservices rather than web applications.
Micronaut uses dynamic features like proxies and reflection sparingly to optimize application startup times and footprint.
Most of Micronaut's guides and examples are multilingual in Groovy, Java, and Kotlin. Those who like to develop microservices with Kotlin should shortlist Micronaut.
Advantages:
- Code generator for the command line
- Good support for Kotlin
- Compact and powerful
- Support for native Java images
Disadvantages:
- No standard
- Low distribution
MicroProfile
While Spring Boot and Micronaut are concrete projects, the Eclipse MicroProfile is a standard for which several products from different vendors are available.
The MicroProfile supplements the standards of the Java Enterprise Edition by further functions, which are particularly interesting for Microservices. As the name implies, the MicroProfile is a profile, i.e. a collection of standards provided by implementations. If developed against the profile, one can rely on the runtime environments to already contain all the libraries and functions needed. This enables the creation of smaller applications, since they do not have to supply the libraries.
On the market there is a whole set of MicroProfile implementations. The user is not dependent on a manufacturer. The table below lists some open source implementations of the MicroProfile.
Project | Manufacturer | License |
---|---|---|
Helidon | Oracle | Apache License 2 |
Helidon | Oracle | Apache License 2 |
Quarkus | JBoss / Red Hat / IBM | Apache License 2 |
OpenLiberty | IBM | Eclipse Public License 1.0 |
KumuluzEE | Sunesis Ltd. aus Slowenien | MIT |
Payara | Payara Foundation | Common Development and Distribution Licence |
Jemo | Eclipse Foundation | Eclipse Public License 2.0 |
Advantages:
- The MicroProfile is a standard
- There is competition between server vendors.
- Has learned from the disadvantages of Spring and tries to avoid them.
- Provides support for native Java images
Disadvantages:
- The standardization process slows down innovation
- Standards are not yet complete. For example, service discovery is missing.
- The (still) low penetration