Hello Micronaut: Emerging Polyglot Enterprise Framework

source: micronaut.io

Hello folks. In this article, let us explore the new emerging JVM based, open source polyglot framework Micronaut which was developed by OCI, the creator of Grails. Before getting into our article, let us discuss a little bit about why we need a new framework for JAVA and how Micronaut suits as a good option.

Why Micronaut?

As we all are familiar with the fact that Java was one of the most preferred programming language for building enterprise applications. Post the cloud revolution, Most of the organization adopts Microservice based architecture over monolithic for building applications. Apart from many benefits offered by this paradigm shift, one of the pitfall in this approach is that microservices needed to be bundled into fat jars and then these jars need to run into containers which require additional memory to operate. This is where our beloved Java fails to fit perfectly for building these cloud native applications as the startup time and the memory required to run the Java applications would be higher as we deploy more microservices. This is where Micronaut comes into picture as this new framework was designed to offer lower memory footprint and faster startup time for the applications.

source: micronaut.io

Now let us discuss how micronaut solves our issue and what other benefits the framework offers for its developers.

Compile Time Dependency Injection

Most of the traditional frameworks use reflection and proxies to perform dependency injection at run time. But Micronaut, which was designed for microservices and stateless applications in mind, comes up with AOP ( Aspect Oriented Programming) API which performs dependency injection at compile time rather than run time. This unleashes the possibility of achieving low memory footprint and amazingly fast boot time for the micronaut applications.

Being Reactive

Experts defines Reactive Programming as a programming paradigm that uses an asynchronous, non-blocking, event-driven approach to process data.

source: developers.redhat.com

Micronaut offers excellent support on reactive programming for both clients and servers. It also offers developers the choice of using either Rx Java or Project Reactor for their reactive implementation.

HTTP Server

Let’s say we are implementing a REST/HTTP based microservice architecture for an application, where one can define the microservice’s end points as REST APIs which can be consumed by REST clients in other microservices and so on. It is important to notice that the exposing/consuming services over HTTP plays a vital part in a microservice architecture. Micronaut’s HTTP server was built on NETTY, an asynchronous event-driven networking framework that guarantees high performance support for both server and client applications.

Cloud Native

As we all know that the cloud-native applications were designed specifically to operate in a cloud-computing environment. Micronaut comes with built-in cloud support which makes building cloud native applications quite easier. The features offered includes support for service discovery, distributed tracing tools, client side load balancing, fault tolerance and so on.

source: micronaut.io

Apart from the features discussed, Micronaut also supports features like auto configuration for data access, endpoint management, security, support for batch jobs, native compilation and much more. Micronaut also comes with excellent documentation and vibrant community support.

Cloud-native development is definitely here to stay, and Micronaut is the latest example of a framework that was designed with this landscape in mind. This new emerging framework sounds promising and will have a significant impact on microservice development in near future.

Related Links