SlideShare a Scribd company logo
How we were building microservices with
AWS Step functions, Java and Micronaut
Andrew Zakordonets
• Software Engineer in Test
• 10+ years in Software Testing and
Automation
• Working on building tools and test
automation
Contact:
http://biercoff.com
What are we gonna talk about
What we wanted to build
Why serverless java
Why serverless java
Why serverless java
Challenges while building java serverless
Slow cold start
Challenges while building java serverless
Slow cold start
Package size
Java 11 and Jlink
AWS Reality
Custom runtime
Maybe solution : ghadishayban/lambdaclj-jdk11
Partial solution : andthearchitect/aws-lambda-java-runtime
Writing Java Serverless Application Using Micronaut
What is cool about Micronaut ?
What is cool about Micronaut ?
What is cool about Micronaut ?
What is cool about Micronaut ?
What is cool about Micronaut ?
What is cool about Micronaut ?
Micronaut
Java Lambda 101
Java Lambda 101
Java Lambda with Micronaut
ApiGateway Integration
Authorizers
Authorizers
Layers
Layers
Micronaut vs Spring
Topic Micronaut Spring
Package size 9.56 Mb 12.33 Mb
Cold start 4,91s 11,23s
Average Response Time
(20 single thread calls)
205,48ms 201,31ms
Small performance test
Measurement Micronaut Spring
data received 3.6 MB 357 kB/s 168 kB 17 kB/s
data sent 376 kB 38 kB/s 16 kB 1.6 kB/s
http req blocked avg=16.4ms avg=120.07ms
http req connecting avg=2.38ms avg=19.87ms
http req duration avg=118.43ms avg=73.67ms
http req receiving avg=41.46µs avg=47.94µs
http req sending avg=53.63µs avg=84.88µs
http req tls handshaking avg=13.98ms avg=96.91ms
http req waiting avg=118.34ms avg=73.54ms
http reqs 7370 736.981504/s 149 14.899509/s
iteration duration avg=135.25ms avg=194.13ms
iterations 7370 736.981504/s 149 14.899509/s
vus 100 min=100 max=100 100 min=100 max=100
x21
x49
x7
x7.5
x8
x49
k6 runs 100 concurrent users for 10 seconds
Performance test
k6 runs 100 concurrent users for 2.30 minutes
No Timeout Cold start No Timeout Warm Run
Measurement Micronaut Spring Micronaut Spring
data_received 135 MB 899 kB/s 132 MB 879 kB/s 138 MB 921 kB/s 140 MB 934 kB/s
data_sent 14 MB 92 kB/s 12 MB 82 kB/s 14 MB 94 kB/s 13 MB 87 kB/s
http_req_blocked avg=90.18µs avg=100.01µ avg=98.48µs avg=98.28µs
http_req_connecting avg=3.67µs avg=4.93µs avg=4.07µs avg=3.75µs
http_req_duration avg=44.97ms avg=49.72ms avg=42.78ms avg=43.64ms
http_req_receiving avg=65.62µs avg=57.91µs avg=77.16µs avg=72.14µs
http_req_sending avg=56.01µs avg=52.19µs avg=62.69µs avg=59.51µs
http_req_tls_handshakin
g
avg=74.99µs avg=82.54µs avg=82.71µs avg=82.77µs
http_req_waiting avg=44.85ms avg=49.61ms avg=42.64ms avg=43.51ms
http_reqs 320282 2135.211415/s 285380 1902.533106/s 328002 2186.679027/s 302944 2019.625563/s
iteration_duration avg=46.76ms avg=52.49ms avg=45.65ms avg=49.44ms
iterations 320268 2135.118082/s 285374 1902.493106/s 328002 2186.679027/s 302941 2019.605563/s
vus 100 min=100 max=100 100 min=100 max=100 100 min=100 max=100 100 min=100 max=100
Performance test
k6 runs 100 concurrent users for 2.30 minutes
500 ms Timout Cold start 500 ms Timout Warm Run
Measurement Micronaut Spring Micronaut Spring
data_received 12 MB 77 kB/s 12 MB 80 kB/s 12 MB 80 kB/s 15 MB 103 kB/s
data_sent 1.2 MB 7.9 kB/s 1.1 MB 7.5 kB/s 1.2 MB 8.1 kB/s 1.5 MB 9.8 kB/s
http_req_blocked avg=1.08ms avg=1.12ms avg=1.14ms avg=1.67ms
http_req_connecting avg=32.11µs avg=36.52µs avg=57.22µs avg=210.13µs
http_req_duration avg=571.38ms avg=601.53ms avg=552.47ms avg=549.94ms
http_req_receiving avg=56.38µs avg=43.47µs avg=39.4µs avg=43.73µs
http_req_sending avg=67.63µs avg=56.32µs avg=51.9µs avg=62µs
http_req_tls_handshakin
g
avg=972.25µs avg=988.19µs avg=946.87µs avg=1.38ms
http_req_waiting avg=571.26ms avg=601.43ms avg=552.37ms avg=549.83ms
http_reqs 26127 174.17983/s 24833 165.553143/s 27010 180.06652/s 27102 180.679695/s
iteration_duration avg=572.95ms avg=603.03ms avg=554.27ms avg=552.36ms
iterations 26127 174.17983/s 24833 165.553143/s 27010 180.06652/s 27102 180.679695/s
vus
100 min=100
max=100
100 min=100
max=100
100 min=100
max=100
100 min=100
max=100
Performance test summary
Logging
Log4j -> tiny log
GraalVM
Conclusions
The end
Q&A

More Related Content

PPTX
cPanel - Apache Global Configuration
PDF
Donatas Mažionis, Building low latency web APIs
PDF
Quarkus - a shrink ray to your Java Application
PPTX
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
PDF
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
PDF
On the way to low latency (2nd edition)
PDF
Building a better web
PPTX
AcornCache Presentation at Boston Ruby Group
cPanel - Apache Global Configuration
Donatas Mažionis, Building low latency web APIs
Quarkus - a shrink ray to your Java Application
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
On the way to low latency (2nd edition)
Building a better web
AcornCache Presentation at Boston Ruby Group

What's hot (20)

PPT
Understanding
PDF
Altitude SF 2017: The power of the network
PDF
Altitude SF 2017: Debugging Fastly VCL 101
PPTX
Avatar Maven
PDF
How to cache your static resources
PDF
Load Testing with JMeter, BlazeMeter, New Relic
ODP
Caching for Cash - Part 4
PPTX
Altitude SF 2017: Reddit - How we built and scaled r/place
ODP
Caching for Cash, part 4 DPC 2009
ODP
Frontend Caching - The "new" frontier
PPTX
Артем Оробец «На пути к low-latency»
PDF
Altitude SF 2017: Advanced VCL: Shielding and Clustering
PDF
WordPress At Scale. WordCamp Dhaka 2019
PDF
Load testing Java & Docker
PDF
Using Server-Timing for App and CDN Monitoring
PPTX
Benchmarking NGINX for Accuracy and Results
ODP
Coping with Cyber Monday
PDF
Revisiting HTTP/2
PDF
Tips for going fast in a slow world: Michael May at OSCON 2015
ZIP
Dynomite at Erlang Factory
Understanding
Altitude SF 2017: The power of the network
Altitude SF 2017: Debugging Fastly VCL 101
Avatar Maven
How to cache your static resources
Load Testing with JMeter, BlazeMeter, New Relic
Caching for Cash - Part 4
Altitude SF 2017: Reddit - How we built and scaled r/place
Caching for Cash, part 4 DPC 2009
Frontend Caching - The "new" frontier
Артем Оробец «На пути к low-latency»
Altitude SF 2017: Advanced VCL: Shielding and Clustering
WordPress At Scale. WordCamp Dhaka 2019
Load testing Java & Docker
Using Server-Timing for App and CDN Monitoring
Benchmarking NGINX for Accuracy and Results
Coping with Cyber Monday
Revisiting HTTP/2
Tips for going fast in a slow world: Michael May at OSCON 2015
Dynomite at Erlang Factory
Ad

Similar to Writing Java Serverless Application Using Micronaut (20)

PPTX
Writing Serverless Application in Java with comparison of 3 approaches: AWS S...
PDF
Introduction to performance tuning perl web applications
PDF
Microservices with Micronaut
PDF
Microservices with Micronaut
PDF
Tales from Taming the Long Tail
PPTX
Nginx Scalable Stack
PDF
"Load Testing Distributed Systems with NBomber 4.0", Anton Moldovan
PDF
DevoxxUK: Optimizating Application Performance on Kubernetes
PDF
[Outdated] Secrets of Performance Tuning Java on Kubernetes
PDF
Where Django Caching Bust at the Seams
PPTX
Run Node Run
PPTX
Aerospike & GCE (LSPE Talk)
PDF
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
PDF
JEEconf 2017
PDF
Optimizing Uptime in SOA
PDF
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
PDF
Docker tips-for-java-developers
PPTX
Jenkins Online Meetup - Automated SLI based Build Validation with Keptn
PDF
Secrets of Performance Tuning Java on Kubernetes
ODP
Otimizando seu projeto Rails
Writing Serverless Application in Java with comparison of 3 approaches: AWS S...
Introduction to performance tuning perl web applications
Microservices with Micronaut
Microservices with Micronaut
Tales from Taming the Long Tail
Nginx Scalable Stack
"Load Testing Distributed Systems with NBomber 4.0", Anton Moldovan
DevoxxUK: Optimizating Application Performance on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
Where Django Caching Bust at the Seams
Run Node Run
Aerospike & GCE (LSPE Talk)
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
JEEconf 2017
Optimizing Uptime in SOA
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Docker tips-for-java-developers
Jenkins Online Meetup - Automated SLI based Build Validation with Keptn
Secrets of Performance Tuning Java on Kubernetes
Otimizando seu projeto Rails
Ad

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Geodesy 1.pptx...............................................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Welding lecture in detail for understanding
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Well-logging-methods_new................
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT 4 Total Quality Management .pptx
DOCX
573137875-Attendance-Management-System-original
PDF
composite construction of structures.pdf
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
web development for engineering and engineering
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Foundation to blockchain - A guide to Blockchain Tech
Geodesy 1.pptx...............................................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Welding lecture in detail for understanding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Well-logging-methods_new................
Model Code of Practice - Construction Work - 21102022 .pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Lecture Notes Electrical Wiring System Components
Automation-in-Manufacturing-Chapter-Introduction.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT 4 Total Quality Management .pptx
573137875-Attendance-Management-System-original
composite construction of structures.pdf
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Mechanical Engineering MATERIALS Selection
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
web development for engineering and engineering

Writing Java Serverless Application Using Micronaut

  • 1. How we were building microservices with AWS Step functions, Java and Micronaut
  • 2. Andrew Zakordonets • Software Engineer in Test • 10+ years in Software Testing and Automation • Working on building tools and test automation Contact: http://biercoff.com
  • 3. What are we gonna talk about
  • 4. What we wanted to build
  • 8. Challenges while building java serverless Slow cold start
  • 9. Challenges while building java serverless Slow cold start Package size
  • 10. Java 11 and Jlink
  • 12. Custom runtime Maybe solution : ghadishayban/lambdaclj-jdk11 Partial solution : andthearchitect/aws-lambda-java-runtime
  • 14. What is cool about Micronaut ?
  • 15. What is cool about Micronaut ?
  • 16. What is cool about Micronaut ?
  • 17. What is cool about Micronaut ?
  • 18. What is cool about Micronaut ?
  • 19. What is cool about Micronaut ? Micronaut
  • 22. Java Lambda with Micronaut
  • 28. Micronaut vs Spring Topic Micronaut Spring Package size 9.56 Mb 12.33 Mb Cold start 4,91s 11,23s Average Response Time (20 single thread calls) 205,48ms 201,31ms
  • 29. Small performance test Measurement Micronaut Spring data received 3.6 MB 357 kB/s 168 kB 17 kB/s data sent 376 kB 38 kB/s 16 kB 1.6 kB/s http req blocked avg=16.4ms avg=120.07ms http req connecting avg=2.38ms avg=19.87ms http req duration avg=118.43ms avg=73.67ms http req receiving avg=41.46µs avg=47.94µs http req sending avg=53.63µs avg=84.88µs http req tls handshaking avg=13.98ms avg=96.91ms http req waiting avg=118.34ms avg=73.54ms http reqs 7370 736.981504/s 149 14.899509/s iteration duration avg=135.25ms avg=194.13ms iterations 7370 736.981504/s 149 14.899509/s vus 100 min=100 max=100 100 min=100 max=100 x21 x49 x7 x7.5 x8 x49 k6 runs 100 concurrent users for 10 seconds
  • 30. Performance test k6 runs 100 concurrent users for 2.30 minutes No Timeout Cold start No Timeout Warm Run Measurement Micronaut Spring Micronaut Spring data_received 135 MB 899 kB/s 132 MB 879 kB/s 138 MB 921 kB/s 140 MB 934 kB/s data_sent 14 MB 92 kB/s 12 MB 82 kB/s 14 MB 94 kB/s 13 MB 87 kB/s http_req_blocked avg=90.18µs avg=100.01µ avg=98.48µs avg=98.28µs http_req_connecting avg=3.67µs avg=4.93µs avg=4.07µs avg=3.75µs http_req_duration avg=44.97ms avg=49.72ms avg=42.78ms avg=43.64ms http_req_receiving avg=65.62µs avg=57.91µs avg=77.16µs avg=72.14µs http_req_sending avg=56.01µs avg=52.19µs avg=62.69µs avg=59.51µs http_req_tls_handshakin g avg=74.99µs avg=82.54µs avg=82.71µs avg=82.77µs http_req_waiting avg=44.85ms avg=49.61ms avg=42.64ms avg=43.51ms http_reqs 320282 2135.211415/s 285380 1902.533106/s 328002 2186.679027/s 302944 2019.625563/s iteration_duration avg=46.76ms avg=52.49ms avg=45.65ms avg=49.44ms iterations 320268 2135.118082/s 285374 1902.493106/s 328002 2186.679027/s 302941 2019.605563/s vus 100 min=100 max=100 100 min=100 max=100 100 min=100 max=100 100 min=100 max=100
  • 31. Performance test k6 runs 100 concurrent users for 2.30 minutes 500 ms Timout Cold start 500 ms Timout Warm Run Measurement Micronaut Spring Micronaut Spring data_received 12 MB 77 kB/s 12 MB 80 kB/s 12 MB 80 kB/s 15 MB 103 kB/s data_sent 1.2 MB 7.9 kB/s 1.1 MB 7.5 kB/s 1.2 MB 8.1 kB/s 1.5 MB 9.8 kB/s http_req_blocked avg=1.08ms avg=1.12ms avg=1.14ms avg=1.67ms http_req_connecting avg=32.11µs avg=36.52µs avg=57.22µs avg=210.13µs http_req_duration avg=571.38ms avg=601.53ms avg=552.47ms avg=549.94ms http_req_receiving avg=56.38µs avg=43.47µs avg=39.4µs avg=43.73µs http_req_sending avg=67.63µs avg=56.32µs avg=51.9µs avg=62µs http_req_tls_handshakin g avg=972.25µs avg=988.19µs avg=946.87µs avg=1.38ms http_req_waiting avg=571.26ms avg=601.43ms avg=552.37ms avg=549.83ms http_reqs 26127 174.17983/s 24833 165.553143/s 27010 180.06652/s 27102 180.679695/s iteration_duration avg=572.95ms avg=603.03ms avg=554.27ms avg=552.36ms iterations 26127 174.17983/s 24833 165.553143/s 27010 180.06652/s 27102 180.679695/s vus 100 min=100 max=100 100 min=100 max=100 100 min=100 max=100 100 min=100 max=100
  • 37. Q&A