|Micronaut 3. 2 Released for More Performant Microservices
|Written by Nikos Vaggalis
|Wednesday, 22 December 2021
Micronaut, the JVM-based polyglot framework for building microservices applications in Java, Kotlin and Groovy has reached version 3. 2. Before we look at what's new, let's first take a look at what the framework does differently.
Yes, there's other options of going Microservices than the combination of Spring Boot and Spring Cloud. Helidon, Dropwizard, Microprofile and Quarkus are some of those options. And there's Micronaut.
Spring of course is a monumental piece of technology;a versatile framework that does a lot under the covers to boost developer productivity. That magic comes with a drawback however. The magic Spring pulls is happening at runtime, analyzing your code and the annotations, injecting beans, etc thus using a lot of runtime loading as well as Reflection under the hood. And with bloated runtime comes an upshot on memory usage and of course startup time. The usual recipe of those stacks against performance hampering is caching but that comes with even more memory load.
Micronaut which gives you the same productivity boon as Spring, since the notion and code written against it are very similar, which of course make the transition a straightforward endeavor by providing the same dependency injection, inversion of control (IOC), and Aspect-Oriented Programming (AOP) but with massive memory and startup time savings at the same time.
The underlying technology was already there, on Android. The pointers of course is on the Ahead Of Time Compilation, a technique which determines what the application is going to need at compile time in order to avoid reflection completely thus keeping memory requirements down and performance up by doing more things at compile time than at runtime.
Now it was time for others to pick the concept up and adapt it to the requirement of the Cloud, which is exactly what Micronaut did. Micronaut is a generic application framework, so it can be used to build not just microservice applications but also other kinds like event-driven ones, that generates additional code at compile-time to implement things like dependency injection and avoiding runtime proxies. The trade-off is slower build time vs. faster runtime.
To take it a step further Micronaut plays well along GraalVM, the runtime that compiles Java bytecode into native self-contained executables, under which it can create native images which can reduce the start up time to miliseconds up to 100x faster than when running on the JVM. Of course by giving up platform portability since the image made is machine specific.
A glimpse at its advantages can be found in the Micronaut Data project description, the database access toolkit that uses Ahead of Time (AoT) compilation to pre-compute queries for repository interfaces that are then executed by a thin, lightweight runtime layer
The major release v3 of the framework was in August and in November 23 there was another inportant update to v3. 2. Let's take a quick look at what 3. 2 included:
Many modules upgrades:
Of course, Micronaut comes with reactive extensions and runtime support for the following backends:
SQL (JDBC, R2DBC)
Check this example for Hibernate..
or email your comment to: email@example.com
|Last Updated ( Wednesday, 22 December 2021 )