Slide 1

Slide 1 text

The secret behind of them Luram Archanjo

Slide 2

Slide 2 text

Who am I? ● Software Engineer at Sensedia ● MBA in Java projects ● Java and Microservice enthusiastic

Slide 3

Slide 3 text

Agenda ● Microservices ● Java & Frameworks ● Ahead of Time (AOT) Compilation ● GraalVM ● Questions

Slide 4

Slide 4 text

Moving to Microservices Feature A Feature B Feature C Monolith Microservice Microservice Microservices Microservice

Slide 5

Slide 5 text

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 Waste Waste Waste Waste Waste

Slide 6

Slide 6 text

Our resources are finite!

Slide 7

Slide 7 text

How to use less resources using Java language?

Slide 8

Slide 8 text

Our frameworks are design to low memory footprint?

Slide 9

Slide 9 text

No, because we’ve tried to adapt existing legacy technologies for Microservices

Slide 10

Slide 10 text

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.

Slide 11

Slide 11 text

The rise of Java Microframeworks

Slide 12

Slide 12 text

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.

Slide 13

Slide 13 text

Less modules, functions and dependencies are not enough!

Slide 14

Slide 14 text

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 ?

Slide 15

Slide 15 text

use Ahead of Time (AOT) Compilation

Slide 16

Slide 16 text

What are the results of using Ahead of Time (AOT) Compilation?

Slide 17

Slide 17 text

The results of using Ahead of Time (AOT) Compilation ● Startup time around a second. ● All Dependency Injection, AOP and Proxy generation happens at compile time. ● Can be run with as little as 15mb Max Heap.

Slide 18

Slide 18 text

I don't believe, show me!

Slide 19

Slide 19 text

Is it possible to improve more?

Slide 20

Slide 20 text

Yes, with

Slide 21

Slide 21 text

GraalVM is an universal virtual machine: ● Runs Java, Scala, Kotlin etc. ● Native image Native image works well when: ● Little or no runtime reflection is used. ○ Use third party libraries selectively. ● Limited or no dynamic classloading.

Slide 22

Slide 22 text

What are the results of using Native Image?

Slide 23

Slide 23 text

The results of using Native Image Source: https://www.graalvm.org/docs/why-graal/

Slide 24

Slide 24 text

The results of using Native Image Source: https://www.graalvm.org/docs/why-graal/

Slide 25

Slide 25 text

GraalVM Native Image, currently available as an Early Adopter Technology Source: https://www.graalvm.org/docs/why-graal/

Slide 26

Slide 26 text

What else Micronaut & Quarkus do?

Slide 27

Slide 27 text

There were born in Microservices and Cloud era

Slide 28

Slide 28 text

There were born in Microservices and Cloud era ● Observability ○ Open Tracing ■ Zipkin ■ Jaeger ○ Health Checks ○ Metrics ● Fault Tolerance ○ Timeout ○ Retry ○ Circuit Breaker ○ Fallback ● Dependency Injection and Inversion of Control (IoC) ● Blocking or Non-Blocking HTTP Server

Slide 29

Slide 29 text

They are providing Java Serverless Application Adoption

Slide 30

Slide 30 text

Summary 2º Place 1º Place 3º Place Ahead of Time (AOT) Compilation ● Low memory footprint ● Fast Startup ● IoC Native Image ● Low memory footprint 5x lower ● Fast Startup 50x lower Cloud Native Features ● Observability ● Fault Tolerance ● Distributed Configuration

Slide 31

Slide 31 text

Which one is the best? You decide! The important thing is that they are changing the Java World

Slide 32

Slide 32 text

Thanks a million! Questions? /larchanjo /luram-archanjo