SlideShare a Scribd company logo
Microservices with Micronaut
2019-06-13 - Moritz Kammerer
What’s the problem?
Why does it take so long?
● Start time of Spring (Boot)
○ Depends on the number of beans in the context
○ Reading of bytecode [3]
○ Creating proxies at runtime
○ Runtime AOP
○ Reflection
○ Annotation Synthesizing [1] [2]
● Memory usage
○ Reflective Metadata Cache
● Debugging
○ Very very long stacktraces
○ … with code in dynamically generated proxy classes
[1] https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/AnnotationUtils.html
[2] https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/AliasFor.html
[3] https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/type/classreading/AbstractRecursiveAnnotationVisitor.java
What’s the (promised) solution?
● Create stuff at compile time
○ Proxies
○ Dependency Injection
○ AOP
● Why?
○ Compiled once, run often
○ Tradeoff: Compile time vs. Runtime
● Goal:
○ No reflection - or as little as possible
○ No proxies
○ Minimize startup time
○ Minimize memory usage
○ Readable stacktraces
And how does that work?
● Annotation Processor
○ Reads bytecode & annotations of the classes
○ Creates new classes
○ Doesn’t touch your code, just extends it
● Gradle
○ annotationProcessor "io.micronaut:micronaut-inject-java"
○ annotationProcessor "io.micronaut:micronaut-validation"
● Also runs with Maven
○ < Insert 500 KB of XML here >
Microservices with Micronaut
And this is really working?
● Spring Boot 2.1.2 (starter-web), Java 11, @Component on empty class
○ 0 Beans: 1.236 seconds
○ 1000 Beans: 1.808 seconds
○ 2000 Beans: 2.356 seconds
○ 4000 Beans: 3.259 seconds
○ 8000 Beans: 6.498 seconds
○ 16000 Beans: 9.231 seconds
● Micronaut 1.0.4, Java 11, @Singleton on empty class
○ 0 Beans: 1085ms
○ 1000 Beans: 1870ms
○ 2000 Beans: 2757ms
○ 4000 Beans: 4529ms
○ 8000 Beans: 8038ms
○ 16000 Beans: 15861ms
Hmmmm...
Debunked: It’s not the classpath scanning
● Not so expensive:
○ Classpath scanning (Spring)
○ Injection with reflection (Spring)
● Expensive
○ Load classes (Micronaut + Spring)
○ Runtime AOP Proxies (Spring)
○ Annotation Synthesizing (Spring)
○ Read bytecode on big classes (Spring)
○ Auto-Configuration Magic (Spring)
Looks great, so not disadvantages?
The price you pay: Compile time (16k Beans)
Spring:
[INFO] Total time: 7.958 s
Micronaut:
BUILD SUCCESSFUL in 5m 3s
Benchmarking is hard!
● This was NOT a real benchmark
● Most time spent in the applications shown on the first slides: Spring
autoconfiguration magic
● It really depends on the needed feature of your application
○ Actuator
○ JPA / Hibernate
○ Tracing
○ Metriken
○ @FeignClient
○ @Transactional
○ @Cacheable
○ …
● More in the live demo!
Okay... what else brings Micronaut to the table?
● Dependency Injection
○ @Inject, @Named, @Singleton, @Prototype, ...
● REST Controller
○ @Controller, @GET, @POST, …
● Events
○ @PostConstruct
○ @EventListener
● AOP
○ Around Advice, Introduction Advice, …
● Validation
○ @Validated, @NotNull, ...
...
● Caching
○ @Cachable, @CacheInvalidate, …
● Retry
○ @Retryable
● Circuit Breaking
○ @CircuitBreaker
● Fallback / Recovery
○ @Recoverable / @Fallback
● Scheduling
○ @Scheduled
...
● Reactive & Blocking HTTP with Netty
○ Compile Time Route Validation
○ @Error Exception Handling ala Spring
● Websocket Server & Clients
● Server side views
○ Thymeleaf, Handlebars, Velocity
● OpenAPI / Swagger (experimental)
○ Is created on compile time!
● HTTP Clients
○ @Client
○ Client-side load balancing
○ Service discovery (Consul, Eureka, K8S, Route 53, DNS based)
○ OpenTracing (Zipkin, Jaeger)
...
● Application Configuration
○ application.yml / .json / .groovy
○ Different Environments
○ Property Sources (ENV, System Properties, …)
○ @ConfigurationProperties, @Value
○ Distributed config with Consul, AWS Parameter Store
● Database support
○ JPA, Mongo, Neo4J, Postgres-Reactive, Redis, Cassandra
● Monitoring
○ @Endpoint (/beans, /info, /health, …)
○ Metriken with Micrometer
○ Change log level at runtime
...
● Security
○ Like Spring Security with users and roles (RBAC)
○ Basic Auth / Session based
○ JWT (JWS and JWE) incl. automatic token propagation
○ Auth with LDAP
● Function-as-a-Service (AWS Lambda, OpenFaaS)
● Message driven services (RabbitMQ / Kafka)
● CLI Applikationen
● Good documentation!
○ e.g. with tutorials for Let’s Encrypt, starting Consul, etc.
Enough bla bla, show code!
Spring vs. Micronaut - GitHub Scraper
Micronaut
BUILD SUCCESSFUL in 9s
Startup completed in 1168ms
Spring
BUILD SUCCESSFUL in 5s
Started DemoApplication in 3.066 seconds (JVM running for 3.505)
Micronaut (JAR: 12 MB)
java -Xms16M -Xmx512M -jar github-scraper-0.1-all.jar / openjdk version "1.8.0_201"
Micronaut
wrk -t 8 -c 80 -d 30s --latency http://localhost:8080/github/stars
Running 30s test @ http://localhost:8080/github/stars
8 threads and 80 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 12.75ms 74.53ms 1.50s 97.96%
Req/Sec 6.24k 2.70k 15.36k 69.12%
Latency Distribution
50% 1.28ms
75% 4.19ms
90% 11.87ms
99% 411.86ms
1460134 requests in 30.03s, 714.10MB read
Requests/sec: 48618.64
Transfer/sec: 23.78MB
Spring Boot (JAR: 33 MB)
java -Xms16M -Xmx512M -jar github-scraper-spring-0.0.1-SNAPSHOT.jar / openjdk version "1.8.0_201"
Spring Boot
wrk -t 8 -c 80 -d 30s --latency http://localhost:8080/github/stars
Running 30s test @ http://localhost:8080/github/stars
8 threads and 80 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 19.98ms 62.12ms 1.26s 94.35%
Req/Sec 3.72k 1.93k 8.64k 58.43%
Latency Distribution
50% 1.99ms
75% 11.54ms
90% 50.91ms
99% 329.01ms
865022 requests in 30.06s, 425.81MB read
Non-2xx or 3xx responses: 164
Requests/sec: 28779.20
Transfer/sec: 14.17MB
Graal VM
“High-performance polyglot VM”
(and AOT compiler)
Graal
KB
Graal
Running 30s test @ http://localhost:8080/test
8 threads and 80 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 9.12ms 10.93ms 149.69ms 86.75%
Req/Sec 1.66k 301.15 2.80k 68.92%
Latency Distribution
50% 4.28ms
75% 11.83ms
90% 23.74ms
99% 50.63ms
396402 requests in 30.02s, 51.79MB read
Requests/sec: 13204.09
Transfer/sec: 1.73MB
Experience from the trenches: TASTE-OS
Pro:
● Services start faster than Spring Boot
● Smaller JARs
● Tests are faster, as the embedded server starts fast
Contra:
● No separation of management and API port
● MDC / ThreadLocal in reactive applications (not Micronaut specific)
Conclusion
● Good documentation
● Recommendation for writing small services
○ I have no experience with bigger services in Micronaut. If you have, please contact me :)
● Development is fun
● If the features are sufficient: Try it!
● GraalVM is incomplete / buggy / not ready for prime-time
Literature
● GitLab Repo: https://github.com/qaware/microservices-with-micronaut
● Micronaut documentation: https://docs.micronaut.io/latest/guide/index.html
● GraalVM: https://www.graalvm.org/
Questions?
Contact: moritz.kammerer@qaware.de
We are hiring.
In Munich. And in Mainz.
https://www.qaware.de/karriere/#jobs

More Related Content

PDF
Introduction to Micronaut - JBCNConf 2019
PPTX
Micronaut: A new way to build microservices
PDF
Spring Boot
PPTX
Spring boot Introduction
PPTX
PDF
Networking in Java with NIO and Netty
PPTX
Spring boot Under Da Hood
PDF
Spring Boot
Introduction to Micronaut - JBCNConf 2019
Micronaut: A new way to build microservices
Spring Boot
Spring boot Introduction
Networking in Java with NIO and Netty
Spring boot Under Da Hood
Spring Boot

What's hot (20)

PDF
Spring boot jpa
PPTX
Spring Boot Tutorial
PPT
Spring Boot in Action
PPTX
Introduction To C#
PPTX
C# Async Await
PPTX
Type Casting Operator
PPTX
Understanding LINQ in C#
PDF
JPA and Hibernate
PPTX
Core java
PDF
Java String
PPTX
No data loss pipeline with apache kafka
PDF
From Java 11 to 17 and beyond.pdf
PPTX
Spring boot - an introduction
DOCX
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
PPSX
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slides
PDF
톰캣 운영 노하우
PPT
Springboot introduction
PDF
Spring Boot
PDF
PUC SE Day 2019 - SpringBoot
Spring boot jpa
Spring Boot Tutorial
Spring Boot in Action
Introduction To C#
C# Async Await
Type Casting Operator
Understanding LINQ in C#
JPA and Hibernate
Core java
Java String
No data loss pipeline with apache kafka
From Java 11 to 17 and beyond.pdf
Spring boot - an introduction
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slides
톰캣 운영 노하우
Springboot introduction
Spring Boot
PUC SE Day 2019 - SpringBoot
Ad

Similar to Microservices with Micronaut (20)

PDF
Microservices with Micronaut
PDF
Microservices with Micronaut
PPTX
Micronaut brainbit
PDF
Introduction to Micronaut at Oracle CodeOne 2018
PDF
Micronaut Deep Dive - Devoxx Belgium 2019
PDF
Introduction to Micronaut
PDF
Micronaut Launchpad
PDF
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
PPTX
Discover Micronaut
PDF
Micronaut: Changing the Micro Future
PDF
Micronaut Deep Dive - Devnexus 2019
PPTX
Greach 19 - Micronaut Performance
PPTX
The Framework Redefining Java for Microservices and Beyond
PDF
Micronaut: Evolving Java for the Microservices and Serverless Era
PPTX
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
PDF
Micronaut Deep Dive - Codeone 2019
PPTX
Writing Java Serverless Application Using Micronaut
PDF
Grails 4 and Micronaut at Devnexus 2019
PDF
Reactive microservices with Micronaut - Greach 2018
PDF
Greach 2019 - Creating Micronaut Configurations
Microservices with Micronaut
Microservices with Micronaut
Micronaut brainbit
Introduction to Micronaut at Oracle CodeOne 2018
Micronaut Deep Dive - Devoxx Belgium 2019
Introduction to Micronaut
Micronaut Launchpad
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Discover Micronaut
Micronaut: Changing the Micro Future
Micronaut Deep Dive - Devnexus 2019
Greach 19 - Micronaut Performance
The Framework Redefining Java for Microservices and Beyond
Micronaut: Evolving Java for the Microservices and Serverless Era
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Micronaut Deep Dive - Codeone 2019
Writing Java Serverless Application Using Micronaut
Grails 4 and Micronaut at Devnexus 2019
Reactive microservices with Micronaut - Greach 2018
Greach 2019 - Creating Micronaut Configurations
Ad

More from QAware GmbH (20)

PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
PDF
Frontends mit Hilfe von KI entwickeln.pdf
PDF
Mit ChatGPT Dinosaurier besiegen - Möglichkeiten und Grenzen von LLM für die ...
PDF
50 Shades of K8s Autoscaling #JavaLand24.pdf
PDF
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
PPTX
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
PDF
Down the Ivory Tower towards Agile Architecture
PDF
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
PDF
Make Developers Fly: Principles for Platform Engineering
PDF
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
PDF
Was kommt nach den SPAs
PDF
Cloud Migration mit KI: der Turbo
PDF
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
PDF
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
PDF
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
PDF
Kubernetes with Cilium in AWS - Experience Report!
PDF
50 Shades of K8s Autoscaling
PDF
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
PDF
Service Mesh Pain & Gain. Experiences from a client project.
PDF
50 Shades of K8s Autoscaling
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
Frontends mit Hilfe von KI entwickeln.pdf
Mit ChatGPT Dinosaurier besiegen - Möglichkeiten und Grenzen von LLM für die ...
50 Shades of K8s Autoscaling #JavaLand24.pdf
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Down the Ivory Tower towards Agile Architecture
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
Make Developers Fly: Principles for Platform Engineering
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
Was kommt nach den SPAs
Cloud Migration mit KI: der Turbo
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Kubernetes with Cilium in AWS - Experience Report!
50 Shades of K8s Autoscaling
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Service Mesh Pain & Gain. Experiences from a client project.
50 Shades of K8s Autoscaling

Recently uploaded (20)

PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPT
Quality review (1)_presentation of this 21
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PPTX
Database Infoormation System (DBIS).pptx
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
Introduction to machine learning and Linear Models
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
Business Analytics and business intelligence.pdf
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Reliability_Chapter_ presentation 1221.5784
Introduction-to-Cloud-ComputingFinal.pptx
.pdf is not working space design for the following data for the following dat...
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Quality review (1)_presentation of this 21
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
climate analysis of Dhaka ,Banglades.pptx
Introduction to Knowledge Engineering Part 1
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
Database Infoormation System (DBIS).pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Introduction to machine learning and Linear Models
STUDY DESIGN details- Lt Col Maksud (21).pptx
Business Ppt On Nestle.pptx huunnnhhgfvu
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
Business Analytics and business intelligence.pdf
Supervised vs unsupervised machine learning algorithms
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx

Microservices with Micronaut

  • 3. Why does it take so long? ● Start time of Spring (Boot) ○ Depends on the number of beans in the context ○ Reading of bytecode [3] ○ Creating proxies at runtime ○ Runtime AOP ○ Reflection ○ Annotation Synthesizing [1] [2] ● Memory usage ○ Reflective Metadata Cache ● Debugging ○ Very very long stacktraces ○ … with code in dynamically generated proxy classes [1] https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/AnnotationUtils.html [2] https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/AliasFor.html [3] https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/type/classreading/AbstractRecursiveAnnotationVisitor.java
  • 4. What’s the (promised) solution? ● Create stuff at compile time ○ Proxies ○ Dependency Injection ○ AOP ● Why? ○ Compiled once, run often ○ Tradeoff: Compile time vs. Runtime ● Goal: ○ No reflection - or as little as possible ○ No proxies ○ Minimize startup time ○ Minimize memory usage ○ Readable stacktraces
  • 5. And how does that work? ● Annotation Processor ○ Reads bytecode & annotations of the classes ○ Creates new classes ○ Doesn’t touch your code, just extends it ● Gradle ○ annotationProcessor "io.micronaut:micronaut-inject-java" ○ annotationProcessor "io.micronaut:micronaut-validation" ● Also runs with Maven ○ < Insert 500 KB of XML here >
  • 7. And this is really working? ● Spring Boot 2.1.2 (starter-web), Java 11, @Component on empty class ○ 0 Beans: 1.236 seconds ○ 1000 Beans: 1.808 seconds ○ 2000 Beans: 2.356 seconds ○ 4000 Beans: 3.259 seconds ○ 8000 Beans: 6.498 seconds ○ 16000 Beans: 9.231 seconds ● Micronaut 1.0.4, Java 11, @Singleton on empty class ○ 0 Beans: 1085ms ○ 1000 Beans: 1870ms ○ 2000 Beans: 2757ms ○ 4000 Beans: 4529ms ○ 8000 Beans: 8038ms ○ 16000 Beans: 15861ms
  • 9. Debunked: It’s not the classpath scanning ● Not so expensive: ○ Classpath scanning (Spring) ○ Injection with reflection (Spring) ● Expensive ○ Load classes (Micronaut + Spring) ○ Runtime AOP Proxies (Spring) ○ Annotation Synthesizing (Spring) ○ Read bytecode on big classes (Spring) ○ Auto-Configuration Magic (Spring)
  • 10. Looks great, so not disadvantages?
  • 11. The price you pay: Compile time (16k Beans) Spring: [INFO] Total time: 7.958 s Micronaut: BUILD SUCCESSFUL in 5m 3s
  • 12. Benchmarking is hard! ● This was NOT a real benchmark ● Most time spent in the applications shown on the first slides: Spring autoconfiguration magic ● It really depends on the needed feature of your application ○ Actuator ○ JPA / Hibernate ○ Tracing ○ Metriken ○ @FeignClient ○ @Transactional ○ @Cacheable ○ … ● More in the live demo!
  • 13. Okay... what else brings Micronaut to the table? ● Dependency Injection ○ @Inject, @Named, @Singleton, @Prototype, ... ● REST Controller ○ @Controller, @GET, @POST, … ● Events ○ @PostConstruct ○ @EventListener ● AOP ○ Around Advice, Introduction Advice, … ● Validation ○ @Validated, @NotNull, ...
  • 14. ... ● Caching ○ @Cachable, @CacheInvalidate, … ● Retry ○ @Retryable ● Circuit Breaking ○ @CircuitBreaker ● Fallback / Recovery ○ @Recoverable / @Fallback ● Scheduling ○ @Scheduled
  • 15. ... ● Reactive & Blocking HTTP with Netty ○ Compile Time Route Validation ○ @Error Exception Handling ala Spring ● Websocket Server & Clients ● Server side views ○ Thymeleaf, Handlebars, Velocity ● OpenAPI / Swagger (experimental) ○ Is created on compile time! ● HTTP Clients ○ @Client ○ Client-side load balancing ○ Service discovery (Consul, Eureka, K8S, Route 53, DNS based) ○ OpenTracing (Zipkin, Jaeger)
  • 16. ... ● Application Configuration ○ application.yml / .json / .groovy ○ Different Environments ○ Property Sources (ENV, System Properties, …) ○ @ConfigurationProperties, @Value ○ Distributed config with Consul, AWS Parameter Store ● Database support ○ JPA, Mongo, Neo4J, Postgres-Reactive, Redis, Cassandra ● Monitoring ○ @Endpoint (/beans, /info, /health, …) ○ Metriken with Micrometer ○ Change log level at runtime
  • 17. ... ● Security ○ Like Spring Security with users and roles (RBAC) ○ Basic Auth / Session based ○ JWT (JWS and JWE) incl. automatic token propagation ○ Auth with LDAP ● Function-as-a-Service (AWS Lambda, OpenFaaS) ● Message driven services (RabbitMQ / Kafka) ● CLI Applikationen ● Good documentation! ○ e.g. with tutorials for Let’s Encrypt, starting Consul, etc.
  • 18. Enough bla bla, show code!
  • 19. Spring vs. Micronaut - GitHub Scraper Micronaut BUILD SUCCESSFUL in 9s Startup completed in 1168ms Spring BUILD SUCCESSFUL in 5s Started DemoApplication in 3.066 seconds (JVM running for 3.505)
  • 20. Micronaut (JAR: 12 MB) java -Xms16M -Xmx512M -jar github-scraper-0.1-all.jar / openjdk version "1.8.0_201"
  • 21. Micronaut wrk -t 8 -c 80 -d 30s --latency http://localhost:8080/github/stars Running 30s test @ http://localhost:8080/github/stars 8 threads and 80 connections Thread Stats Avg Stdev Max +/- Stdev Latency 12.75ms 74.53ms 1.50s 97.96% Req/Sec 6.24k 2.70k 15.36k 69.12% Latency Distribution 50% 1.28ms 75% 4.19ms 90% 11.87ms 99% 411.86ms 1460134 requests in 30.03s, 714.10MB read Requests/sec: 48618.64 Transfer/sec: 23.78MB
  • 22. Spring Boot (JAR: 33 MB) java -Xms16M -Xmx512M -jar github-scraper-spring-0.0.1-SNAPSHOT.jar / openjdk version "1.8.0_201"
  • 23. Spring Boot wrk -t 8 -c 80 -d 30s --latency http://localhost:8080/github/stars Running 30s test @ http://localhost:8080/github/stars 8 threads and 80 connections Thread Stats Avg Stdev Max +/- Stdev Latency 19.98ms 62.12ms 1.26s 94.35% Req/Sec 3.72k 1.93k 8.64k 58.43% Latency Distribution 50% 1.99ms 75% 11.54ms 90% 50.91ms 99% 329.01ms 865022 requests in 30.06s, 425.81MB read Non-2xx or 3xx responses: 164 Requests/sec: 28779.20 Transfer/sec: 14.17MB
  • 24. Graal VM “High-performance polyglot VM” (and AOT compiler)
  • 26. Graal Running 30s test @ http://localhost:8080/test 8 threads and 80 connections Thread Stats Avg Stdev Max +/- Stdev Latency 9.12ms 10.93ms 149.69ms 86.75% Req/Sec 1.66k 301.15 2.80k 68.92% Latency Distribution 50% 4.28ms 75% 11.83ms 90% 23.74ms 99% 50.63ms 396402 requests in 30.02s, 51.79MB read Requests/sec: 13204.09 Transfer/sec: 1.73MB
  • 27. Experience from the trenches: TASTE-OS Pro: ● Services start faster than Spring Boot ● Smaller JARs ● Tests are faster, as the embedded server starts fast Contra: ● No separation of management and API port ● MDC / ThreadLocal in reactive applications (not Micronaut specific)
  • 28. Conclusion ● Good documentation ● Recommendation for writing small services ○ I have no experience with bigger services in Micronaut. If you have, please contact me :) ● Development is fun ● If the features are sufficient: Try it! ● GraalVM is incomplete / buggy / not ready for prime-time
  • 29. Literature ● GitLab Repo: https://github.com/qaware/microservices-with-micronaut ● Micronaut documentation: https://docs.micronaut.io/latest/guide/index.html ● GraalVM: https://www.graalvm.org/
  • 31. We are hiring. In Munich. And in Mainz. https://www.qaware.de/karriere/#jobs