SlideShare a Scribd company logo
1 of 39
Download to read offline
Introduction to Micronaut
About Me
• Graeme Rocher
• Creator of Grails and Micronaut
• Principal Engineer at Object Computing
• Oracle Groundbreaker Award Winner
• Based in Pais Vasco
Agenda
• Challenges Facing Java and Software in General
• Microservces and Serverless vs. Traditional Models
• Micronaut Demos!
• Q & A!
Serverless
Challenges
• Challenges to using Java in
Serverless / Microservices scenarios
• Existing Tools and Frameworks Not
Optimized for Cold Starts / Low
Memory
• Go, Node etc. better in this regards
• Tim Bray (Amazon/AWS) and others
not recommending Java
https://youtu.be/IPOvrK3S3gQ?t=1109
Adapting to Serverless
• Optimize for cold starts
• Forget about connection pools
• Don't bother with local caches
• Choose technology based on your cold start requirements
Adapting to
Microservices
• Cold starts less important, but still
important
• The Container is the deployment
unit
• Containers and Java require special
memory management
• Optimization for memory usage
required
Traditional Frameworks
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.
What to do, What to
do?
1. Tough technology decisions ahead
2. Choose appropriately tool for the
job
3. Traditional frameworks often not the
best choice
The Micro Reality
• Frameworks based on reflection
and annotations become fat
• But we love the programming
model and productivity so
we live with it
• So ... why should we be
more efficient?
Java's Problems for
Frameworks
• Limited Annotation API
• Type Erasure
• Slow Reflection
• Reflective Data Caches
• Classpath Scanning
• Slow Dynamic Class Loading
Imagine if
Kubernetes or Docker
had been written in
Spring or Jakarta EE
instead of Go?
Why is Reflection a Problem?
• Today the JDK is OpenJDK!
• Just take a look...
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/
share/classes/java/lang/Class.java#l2471
• All Reflective data initialized on first access and held in soft
references (yes every field, method etc.)
• Won't be GC'ed until your application is low on memory!
Java's "Problems"
• Greatly Exaggerated (Java has been
dead forever)
• Java can be Fast! (see Android and
Micronaut)
• However Most Existing Tools are
based around
• Reflection
• Runtime Proxies
• Runtime Byte Code Generation
(bytebuddy/cglib/javassist)
Java's Advantages
• Mature, Robust Ecosystem
• Outstanding IDEs
• Code Maintenance and Refactoring
• Developer Availability
• Build System Maturity
• Diversity (Mobile, IoT, Server Side)
• Languages (Java, Kotlin, Groovy,
Scala)
By the time Go has all
the features of Java,
Java's startup
performance will
match Go
Already Solved
Problem
• The Android Community already
solved the problem
• Ahead of Time Compilation used
extensively
• Google Dagger 2.x
• Compile Time Dependency
Injector
• Reflection Free
• Limited in Scope to just DI
Ahead of Time
Compilation
• So what is Ahead of Time (AOT)
compilation?
• Pre-computation of application code
using closed world static analysis
• Fancy way of saying do more at
compilation time
and less at runtime
Micronaut is...
• A Microservices and Serverless
Focused framework (hence the
branding)
• Also a Complete Application
Framework for any type of
Application
• Dependency Injection, Aspect
Oriented Programming (AOP),
Configuration Management,
Bean Introspection and more..
Micronaut AOT
Computation
• All Dependency & Configuration
Injection
• Annotation Metadata (Meta
annotations)
• AOP Proxies
• Essentially all framework
infrastructure
• ie. What Spring/CDI do at runtime
With Micronaut You
Can Build
• Microservices
• Serverless Applications
• Message-Driven Applications with
Kafka/Rabbit
• CLI Applications
• Even Android Applications
• Anything with
static void main(String..args)
So What is
Micronaut? Really?
• An Application Framework for the
Future
• Reflection Free, Runtime Proxy Free,
No Dynamic Classloading
• Ahead of Time (AOT) Compilation
AOT APIs
• ... oh and let's you build
Microservices
Micronaut's Impact
• We announced Micronaut on March
2018
• Open Sourced 28th of May 2018 (a
year ago!)
• Sparked industry wide
improvements from Red Hat (with
Quarkus) and Pivotal (Spring Boot
2.2)
• Micronaut is changing the face of
server side Java
GraalVM
• A New Universal Virtual Machine
from Oracle
• Features a native-image Tool
• Converts Java -> native machine
code using AOT
• Works well with Micronaut
• Startup time 20ms and Memory
Consumption 18MB!
http://www.graalvm.org
DEMOMicronaut
Hello Micronaut
@Controller
class HelloController {
@Get("/hello/{name}")
String hello(String name) {
return "Hello " + name;
}
}
@Client("/") // Client Generated at Compile Time
interface HelloClient {
@Get("/hello/{name}")
String hello(String name);
}
How Small?
• Smallest Micronaut Hello World JAR is 12MB when written
Java or 14MB in Groovy
• Can be run with as little as 10mb Max Heap with Kotlin or
Java (20mb for Groovy)
• Startup time subsecond for Kotlin or Java (a little more for
Groovy)
• All Dependency Injection, AOP and Proxy generation
happens at compile time
Micronaut Microservice
Cold Starts & Memory
Style Cold Start Memory
OpenJDK +/- 800ms +/- 100mb
Eclipse OpenJ9 with
Class Sharing
+/- 300ms +/- 70mb
Graal Native +/- 15ms +/- 15mb
Micronaut AWS Lambda
Cold Starts
Style Cold Start
Simple Function +/- 300ms
API Gateway +/- 800ms
API Gateway + Graal Custom
Runtime
+/- 150ms
Micronaut 1.1 Out
Now and
Production-Ready
• Compile Time DI & AOP
• HTTP Client & Server
• GRPC and GraphQL Support
• RabbitMQ and Improved Kafka
Support
• Micronaut 1.1.2 supports GraalVM
19 native (experimental status)
Micronaut project is
healthy
• ~2 years of development by several
OCI engineers.
• 128 contributors (19 from OCI).
• ~2350 stars on GitHub.
• ~6000 commits.
• More Exciting Announcements in
2019
• Made in Spain (partly ;-)
Micronaut Resources
• Gitter Community: https://gitter.im/micronautfw
• User Guide: http://micronaut.io/documentation.html
• Micronaut Guides: http://guides.micronaut.io
• FAQ: http://micronaut.io/faq.html
• Github: https://github.com/micronaut-projects/micronaut-
core
• Examples: https://github.com/micronaut-projects/
micronaut-examples
Summary
• Micronaut and GraalVM are leading the AOT revolution
• Server Side Java is Adapting to the Serverless world
• Building more efficient applications possible with right
framework choices
• AOT Sacrifices Compilation Speed to Gain so Much More
• Going native an option for the future with GraalVM
Q & AMicronaut
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019

More Related Content

What's hot

Apache Kafka in the Insurance Industry
Apache Kafka in the Insurance IndustryApache Kafka in the Insurance Industry
Apache Kafka in the Insurance IndustryKai Wähner
 
Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityJean-Paul Azar
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaJiangjie Qin
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewDmitry Tolpeko
 
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingSpring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingVMware Tanzu
 
Quarkus Denmark 2019
Quarkus Denmark 2019Quarkus Denmark 2019
Quarkus Denmark 2019Max Andersen
 
Common issues with Apache Kafka® Producer
Common issues with Apache Kafka® ProducerCommon issues with Apache Kafka® Producer
Common issues with Apache Kafka® Producerconfluent
 
Google Cloud Build - Sfeir Lunch Janvier 2019
Google Cloud Build - Sfeir Lunch Janvier 2019Google Cloud Build - Sfeir Lunch Janvier 2019
Google Cloud Build - Sfeir Lunch Janvier 2019Gaëlle Acas
 
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquaregRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquareApigee | Google Cloud
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorFlink Forward
 
A Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft OrleansA Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft OrleansUri Goldstein
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React? Lisa Gagarina
 
Testing with JUnit 5 and Spring
Testing with JUnit 5 and SpringTesting with JUnit 5 and Spring
Testing with JUnit 5 and SpringVMware Tanzu
 

What's hot (20)

Apache Kafka in the Insurance Industry
Apache Kafka in the Insurance IndustryApache Kafka in the Insurance Industry
Apache Kafka in the Insurance Industry
 
Spring GraphQL
Spring GraphQLSpring GraphQL
Spring GraphQL
 
Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka Security
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
 
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingSpring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
 
Quarkus Denmark 2019
Quarkus Denmark 2019Quarkus Denmark 2019
Quarkus Denmark 2019
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring Batch 2.0
Spring Batch 2.0Spring Batch 2.0
Spring Batch 2.0
 
Common issues with Apache Kafka® Producer
Common issues with Apache Kafka® ProducerCommon issues with Apache Kafka® Producer
Common issues with Apache Kafka® Producer
 
Google Cloud Build - Sfeir Lunch Janvier 2019
Google Cloud Build - Sfeir Lunch Janvier 2019Google Cloud Build - Sfeir Lunch Janvier 2019
Google Cloud Build - Sfeir Lunch Janvier 2019
 
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquaregRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes Operator
 
A Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft OrleansA Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft Orleans
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React?
 
Testing with JUnit 5 and Spring
Testing with JUnit 5 and SpringTesting with JUnit 5 and Spring
Testing with JUnit 5 and Spring
 

Similar to Introduction to Micronaut - JBCNConf 2019

Micronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless EraMicronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless Eragraemerocher
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019graemerocher
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmJamie Coleman
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVMAlex Birch
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMJamie Coleman
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTaro L. Saito
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfRichHagarty
 
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroReactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroFabio Tiriticco
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Jakarta_EE
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019The Eclipse Foundation
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?Steve Poole
 

Similar to Introduction to Micronaut - JBCNConf 2019 (20)

Micronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless EraMicronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless Era
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Stackato v2
Stackato v2Stackato v2
Stackato v2
 
Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Stackato
StackatoStackato
Stackato
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS Projects
 
Peru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVM
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdf
 
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroReactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?
 

More from graemerocher

Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019graemerocher
 
Grails 4 and Micronaut at Devnexus 2019
Grails 4 and Micronaut at Devnexus 2019Grails 4 and Micronaut at Devnexus 2019
Grails 4 and Micronaut at Devnexus 2019graemerocher
 
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019graemerocher
 
Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019graemerocher
 
Introduction to Micronaut at Oracle CodeOne 2018
Introduction to Micronaut at Oracle CodeOne 2018Introduction to Micronaut at Oracle CodeOne 2018
Introduction to Micronaut at Oracle CodeOne 2018graemerocher
 
Gr8Conf 2016 - GORM Inside and Out
Gr8Conf 2016 - GORM Inside and OutGr8Conf 2016 - GORM Inside and Out
Gr8Conf 2016 - GORM Inside and Outgraemerocher
 
Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3graemerocher
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Previewgraemerocher
 
Greach 2014 - Road to Grails 3.0
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0graemerocher
 

More from graemerocher (9)

Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
 
Grails 4 and Micronaut at Devnexus 2019
Grails 4 and Micronaut at Devnexus 2019Grails 4 and Micronaut at Devnexus 2019
Grails 4 and Micronaut at Devnexus 2019
 
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
 
Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019
 
Introduction to Micronaut at Oracle CodeOne 2018
Introduction to Micronaut at Oracle CodeOne 2018Introduction to Micronaut at Oracle CodeOne 2018
Introduction to Micronaut at Oracle CodeOne 2018
 
Gr8Conf 2016 - GORM Inside and Out
Gr8Conf 2016 - GORM Inside and OutGr8Conf 2016 - GORM Inside and Out
Gr8Conf 2016 - GORM Inside and Out
 
Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
Greach 2014 - Road to Grails 3.0
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0
 

Recently uploaded

Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 

Recently uploaded (20)

Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 

Introduction to Micronaut - JBCNConf 2019

  • 2. About Me • Graeme Rocher • Creator of Grails and Micronaut • Principal Engineer at Object Computing • Oracle Groundbreaker Award Winner • Based in Pais Vasco
  • 3. Agenda • Challenges Facing Java and Software in General • Microservces and Serverless vs. Traditional Models • Micronaut Demos! • Q & A!
  • 4. Serverless Challenges • Challenges to using Java in Serverless / Microservices scenarios • Existing Tools and Frameworks Not Optimized for Cold Starts / Low Memory • Go, Node etc. better in this regards • Tim Bray (Amazon/AWS) and others not recommending Java https://youtu.be/IPOvrK3S3gQ?t=1109
  • 5. Adapting to Serverless • Optimize for cold starts • Forget about connection pools • Don't bother with local caches • Choose technology based on your cold start requirements
  • 6. Adapting to Microservices • Cold starts less important, but still important • The Container is the deployment unit • Containers and Java require special memory management • Optimization for memory usage required
  • 7. Traditional Frameworks 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.
  • 8. What to do, What to do? 1. Tough technology decisions ahead 2. Choose appropriately tool for the job 3. Traditional frameworks often not the best choice
  • 9. The Micro Reality • Frameworks based on reflection and annotations become fat • But we love the programming model and productivity so we live with it • So ... why should we be more efficient?
  • 10.
  • 11.
  • 12. Java's Problems for Frameworks • Limited Annotation API • Type Erasure • Slow Reflection • Reflective Data Caches • Classpath Scanning • Slow Dynamic Class Loading
  • 13. Imagine if Kubernetes or Docker had been written in Spring or Jakarta EE instead of Go?
  • 14.
  • 15. Why is Reflection a Problem? • Today the JDK is OpenJDK! • Just take a look... http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/ share/classes/java/lang/Class.java#l2471 • All Reflective data initialized on first access and held in soft references (yes every field, method etc.) • Won't be GC'ed until your application is low on memory!
  • 16. Java's "Problems" • Greatly Exaggerated (Java has been dead forever) • Java can be Fast! (see Android and Micronaut) • However Most Existing Tools are based around • Reflection • Runtime Proxies • Runtime Byte Code Generation (bytebuddy/cglib/javassist)
  • 17. Java's Advantages • Mature, Robust Ecosystem • Outstanding IDEs • Code Maintenance and Refactoring • Developer Availability • Build System Maturity • Diversity (Mobile, IoT, Server Side) • Languages (Java, Kotlin, Groovy, Scala)
  • 18. By the time Go has all the features of Java, Java's startup performance will match Go
  • 19. Already Solved Problem • The Android Community already solved the problem • Ahead of Time Compilation used extensively • Google Dagger 2.x • Compile Time Dependency Injector • Reflection Free • Limited in Scope to just DI
  • 20. Ahead of Time Compilation • So what is Ahead of Time (AOT) compilation? • Pre-computation of application code using closed world static analysis • Fancy way of saying do more at compilation time and less at runtime
  • 21.
  • 22. Micronaut is... • A Microservices and Serverless Focused framework (hence the branding) • Also a Complete Application Framework for any type of Application • Dependency Injection, Aspect Oriented Programming (AOP), Configuration Management, Bean Introspection and more..
  • 23. Micronaut AOT Computation • All Dependency & Configuration Injection • Annotation Metadata (Meta annotations) • AOP Proxies • Essentially all framework infrastructure • ie. What Spring/CDI do at runtime
  • 24. With Micronaut You Can Build • Microservices • Serverless Applications • Message-Driven Applications with Kafka/Rabbit • CLI Applications • Even Android Applications • Anything with static void main(String..args)
  • 25. So What is Micronaut? Really? • An Application Framework for the Future • Reflection Free, Runtime Proxy Free, No Dynamic Classloading • Ahead of Time (AOT) Compilation AOT APIs • ... oh and let's you build Microservices
  • 26. Micronaut's Impact • We announced Micronaut on March 2018 • Open Sourced 28th of May 2018 (a year ago!) • Sparked industry wide improvements from Red Hat (with Quarkus) and Pivotal (Spring Boot 2.2) • Micronaut is changing the face of server side Java
  • 27. GraalVM • A New Universal Virtual Machine from Oracle • Features a native-image Tool • Converts Java -> native machine code using AOT • Works well with Micronaut • Startup time 20ms and Memory Consumption 18MB! http://www.graalvm.org
  • 29. Hello Micronaut @Controller class HelloController { @Get("/hello/{name}") String hello(String name) { return "Hello " + name; } } @Client("/") // Client Generated at Compile Time interface HelloClient { @Get("/hello/{name}") String hello(String name); }
  • 30. How Small? • Smallest Micronaut Hello World JAR is 12MB when written Java or 14MB in Groovy • Can be run with as little as 10mb Max Heap with Kotlin or Java (20mb for Groovy) • Startup time subsecond for Kotlin or Java (a little more for Groovy) • All Dependency Injection, AOP and Proxy generation happens at compile time
  • 31. Micronaut Microservice Cold Starts & Memory Style Cold Start Memory OpenJDK +/- 800ms +/- 100mb Eclipse OpenJ9 with Class Sharing +/- 300ms +/- 70mb Graal Native +/- 15ms +/- 15mb
  • 32. Micronaut AWS Lambda Cold Starts Style Cold Start Simple Function +/- 300ms API Gateway +/- 800ms API Gateway + Graal Custom Runtime +/- 150ms
  • 33. Micronaut 1.1 Out Now and Production-Ready • Compile Time DI & AOP • HTTP Client & Server • GRPC and GraphQL Support • RabbitMQ and Improved Kafka Support • Micronaut 1.1.2 supports GraalVM 19 native (experimental status)
  • 34. Micronaut project is healthy • ~2 years of development by several OCI engineers. • 128 contributors (19 from OCI). • ~2350 stars on GitHub. • ~6000 commits. • More Exciting Announcements in 2019 • Made in Spain (partly ;-)
  • 35. Micronaut Resources • Gitter Community: https://gitter.im/micronautfw • User Guide: http://micronaut.io/documentation.html • Micronaut Guides: http://guides.micronaut.io • FAQ: http://micronaut.io/faq.html • Github: https://github.com/micronaut-projects/micronaut- core • Examples: https://github.com/micronaut-projects/ micronaut-examples
  • 36. Summary • Micronaut and GraalVM are leading the AOT revolution • Server Side Java is Adapting to the Serverless world • Building more efficient applications possible with right framework choices • AOT Sacrifices Compilation Speed to Gain so Much More • Going native an option for the future with GraalVM