SlideShare a Scribd company logo
A new way to build microservices
Luram Archanjo
Who am I?
● Software Engineer at Sensedia
● MBA in java projects
● Java and microservice enthusiastic
Agenda
● Microservices
● Java & Frameworks
● Ahead of Time (AOT) Compilation
● GraalVM
● Micronaut
● Questions
Moving to Microservices
Feature A
Feature B
Feature C
Monolith
Microservice Microservice
Microservices
Microservice
Scalability
Feature A
Monolith Scalability
Microservice Microservice
Microservices Scalability
Microservice
Microservice
Microservice
Microservice
Microservice
Microservice
Microservice
Microservice
Feature B Feature C
Feature A Feature B Feature C
Feature A Feature B Feature C
Our resources are finite!
How to use less resources
using Java language?
Our frameworks are design to
low memory footprint?
No, because we’ve tried to
adapt existing legacy
technologies for
Microservices
What do Spring and Jakarta EE undertaking? What are the results about it?
Spring is an amazing technical achievement and does so many things, but does them at Runtime.
● Reads the byte code of every bean it finds.
● Synthesizes new annotations for each annotation on each bean method, constructor, field etc.
to support Annotation metadata.
● Builds Reflective Metadata for each bean for every method, constructor, field etc.
The rise of Java
Microframeworks
Microframeworks
A microframework is a term used to refer to minimalistic web application frameworks:
● Without authentication and authorization
● Without database abstraction via an object-relational mapping.
● Without input validation and input sanitation.
Less modules, functions and
dependencies are not enough!
Ahead of Time (AOT) Compilation
Ahead-of-time compilation (AOT compilation) is the act of compiling a higher-level programming
language, or an intermediate representation such as Java bytecode, into a native machine code so
that the resulting binary file can execute natively.
Web Android
Java
Google Dagger 2
?
uses Ahead of Time (AOT)
Compilation
What are the results of using
Ahead of Time (AOT)
Compilation?
The results of using Ahead of Time (AOT) Compilation
Data from Micronaut website:
● Startup time around a second.
● All Dependency Injection, AOP and Proxy generation happens
at compile time.
● Can be run with as little as 10mb Max Heap.
I don't believe, show me!
Is it possible to improve
more?
Yes, with
GraalVM
GraalVM is an universal virtual machine:
● Runs Java, Scala, Kotlin etc.
● Native image compiled with ahead-of-time improves the startup time and reduce the memory
footprint of JVM-based applications.
GraalVM works well when:
● Little or no runtime reflection is used.
○ Use third party libraries selectively.
● Limited or no dynamic classloading.
Demo
+
What else does Micronaut
do?
Blocking or Non-Blocking HTTP server built on Netty
With a smooth learning curve, Micronaut HTTP server makes it as easy as possible to expose APIs
that can be consumed by HTTP clients.
Blocking
@Controller("/hello")
public class HelloController {
@Get
public String hello() {
return "Hello Micronaut";
}
}
Non-Blocking (RxJava + Netty)
@Controller("/hello")
public class HelloController {
@Get
public Single<String> hello() {
return Single.just("Hello Micronaut");
}
}
Dependency Injection and Inversion of Control (IoC)
This is a similar approach taken by Spring and Google Dagger, but without reflection and proxies.
All the injections are done in compile time.
@Singleton
public class HelloService {
public String hello() {
return "Hello Micronaut";
}
}
@Controller("/hello")
public class HelloController {
@Inject
private HelloService helloService;
@Get
public String hello() {
return helloService.hello();
}
}
Cloud Native Features
Distributed Tracing
When operating Microservices in production it can be challenging to troubleshoot interactions
between Microservices in a distributed architecture. Micronaut features integration with both Zipkin
and Jaeger (via the Open Tracing API).
@Controller("/hello")
public class HelloController {
@Inject
private HelloService helloService;
@Get("/{name}")
@NewSpan("hello")
public String hello(@SpanTag String name) {
return helloService.hello();
}
}
Serverless Functions
Serverless architectures where as a developer you deploy functions that are fully managed by the
Cloud environment and are executed in ephemeral processes require a unique approach.
@FunctionBean("hello-function")
public class HelloFunction implements Supplier<String> {
@Override
public String hello() {
return "Hello world";
}
}
@FunctionClient
public interface HelloFunctionClient {
String hello();
}
Summary
2º Place
1º Place
3º PlaceAhead of Time (AOT)
Compilation
● Low memory
footprint
● Fast Startup
● IoC
● Productivity with
annotations
● Blocking or Non-
Blocking HTTP
server built on
Netty
Cloud Native Features
● Service Discovery
● Distributed
Tracing
● Serveless
● Distributed
Configuration
Thanks a million!
Questions?
/larchanjo
/luram-archanjo

More Related Content

What's hot (20)

PDF
Curso node.js
Redradix
 
PPTX
REST vs gRPC: Battle of API's
Luram Archanjo
 
PDF
Introduction to gradle
NexThoughts Technologies
 
PDF
Solid NodeJS with TypeScript, Jest & NestJS
Rafael Casuso Romate
 
PDF
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Nikhil Thomas
 
PDF
Docker by Example - Basics
Ganesh Samarthyam
 
PDF
Amazon EKS - security best practices - 2022
Jean-François LOMBARDO
 
PDF
Nodejs presentation
Arvind Devaraj
 
PDF
CI/CD with Github Actions
Md. Minhazul Haque
 
PPTX
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
태준 문
 
PDF
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
NAVER LABS
 
PPTX
Workshop Spring - Session 1 - L'offre Spring et les bases
Antoine Rey
 
ODP
Git vs svn
Suman Mukherjee
 
PDF
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
PDF
Introduction to Github Actions
Knoldus Inc.
 
PPTX
REST API 설계
Terry Cho
 
PPTX
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Vietnam Open Infrastructure User Group
 
PDF
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
PDF
Keystone at openstack multi sites
Vietnam Open Infrastructure User Group
 
PPTX
Discover Quarkus and GraalVM
Romain Schlick
 
Curso node.js
Redradix
 
REST vs gRPC: Battle of API's
Luram Archanjo
 
Introduction to gradle
NexThoughts Technologies
 
Solid NodeJS with TypeScript, Jest & NestJS
Rafael Casuso Romate
 
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Nikhil Thomas
 
Docker by Example - Basics
Ganesh Samarthyam
 
Amazon EKS - security best practices - 2022
Jean-François LOMBARDO
 
Nodejs presentation
Arvind Devaraj
 
CI/CD with Github Actions
Md. Minhazul Haque
 
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
태준 문
 
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
NAVER LABS
 
Workshop Spring - Session 1 - L'offre Spring et les bases
Antoine Rey
 
Git vs svn
Suman Mukherjee
 
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
Introduction to Github Actions
Knoldus Inc.
 
REST API 설계
Terry Cho
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Vietnam Open Infrastructure User Group
 
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
Keystone at openstack multi sites
Vietnam Open Infrastructure User Group
 
Discover Quarkus and GraalVM
Romain Schlick
 

Similar to Micronaut: A new way to build microservices (20)

PDF
Spring Boot 3 And Beyond
VMware Tanzu
 
PDF
Introduction to Micronaut at Oracle CodeOne 2018
graemerocher
 
PDF
Javascript as a target language - GWT KickOff - Part 2/2
JooinK
 
PDF
Introduction to Micronaut - JBCNConf 2019
graemerocher
 
PDF
Spring Update | July 2023
VMware Tanzu
 
PDF
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
Michael Redlich
 
PDF
GraalVM Native and Spring Boot 3.0
MoritzHalbritter
 
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Jakarta_EE
 
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
The Eclipse Foundation
 
PDF
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Fabio Tiriticco
 
PPTX
1.INTRODUCTION TO JAVA.pptx bggwudufwydwuwguwuywuwudgjxbjasgu
yashsharmaa0209
 
PDF
Counterclockwise past present future
lolopetit
 
PDF
TechEvent Graal(VM) Performance Interoperability
Trivadis
 
PPTX
Microservice Workshop Hands On
Ram G Suri
 
PPT
1.INTRODUCTION TO JAVA_2022 MB.ppt .
happycocoman
 
PDF
Peru JUG Micronaut & GraalVM
Domingo Suarez Torres
 
PPTX
Ultimate Guide to Microservice Architecture on Kubernetes
kloia
 
PDF
GWT - Building Rich Internet Applications Using OO Tools
barciszewski
 
PDF
Introduction to Performance APIs
Shogo Sensui
 
PDF
Red Hat Java Update and Quarkus Introduction
John Archer
 
Spring Boot 3 And Beyond
VMware Tanzu
 
Introduction to Micronaut at Oracle CodeOne 2018
graemerocher
 
Javascript as a target language - GWT KickOff - Part 2/2
JooinK
 
Introduction to Micronaut - JBCNConf 2019
graemerocher
 
Spring Update | July 2023
VMware Tanzu
 
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
Michael Redlich
 
GraalVM Native and Spring Boot 3.0
MoritzHalbritter
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Jakarta_EE
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
The Eclipse Foundation
 
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Fabio Tiriticco
 
1.INTRODUCTION TO JAVA.pptx bggwudufwydwuwguwuywuwudgjxbjasgu
yashsharmaa0209
 
Counterclockwise past present future
lolopetit
 
TechEvent Graal(VM) Performance Interoperability
Trivadis
 
Microservice Workshop Hands On
Ram G Suri
 
1.INTRODUCTION TO JAVA_2022 MB.ppt .
happycocoman
 
Peru JUG Micronaut & GraalVM
Domingo Suarez Torres
 
Ultimate Guide to Microservice Architecture on Kubernetes
kloia
 
GWT - Building Rich Internet Applications Using OO Tools
barciszewski
 
Introduction to Performance APIs
Shogo Sensui
 
Red Hat Java Update and Quarkus Introduction
John Archer
 
Ad

Recently uploaded (20)

PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Ad

Micronaut: A new way to build microservices

  • 1. A new way to build microservices Luram Archanjo
  • 2. Who am I? ● Software Engineer at Sensedia ● MBA in java projects ● Java and microservice enthusiastic
  • 3. Agenda ● Microservices ● Java & Frameworks ● Ahead of Time (AOT) Compilation ● GraalVM ● Micronaut ● Questions
  • 4. Moving to Microservices Feature A Feature B Feature C Monolith Microservice Microservice Microservices Microservice
  • 5. Scalability Feature A Monolith Scalability Microservice Microservice Microservices Scalability Microservice Microservice Microservice Microservice Microservice Microservice Microservice Microservice Feature B Feature C Feature A Feature B Feature C Feature A Feature B Feature C
  • 7. How to use less resources using Java language?
  • 8. Our frameworks are design to low memory footprint?
  • 9. No, because we’ve tried to adapt existing legacy technologies for Microservices
  • 10. What do Spring and Jakarta EE undertaking? What are the results about it? Spring is an amazing technical achievement and does so many things, but does them at Runtime. ● Reads the byte code of every bean it finds. ● Synthesizes new annotations for each annotation on each bean method, constructor, field etc. to support Annotation metadata. ● Builds Reflective Metadata for each bean for every method, constructor, field etc.
  • 11. The rise of Java Microframeworks
  • 12. Microframeworks A microframework is a term used to refer to minimalistic web application frameworks: ● Without authentication and authorization ● Without database abstraction via an object-relational mapping. ● Without input validation and input sanitation.
  • 13. Less modules, functions and dependencies are not enough!
  • 14. Ahead of Time (AOT) Compilation Ahead-of-time compilation (AOT compilation) is the act of compiling a higher-level programming language, or an intermediate representation such as Java bytecode, into a native machine code so that the resulting binary file can execute natively. Web Android Java Google Dagger 2 ?
  • 15. uses Ahead of Time (AOT) Compilation
  • 16. What are the results of using Ahead of Time (AOT) Compilation?
  • 17. The results of using Ahead of Time (AOT) Compilation Data from Micronaut website: ● Startup time around a second. ● All Dependency Injection, AOP and Proxy generation happens at compile time. ● Can be run with as little as 10mb Max Heap.
  • 18. I don't believe, show me!
  • 19. Is it possible to improve more?
  • 21. GraalVM GraalVM is an universal virtual machine: ● Runs Java, Scala, Kotlin etc. ● Native image compiled with ahead-of-time improves the startup time and reduce the memory footprint of JVM-based applications. GraalVM works well when: ● Little or no runtime reflection is used. ○ Use third party libraries selectively. ● Limited or no dynamic classloading.
  • 23. What else does Micronaut do?
  • 24. Blocking or Non-Blocking HTTP server built on Netty With a smooth learning curve, Micronaut HTTP server makes it as easy as possible to expose APIs that can be consumed by HTTP clients. Blocking @Controller("/hello") public class HelloController { @Get public String hello() { return "Hello Micronaut"; } } Non-Blocking (RxJava + Netty) @Controller("/hello") public class HelloController { @Get public Single<String> hello() { return Single.just("Hello Micronaut"); } }
  • 25. Dependency Injection and Inversion of Control (IoC) This is a similar approach taken by Spring and Google Dagger, but without reflection and proxies. All the injections are done in compile time. @Singleton public class HelloService { public String hello() { return "Hello Micronaut"; } } @Controller("/hello") public class HelloController { @Inject private HelloService helloService; @Get public String hello() { return helloService.hello(); } }
  • 27. Distributed Tracing When operating Microservices in production it can be challenging to troubleshoot interactions between Microservices in a distributed architecture. Micronaut features integration with both Zipkin and Jaeger (via the Open Tracing API). @Controller("/hello") public class HelloController { @Inject private HelloService helloService; @Get("/{name}") @NewSpan("hello") public String hello(@SpanTag String name) { return helloService.hello(); } }
  • 28. Serverless Functions Serverless architectures where as a developer you deploy functions that are fully managed by the Cloud environment and are executed in ephemeral processes require a unique approach. @FunctionBean("hello-function") public class HelloFunction implements Supplier<String> { @Override public String hello() { return "Hello world"; } } @FunctionClient public interface HelloFunctionClient { String hello(); }
  • 29. Summary 2º Place 1º Place 3º PlaceAhead of Time (AOT) Compilation ● Low memory footprint ● Fast Startup ● IoC ● Productivity with annotations ● Blocking or Non- Blocking HTTP server built on Netty Cloud Native Features ● Service Discovery ● Distributed Tracing ● Serveless ● Distributed Configuration

Editor's Notes

  • #5: A praticamente 5 anos a arquitetura de microservices vem sendo adotada por inúmeros fatores como: 1 - Manutenibilidade 2 - Heterogeneidade Tecnologica 3 - Paralelismo de times 4 - Escalabilidade Em outros fatores. Eu acabei de citar um termo que é uns dos principais fatores da adoção da arquitetura de microservices que é… próximo slide
  • #6: Estamos gerenciando melhor nossos recursos, pois conseguimos escalar separadamente módulo\microservice que necessite.
  • #7: Nossos recursos são finitos..e continuamos sendo cobrados por melhoria de utilização de recursos
  • #8: E como melhorar a utilização de recursos utilizado a liguagem java? Java 9 > Modules Java 10 > Java 11 >
  • #9: Antes de falar da linguagem, será que nossos frameworks foram desenhados para baixo consumo de memória?