Share
Embed
[JavaZone 2023] - Quarkus for Spring Developers
In this session, I will show concepts and conventions familiar to Spring developers and how those same concepts and conventions can be implemented in Quarkus, all while highlighting similarities and differences between them. Additionally, I will show similarities and differences in how testing is done, highlighting Quarkus Dev Services.
This session will be mostly code while minimizing the number of slides. I will introduce an existing Spring application with a full test suite and build a Quarkus equivalent version of it, live.
Eric Deandrea PRO
September 07, 2023
Video
Transcript
35 slides
-
@edeandrea • How Quarkus enables modern Java development & the
Kubernetes-native experience • Introduce familiar Spring concepts, constructs, & conventions and how they map to Quarkus • Emphasis on testing patterns & practices https://red.ht/quarkus-spring-devs -
@edeandrea • How Quarkus enables modern Java development & the
Kubernetes-native experience • Introduce familiar Spring concepts, constructs, & conventions and how they map to Quarkus • Emphasis on testing patterns & practices https://red.ht/quarkus-spring-devs Free copy (while they last)! Come see me at the Red Hat booth! 2:00 PM today! -
@edeandrea Monolith J2SE / J2EE Java / Jakarta EE Java,
The Enterprise Workhorse -
@edeandrea Monolith J2SE / J2EE Java / Jakarta EE Java,
The Enterprise Workhorse -
@edeandrea Monolith J2SE / J2EE Java / Jakarta EE Cloud-Native
Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse -
@edeandrea Monolith J2SE / J2EE Java / Jakarta EE Cloud-Native
Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse -
@edeandrea Monolith J2SE / J2EE Java / Jakarta EE Cloud-Native
Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse -
@edeandrea Java / Jakarta EE J2SE / J2EE Monolith Cloud-Native
Microservices Spring Boot MicroProfile Java, The Enterprise Workhorse -
@edeandrea Java / Jakarta EE J2SE / J2EE Monolith Cloud-Native
Microservices Serverless Event-Driven Microservices Cloud-Native Spring Boot MicroProfile Java, The Enterprise Workhorse -
@edeandrea The Warmup Issue with Java Simon Ritter - Azul
Systems - https://youtu.be/bWmuqh6wHgE (first 13 minutes) -
@edeandrea Build Time Runtime Packaging (maven, etc) gradle…) Load
config file from file system Parse it Classpath scanning to find annotated classes Attempt to load class to enable/disable features Build its model of the world. Start the management (thread, pool…) @ @ </> How Does a Framework Start? -
@edeandrea The Quarkus Way Runtime Build Time @ @
</> Package model -
@edeandrea JVM Build Time @ @ </> Package
model Native The Quarkus Way enables Native Compilation -
@edeandrea 🤘Zero-config Live coding 🤘Auto-provision services 🤘Continuous testing 🤘Dev UI
🤘CLI Enhancing Developer Joy -
@edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework
version 3.2.4.Final 3.1.2 Build time (s) 7.85 4.12 190.69% Av. RSS after startup (MB) 174.29 264.37 65.93% Av. time to 1st req (ms) 2,498.33 5,354 46.66% Av. RSS after 1st req (MB) 233.38 313.83 74.36% Av. throughput (req/sec) 28,212.77 7,159.16 394.08% Av. RSS for max throughput (MB) 412.74 472.65 87.33% Max throughput density (req/sec/ MB) 69.87 15.39 454.13% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.2.4.Final 3.1.2 Build time (s) 128 210.25 60.88% Av. RSS after startup (MB) 65.7 148.66 44.19% Av. time to 1st req (ms) 51.33 222.33 23.09% Av. RSS after 1st req (MB) 72.89 151.43 48.14% Av. throughput (req/sec) 17,661.69 6,196.88 285.01% Av. RSS for max throughput (MB) 344.49 480.85 71.64% Max throughput density (req/sec/ MB) 54.84 13.8 397.54% Don’t Take My Word For It! Some real numbers (8 cores, 12GB RAM, GraalVM 22.3.1.r17) -
@edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework
version 3.2.4.Final 3.1.2 Build time (s) 7.85 4.12 190.69% Av. RSS after startup (MB) 174.29 264.37 65.93% Av. time to 1st req (ms) 2,498.33 5,354 46.66% Av. RSS after 1st req (MB) 233.38 313.83 74.36% Av. throughput (req/sec) 28,212.77 7,159.16 394.08% Av. RSS for max throughput (MB) 412.74 472.65 87.33% Max throughput density (req/sec/ MB) 69.87 15.39 454.13% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.2.4.Final 3.1.2 Build time (s) 128 210.25 60.88% Av. RSS after startup (MB) 65.7 148.66 44.19% Av. time to 1st req (ms) 51.33 222.33 23.09% Av. RSS after 1st req (MB) 72.89 151.43 48.14% Av. throughput (req/sec) 17,661.69 6,196.88 285.01% Av. RSS for max throughput (MB) 344.49 480.85 71.64% Max throughput density (req/sec/ MB) 54.84 13.8 397.54% Don’t Take My Word For It! Some real numbers (8 cores, 12GB RAM, GraalVM 22.3.1.r17) -
@edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework
version 3.2.4.Final 3.1.2 Build time (s) 7.85 4.12 190.69% Av. RSS after startup (MB) 174.29 264.37 65.93% Av. time to 1st req (ms) 2,498.33 5,354 46.66% Av. RSS after 1st req (MB) 233.38 313.83 74.36% Av. throughput (req/sec) 28,212.77 7,159.16 394.08% Av. RSS for max throughput (MB) 412.74 472.65 87.33% Max throughput density (req/sec/ MB) 69.87 15.39 454.13% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.2.4.Final 3.1.2 Build time (s) 128 210.25 60.88% Av. RSS after startup (MB) 65.7 148.66 44.19% Av. time to 1st req (ms) 51.33 222.33 23.09% Av. RSS after 1st req (MB) 72.89 151.43 48.14% Av. throughput (req/sec) 17,661.69 6,196.88 285.01% Av. RSS for max throughput (MB) 344.49 480.85 71.64% Max throughput density (req/sec/ MB) 54.84 13.8 397.54% Don’t Take My Word For It! Some real numbers (8 cores, 12GB RAM, GraalVM 22.3.1.r17) -
@edeandrea JVM Quarkus Spring Boot Ratio (Quarkus / SB) Framework
version 3.2.4.Final 3.1.2 Build time (s) 7.85 4.12 190.69% Av. RSS after startup (MB) 174.29 264.37 65.93% Av. time to 1st req (ms) 2,498.33 5,354 46.66% Av. RSS after 1st req (MB) 233.38 313.83 74.36% Av. throughput (req/sec) 28,212.77 7,159.16 394.08% Av. RSS for max throughput (MB) 412.74 472.65 87.33% Max throughput density (req/sec/ MB) 69.87 15.39 454.13% Native Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.2.4.Final 3.1.2 Build time (s) 128 210.25 60.88% Av. RSS after startup (MB) 65.7 148.66 44.19% Av. time to 1st req (ms) 51.33 222.33 23.09% Av. RSS after 1st req (MB) 72.89 151.43 48.14% Av. throughput (req/sec) 17,661.69 6,196.88 285.01% Av. RSS for max throughput (MB) 344.49 480.85 71.64% Max throughput density (req/sec/ MB) 54.84 13.8 397.54% Don’t Take My Word For It! Some real numbers (8 cores, 12GB RAM, GraalVM 22.3.1.r17) -
@edeandrea 🤘 Compiling a Spring Boot 3 application: ◦ 36,583
classes ◦ 80,008 fields ◦ 256,009 methods ◦ 1,783 classes, 2,186 fields, & 11,236 methods using reflection A Real Example -
@edeandrea 🤘 Compiling a Spring Boot 3 application: ◦ 36,583
classes ◦ 80,008 fields ◦ 256,009 methods ◦ 1,783 classes, 2,186 fields, & 11,236 methods using reflection 🤘 Compiling a Quarkus 3 application: ◦ 22,420 classes ◦ 45,178 fields ◦ 180,478 methods ◦ 733 classes, 160 fields, & 3,968 methods using reflection A Real Example -
@edeandrea 🤘 Compiling a Spring Boot 3 application: ◦ 36,583
classes ◦ 80,008 fields ◦ 256,009 methods ◦ 1,783 classes, 2,186 fields, & 11,236 methods using reflection 🤘 Compiling a Quarkus 3 application: ◦ 22,420 classes ◦ 45,178 fields ◦ 180,478 methods ◦ 733 classes, 160 fields, & 3,968 methods using reflection 🤘 The Quarkus application has: ◦ 14,163 (39%) less classes ◦ 34,830 (44%) less fields ◦ 75,531 (30%) less methods ◦ 1,050 (59%) less classes using reflection ◦ 2,026 (92%) less fields using reflection ◦ 7,268 (65%) less methods using reflection A Real Example -
@edeandrea https://www.redhat.com/en/resources/greener-java-applications-detail Setup 🤘 AWS (us-east-1) 🤘 SLA > 99%
🤘 800 req/sec over 20 days 🤘 50% load The Cost / Carbon Impact -
@edeandrea • How Quarkus enables modern Java development & the
Kubernetes-native experience • Introduce familiar Spring concepts, constructs, & conventions and how they map to Quarkus • Emphasis on testing patterns & practices https://red.ht/quarkus-spring-devs -
@edeandrea • How Quarkus enables modern Java development & the
Kubernetes-native experience • Introduce familiar Spring concepts, constructs, & conventions and how they map to Quarkus • Emphasis on testing patterns & practices https://red.ht/quarkus-spring-devs Free copy (while they last)! Come see me at the Red Hat booth! 2:00 PM today!