SlideShare a Scribd company logo
1 of 79
Download to read offline
Adopting Java
for the Serverless world
GraalVM, AWS SnapStart and Co
Vadym Kazulkin, ip.labs, Voxxed Days Brussels , 23 May 2023
Contact
Vadym Kazulkin
ip.labs GmbH Bonn, Germany
Co-Organizer of the Java User Group Bonn
v.kazulkin@gmail.com
@VKazulkin
https://dev.to/vkazulkin
https://github.com/Vadym79/
https://www.linkedin.com/in/vadymkazulkin
https://www.iplabs.de/
ip.labs
https://www.iplabs.de/
Java popularity
https://distantjob.com/blog/programming-languages-rank/ Vadym Kazulkin @VKazulkin , ip.labs GmbH
AWS and Serverless
https://aws.amazon.com/de/blogs/aws/aws-named-as-a-leader-in-the-2022-gartner-cloud-infrastructure-platform-services-cips-magic-quadrant-for-the-12th-consecutive-year/
The State of Serverless 2022
https://www.datadoghq.com/state-of-serverless/
Vadym Kazulkin @VKazulkin , ip.labs GmbH
The State of Serverless 2021
https://www.datadoghq.com/state-of-serverless-2021
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Life of the Java (Serverless) developer
on AWS
AWS Java Versions Support
• Corretto Java 8
• With extended long-term support until 2026
• Coretto Java 11 (since 2019)
• Coretto Java 17 (April 2023)
• Only Long Term Support (LTS) by AWS
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: https://aws.amazon.com/de/corretto/
Java ist very fast
and mature
programming
language…
Image: burst.shopify.com/photos/a-look-across-the-landscape-with-view-of-the-sea
… but Serverless
adoption of Java
looks like this
Vadym Kazulkin @VKazulkin , ip.labs GmbH
The State of Serverless 2021
https://www.datadoghq.com/state-of-serverless-2021
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Developers love Java and will be happy
to use it for Serverless
But what are the challenges ?
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Serverless with Java challenges
• “cold start” times (latencies)
• memory footprint (high cost in AWS)
AWS Lambda Basics
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Creating AWS Lambda with Java 1/3
:
Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function
Full CPU access only
approx. at 1.8 GB
memory allocated
Creating AWS Lambda with Java 2/3
:
Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function
Creating AWS Lambda with Java 3/3
:
Source https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
AWS Lambda Price Model
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Cost for Lambda
REQUEST DURATION
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Request Tier
$ 0.20
Per 1 Mio Requests
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Duration Tier
$ 0.00001667 (x86)
$ 0.00001333 (Arm)
Per GB-Second
Vadym Kazulkin @VKazulkin , ip.labs GmbH
GB-Second
ONE SECOND ONE GB
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Example
• 1 Mio requests
• Lambda x86 with 512MiB
• Each lambda takes 200ms
0.5 GiB * 0.2 sec * 1 Mio
= 100 000 GB-Seconds
Requests:
$0.20
GB-Seconds:
$1.67
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Challenge Number 1 with Java is a
big cold-start
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: https://www.serverless.com/blog/keep-your-lambdas-warm
Function lifecycle- a full cold start
Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go
Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications
• Start Firecracker VM
• AWS Lambda starts the JVM
• Java runtime loads and initializes
handler class
• Static initializer block of the handler class is
executed (i.e. AWS service client creation)
• Init-phase has full CPU access up to 10 seconds for
free for the managed execution environments
• Lambda calls the handler method
Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go
Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications
Michael Hart: „Shave 99.93% off your Lambda bill with this one weird trick“ https://hichaelmart.medium.com/shave-99-93-off-your-lambda-bill-with-this-one-weird-trick-33c0acebb2ea
Lambda demo with common Java
application frameworks
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
These are best case values after applying
optimization techniques and best practices
• Switch to the AWS SDK 2.0 for Java
• Lower footprint and more modular
• Allows to configure HTTP Client of your choice (i.e. Java own Basic HTTP Client or
newly introduced AWS Common Runtime async HTTP Client)
Source: https://aws.amazon.com/de/blogs/developer/announcing-availability-of-the-aws-crt-http-client-in-the-aws-sdk-for-java-2-x/
Vadym Kazulkin: https://dev.to/aws-builders/aws-sdk-for-java-2x-asynchronous-http-clients-and-their-impact-on-cold-start-times-and-memory-consumption-of-aws-lambda-366p
S3AsyncClient.builder()
.httpClientBuilder(AwsCrtAsyncHttpClient.builder()
.maxConcurrency(50))
.build();
Best Practices and Recommendations
• Less (dependencies, classes) is more
• Include only required dependencies (e.g. not the whole AWS SDK 2.0 for Java, but the
dependencies to the clients to be used in Lambda)
• Exclude dependencies, which you don‘t need at runtime e.g. test frameworks like Junit
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>2.10.86</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.10.86</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Best Practices and Recommendations
AWS Lambda cold starts by memory size,
runtime and artifact size
Source: Mike Roberts "Analyzing Cold Start latency of AWS Lambda" https://blog.symphonia.io/posts/2020-06-30_analyzing_cold_start_latency_of_aws_lambda
Artifact Size:
• Small zip (1KB)
• Large zip (48MB)
• Large uberjar (53MB)
Provide all known values (for building clients i.e. DynamoDB client) to
avoid auto-discovery
• credential provider, region, endpoint
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
.withRegion(Regions.US_WEST_2)
.withCredentials(new ProfileCredentialsProvider("myProfile"))
.build();
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
Best Practices and Recommendations
• Initialize dependencies during initialization phase
• Use static initialization in the handler class, instead of in the handler method (e.g.
handleRequest) to take the advantage of the access to the full CPU core for max 10 seconds
• In case of DynamoDB client put the following code outside of the handler method:
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build();
DynamoDB dynamoDB = new DynamoDB(client);
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
Best Practices and Recommendations
Best Practices and Recommendations
• Prime dependencies during initialization phase (optionally)
• „Fake“ the calls to pre-initalize „some other expensive stuff“
• In case of DynamoDB client put the following code outside of the handler method to pre-
initialize the Jackson Marshaller:
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build();
DynamoDB dynamoDB = new DynamoDB(client);
Table table = dynamoDB.getTable(„mytable");
Item item = table.getItem("Id", 210);
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
getItem() call forces Jackson Marshallers to initialize
Best Practices and Recommendations
Using Tiered Compilation
Achieve up to 60% faster startup times can use level 1 compilation with
little risk of reducing warm start performance
Mark Sailes: "Optimizing AWS Lambda function performance for Java”
https://aws.amazon.com/de/blogs/compute/optimizing-aws-lambda-function-performance-for-java/
Avoid:
• reflection
• runtime byte code generation
• runtime generated proxies
• dynamic class loading
Use DI Frameworks which aren‘t reflection-based
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
Best Practices and Recommendations
Cost optimization techniques
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Best Practices and Recommendations
Cost for Lambda
REQUEST DURATION
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Cost scales
linearly with
memory
Vadym Kazulkin @VKazulkin , ip.labs GmbH
More memory = more expensive?
Kazulkin @VKazulkin , ip.labs GmbH
Lambda Power Tuning 1/2
• Executes different
settings in parallel
• Outputs the optimal
setting
Image: https://github.com/alexcasalboni/aws-lambda-power-tuning Vadym Kazulkin @VKazulkin , ip.labs GmbH
Lambda Power Tuning 2/2
• Executes different
settings in parallel
• Outputs the optimal
setting
Image: https://github.com/alexcasalboni/aws-lambda-power-tuning
Alex Casalboni: “Deep dive: finding the optimal resources allocation for your Lambda functions“
https://dev.to/aws/deep-dive-finding-the-optimal-resources-allocation-for-your-lambda-functions-35a6
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Optimizing AWS Lambda cost and
performance using AWS Compute
Optimizer
Source: Chad Schmutzer „Optimizing AWS Lambda cost and performance using AWS Compute Optimizer”
https://aws.amazon.com/de/blogs/compute/optimizing-aws-lambda-cost-and-performance-using-aws-compute-optimizer/
GraalVM enters the scene
Source: https://www.graalvm.org/
GraalVM
Goals:
Low footprint ahead-of-time mode for JVM-based languages
High performance for all languages
Convenient language interoperability and polyglot tooling
Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
GraalVM
Architecture
Sources: Practical Partial Evaluation for High-Performance Dynamic Language Runtimes http://chrisseaton.com/rubytruffle/pldi17-truffle/pldi17-truffle.pdf
„The LLVM Compiler Infrastructure“ https://llvm.org/
SubstrateVM
Source: Oleg Šelajev, Thomas Wuerthinger, Oracle: “Deep dive into using GraalVM for Java and JavaScript”
https://www.youtube.com/watch?v=a-XEZobXspo
GraalVM on SubstrateVM
A game changer for Java & Serverless?
Java Function compiled into a native executable using
GraalVM on SubstrateVM reduces
• “cold start” times
• memory footprint
by order of magnitude compared to running on JVM.
Current challenges with native
executable using GraalVM
• AWS doesn’t provide GraalVM (Native Image) as Java Runtime out
of the box
• AWS provides Custom Runtime Option
Custom Lambda Runtimes
GraalVM Complitation Modes
Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
AOT vs JIT
Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
Support of GraalVM native images in
Frameworks
Spring Native project for Spring (Boot)
Quarkus: a Kubernetes Native Java framework developed by Red
Hat tailored for GraalVM and HotSpot, crafted from best-of-breed
Java libraries and standards.
Micronaut: a modern, JVM-based, full-stack framework for building
modular, easily testable microservice and serverless applications.
Common principles for all frameworks
• Rely on as little reflection as possible
• Avoid runtime byte code generation, runtime generated proxies and
dynamic class loading as much as possible
• Process annotations at compile time
• The common goals:
• increase developer productivity
• May decrease cold start times compared to plain Java solution (with and
without the usage of GraalVM Native Image) using various compile-time
optimization techniques
• Currently only available for Micronaut
Steps to deploy to AWS
• Installation prerequisites
• Framework of your choice (Micronaut, Quarkus, Spring Native)
• GraalVM and Native Image
• Apache Maven or Gradle
• AWS CLI and AWS SAM CLI (or SAM local for local testing)
• Build Linux executable of your application with GraalVM native-image
• Use Maven or Gradle plugin
• Deploy Linux executable as AWS Lambda Custom Runtime
• Function.zip with bootstrap Linux executable
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Micronaut Framework
Source: https://micronaut.io/
Micronaut Example
Build GraalVM Native Image with Quarkus
./mvnw package -Dpackaging=native-image
-Dmicronaut.runtime=lambda
Packaging can also have docker or
docker-native value
Lambda demo with common Java
application frameworks
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Frameworks Ready for Graal VM Native Image
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://www.graalvm.org/native-image/libraries-and-frameworks/
Graal VM Conclusion
• GraalVM and Frameworks are really powerful with a lot of potential
• GraalVM Native Image improves cold starts and memory footprint
significally
• GraalVM Native Image is currently not without challenges
• AWS Lambda Custom Runtime requires Linux executable only
• Building Custom Runtime requires some additional effort
• e.g. you need to scale CI pipeline to build memory-intensive native image yourself
• Build time is a factor
• You pay for the init-phase of the function packaged as AWS Lambda Custom and Docker
Runtime
• Init-phase is free for the managed runtimes like Java 8 , Java 11 and Java17 (Corretto)
AWS SnapStart Overview
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://aws.amazon.com/de/blogs/compute/starting-up-faster-with-aws-lambda-snapstart/
JVM create/resume
snapshot is based
on CRaC
AWS SnapStart Deployment and Invocation
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://aws.amazon.com/de/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/
• Speed up warmup time of the Java applications
• The C2 compiler is used for very hot methods, which uses profiling data
collected from the running application to optimize as much as possible.
• Techniques like aggressive method inlining and speculative optimizations can
easily lead to better performing code than generated ahead of time (AOT)
using a static compiler.
• JVM needs both time and compute resources to determine which methods to
compile and compiling them. This same work has to happen every time we
run an application
• Ideally, we would like to run the application and then store all the state about
the compiled methods, even the compiled code and state associated with the
application and then we’d like to be able to restore it
https://www.azul.com/blog/superfast-application-startup-java-on-crac/
Ideas behind CRaC (Coordinated Restore
at Checkpoint)
CRaC (Coordinated Restore at Checkpoint)
• Linux Checkpoint/Restore in Userspace (CRIU) available since 2012 allows a
running application to be paused and restarted at some point later in time,
potentially on a different machine.
• The overall goal of the project is to support the migration of containers.
• When performing a checkpoint, essentially, the full context of the process is saved:
program counter, registers, stacks, memory-mapped and shared memory
• To restore the application, all this data can be reloaded and (theoretically) it
continues from the same point.
• Challenges
• open files
• network connections
• sudden change in the value of the system clock
https://www.azul.com/blog/superfast-application-startup-java-on-crac/
https://github.com/CRaC/docs
https://criu.org/Main_Page
CRaC (Coordinated Restore at Checkpoint)
• CRaC (Coordinated Restore at Checkpoint) Project
• Based on Linux Checkpoint/Restore in Userspace (CRIU)
• Simple API: beforeCheckpoint() and afterRestore() methods
https://www.azul.com/blog/superfast-application-startup-java-on-crac/
https://github.com/CRaC/docs
https://criu.org/Main_Page
AWS SnapStart Deployment and Invocation
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
AWS SAM:
GetProductByIdFunction:
Type: AWS::Serverless::Function
Properties:
AutoPublishAlias: SnapStart
SnapStart:
ApplyOn: PublishedVersions
AWS SnapStart Deployment and Invocation
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
AWS SnapStart enabled with Pure Java Priming
<groupId>io.github.crac</groupId>
<artifactId>org-crac</artifactId>
<version>0.1.3</version>
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
AWS SnapStart enabled with Micronaut Priming
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
AWS SnapStart enabled comparison
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
AWS SnapStart with Micronaut extended Priming
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
AWS SnapStart enabled with Priming
comparison
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
AWS SnapStart Challenges & Limitations
Vadym Kazulkin @VKazulkin , ip.labs GmbH
One big challenge: not the complete cold start time is shown in the
CloudWatch queries measuring it with SnapStart enabled
• Snapshot restore outside of Lambda are currently not captured
• Measure end to end API Gateway request latency to see
the total cold +warm start
AWS SnapStart enabled API Gateway Latency
with Priming comparison
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
AWS SnapStart Challenges & Limitations
• SnapStart supports the Java 11 and 17 (Corretto) managed runtime only
• Deployment with SnapStart enabled takes more than 2,5 minutes additionally
• SnapStart currently does not support :
• Provisioned concurrency
• arm64 architecture (supports only x86)
• Amazon Elastic File System (Amazon EFS)
• Ephemeral storage greater than 512 MB
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html
www.iplabs.de
Accelerate Your Photo Business
Get in Touch

More Related Content

What's hot

Bypass file upload restrictions
Bypass file upload restrictionsBypass file upload restrictions
Bypass file upload restrictionsMukesh k.r
 
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim HegazyHackIT Ukraine
 
Security and Viruses
Security and VirusesSecurity and Viruses
Security and VirusesAmrit Kaur
 
Methods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngMethods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngDmitry Evteev
 
Owasp top 10 security threats
Owasp top 10 security threatsOwasp top 10 security threats
Owasp top 10 security threatsVishal Kumar
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & InconsistencyGreenD0g
 
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Christian Schneider
 
Dataclasses en Python 3.7: Empieza a borrar código
Dataclasses en Python 3.7: Empieza a borrar códigoDataclasses en Python 3.7: Empieza a borrar código
Dataclasses en Python 3.7: Empieza a borrar códigoJacobo de Vera
 
CLASS 12 BEST BIOLOGY PROJECT AIDS
CLASS 12 BEST  BIOLOGY PROJECT AIDSCLASS 12 BEST  BIOLOGY PROJECT AIDS
CLASS 12 BEST BIOLOGY PROJECT AIDSsatyendraverma23
 
Node.js Event Emitter
Node.js Event EmitterNode.js Event Emitter
Node.js Event EmitterEyal Vardi
 
Paramyxovirus: Dr Kamlesh Patel
Paramyxovirus: Dr Kamlesh PatelParamyxovirus: Dr Kamlesh Patel
Paramyxovirus: Dr Kamlesh Patelwww.jaailab.com
 
Introduction to WAF and Network Application Security
Introduction to WAF and Network Application SecurityIntroduction to WAF and Network Application Security
Introduction to WAF and Network Application SecurityAlibaba Cloud
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesAbraham Aranguren
 

What's hot (20)

Animal viruses
Animal virusesAnimal viruses
Animal viruses
 
Bypass file upload restrictions
Bypass file upload restrictionsBypass file upload restrictions
Bypass file upload restrictions
 
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
 
Docker + WASM.pdf
Docker + WASM.pdfDocker + WASM.pdf
Docker + WASM.pdf
 
Security and Viruses
Security and VirusesSecurity and Viruses
Security and Viruses
 
Methods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngMethods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall Eng
 
Catching fileless attacks
Catching fileless attacksCatching fileless attacks
Catching fileless attacks
 
Owasp top 10 security threats
Owasp top 10 security threatsOwasp top 10 security threats
Owasp top 10 security threats
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & Inconsistency
 
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
 
Ethical hacking with Python tools
Ethical hacking with Python toolsEthical hacking with Python tools
Ethical hacking with Python tools
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Dataclasses en Python 3.7: Empieza a borrar código
Dataclasses en Python 3.7: Empieza a borrar códigoDataclasses en Python 3.7: Empieza a borrar código
Dataclasses en Python 3.7: Empieza a borrar código
 
CLASS 12 BEST BIOLOGY PROJECT AIDS
CLASS 12 BEST  BIOLOGY PROJECT AIDSCLASS 12 BEST  BIOLOGY PROJECT AIDS
CLASS 12 BEST BIOLOGY PROJECT AIDS
 
File system node js
File system node jsFile system node js
File system node js
 
Node.js Event Emitter
Node.js Event EmitterNode.js Event Emitter
Node.js Event Emitter
 
Paramyxovirus: Dr Kamlesh Patel
Paramyxovirus: Dr Kamlesh PatelParamyxovirus: Dr Kamlesh Patel
Paramyxovirus: Dr Kamlesh Patel
 
Introduction to WAF and Network Application Security
Introduction to WAF and Network Application SecurityIntroduction to WAF and Network Application Security
Introduction to WAF and Network Application Security
 
Cookies
CookiesCookies
Cookies
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 

Similar to Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023

Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022Vadym Kazulkin
 
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...Vadym Kazulkin
 
Adopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays LuxemburgAdopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays LuxemburgVadym Kazulkin
 
Adopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageAdopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageVadym Kazulkin
 
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...Vadym Kazulkin
 
Adopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyAdopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyVadym Kazulkin
 
Adopting Java for the Serverless world at JUG London
Adopting Java for the Serverless world at  JUG LondonAdopting Java for the Serverless world at  JUG London
Adopting Java for the Serverless world at JUG LondonVadym Kazulkin
 
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonAdopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonVadym Kazulkin
 
Adopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaAdopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaVadym Kazulkin
 
Adopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeAdopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeVadym Kazulkin
 
Adopting Java for the Serverless world at JUG Hamburg
Adopting Java for the Serverless world at  JUG HamburgAdopting Java for the Serverless world at  JUG Hamburg
Adopting Java for the Serverless world at JUG HamburgVadym Kazulkin
 
Adapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaAdapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaVadym Kazulkin
 
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...Vadym Kazulkin
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold startsYan Cui
 
Serverless in Java Lessons learnt
Serverless in Java Lessons learntServerless in Java Lessons learnt
Serverless in Java Lessons learntKrzysztof Pawlowski
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
 

Similar to Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023 (20)

Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022
 
Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022
 
Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022
 
Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022
 
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
 
Adopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays LuxemburgAdopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays Luxemburg
 
Adopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageAdopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT Tage
 
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
 
Adopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyAdopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup Italy
 
Adopting Java for the Serverless world at JUG London
Adopting Java for the Serverless world at  JUG LondonAdopting Java for the Serverless world at  JUG London
Adopting Java for the Serverless world at JUG London
 
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonAdopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
 
Adopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaAdopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group Pretoria
 
Adopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeAdopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup Singapore
 
Adopting Java for the Serverless world at JUG Hamburg
Adopting Java for the Serverless world at  JUG HamburgAdopting Java for the Serverless world at  JUG Hamburg
Adopting Java for the Serverless world at JUG Hamburg
 
Adapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaAdapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG Barcelona
 
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold starts
 
Serverless in Java Lessons learnt
Serverless in Java Lessons learntServerless in Java Lessons learnt
Serverless in Java Lessons learnt
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
 

More from Vadym Kazulkin

Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...Vadym Kazulkin
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023Vadym Kazulkin
 
Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...Vadym Kazulkin
 
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...Vadym Kazulkin
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...Vadym Kazulkin
 
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022Vadym Kazulkin
 
Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021Vadym Kazulkin
 
Writing less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group NairobiWriting less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group NairobiVadym Kazulkin
 
Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021Vadym Kazulkin
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Vadym Kazulkin
 
Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021Vadym Kazulkin
 

More from Vadym Kazulkin (19)

Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
 
Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...
 
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
 
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...
 
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
 
Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022
 
Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021
 
Writing less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group NairobiWriting less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group Nairobi
 
Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 
Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 

Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023

  • 1. Adopting Java for the Serverless world GraalVM, AWS SnapStart and Co Vadym Kazulkin, ip.labs, Voxxed Days Brussels , 23 May 2023
  • 2. Contact Vadym Kazulkin ip.labs GmbH Bonn, Germany Co-Organizer of the Java User Group Bonn v.kazulkin@gmail.com @VKazulkin https://dev.to/vkazulkin https://github.com/Vadym79/ https://www.linkedin.com/in/vadymkazulkin https://www.iplabs.de/
  • 8. The State of Serverless 2022 https://www.datadoghq.com/state-of-serverless/ Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 9. The State of Serverless 2021 https://www.datadoghq.com/state-of-serverless-2021 Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 10. Life of the Java (Serverless) developer on AWS
  • 11. AWS Java Versions Support • Corretto Java 8 • With extended long-term support until 2026 • Coretto Java 11 (since 2019) • Coretto Java 17 (April 2023) • Only Long Term Support (LTS) by AWS Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: https://aws.amazon.com/de/corretto/
  • 12. Java ist very fast and mature programming language… Image: burst.shopify.com/photos/a-look-across-the-landscape-with-view-of-the-sea … but Serverless adoption of Java looks like this Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 13. The State of Serverless 2021 https://www.datadoghq.com/state-of-serverless-2021 Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 14. Developers love Java and will be happy to use it for Serverless But what are the challenges ? Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 15. Serverless with Java challenges • “cold start” times (latencies) • memory footprint (high cost in AWS)
  • 16. AWS Lambda Basics Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 17. Creating AWS Lambda with Java 1/3 : Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function Full CPU access only approx. at 1.8 GB memory allocated
  • 18. Creating AWS Lambda with Java 2/3 : Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function
  • 19. Creating AWS Lambda with Java 3/3 : Source https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
  • 20. AWS Lambda Price Model Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 21. Cost for Lambda REQUEST DURATION Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 22. Request Tier $ 0.20 Per 1 Mio Requests Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 23. Duration Tier $ 0.00001667 (x86) $ 0.00001333 (Arm) Per GB-Second Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 24. GB-Second ONE SECOND ONE GB Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 25. Example • 1 Mio requests • Lambda x86 with 512MiB • Each lambda takes 200ms 0.5 GiB * 0.2 sec * 1 Mio = 100 000 GB-Seconds Requests: $0.20 GB-Seconds: $1.67 Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 26. Challenge Number 1 with Java is a big cold-start Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: https://www.serverless.com/blog/keep-your-lambdas-warm
  • 27. Function lifecycle- a full cold start Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications
  • 28. • Start Firecracker VM • AWS Lambda starts the JVM • Java runtime loads and initializes handler class • Static initializer block of the handler class is executed (i.e. AWS service client creation) • Init-phase has full CPU access up to 10 seconds for free for the managed execution environments • Lambda calls the handler method Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications Michael Hart: „Shave 99.93% off your Lambda bill with this one weird trick“ https://hichaelmart.medium.com/shave-99-93-off-your-lambda-bill-with-this-one-weird-trick-33c0acebb2ea
  • 29. Lambda demo with common Java application frameworks Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples These are best case values after applying optimization techniques and best practices
  • 30. • Switch to the AWS SDK 2.0 for Java • Lower footprint and more modular • Allows to configure HTTP Client of your choice (i.e. Java own Basic HTTP Client or newly introduced AWS Common Runtime async HTTP Client) Source: https://aws.amazon.com/de/blogs/developer/announcing-availability-of-the-aws-crt-http-client-in-the-aws-sdk-for-java-2-x/ Vadym Kazulkin: https://dev.to/aws-builders/aws-sdk-for-java-2x-asynchronous-http-clients-and-their-impact-on-cold-start-times-and-memory-consumption-of-aws-lambda-366p S3AsyncClient.builder() .httpClientBuilder(AwsCrtAsyncHttpClient.builder() .maxConcurrency(50)) .build(); Best Practices and Recommendations
  • 31. • Less (dependencies, classes) is more • Include only required dependencies (e.g. not the whole AWS SDK 2.0 for Java, but the dependencies to the clients to be used in Lambda) • Exclude dependencies, which you don‘t need at runtime e.g. test frameworks like Junit Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2 <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.4.2</version> <scope>test</scope> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>dynamodb</artifactId> <version>2.10.86</version> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>bom</artifactId> <version>2.10.86</version> <type>pom</type> <scope>import</scope> </dependency> Best Practices and Recommendations
  • 32. AWS Lambda cold starts by memory size, runtime and artifact size Source: Mike Roberts "Analyzing Cold Start latency of AWS Lambda" https://blog.symphonia.io/posts/2020-06-30_analyzing_cold_start_latency_of_aws_lambda Artifact Size: • Small zip (1KB) • Large zip (48MB) • Large uberjar (53MB)
  • 33. Provide all known values (for building clients i.e. DynamoDB client) to avoid auto-discovery • credential provider, region, endpoint AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard() .withRegion(Regions.US_WEST_2) .withCredentials(new ProfileCredentialsProvider("myProfile")) .build(); Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ Best Practices and Recommendations
  • 34. • Initialize dependencies during initialization phase • Use static initialization in the handler class, instead of in the handler method (e.g. handleRequest) to take the advantage of the access to the full CPU core for max 10 seconds • In case of DynamoDB client put the following code outside of the handler method: AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build(); DynamoDB dynamoDB = new DynamoDB(client); Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ Best Practices and Recommendations
  • 35. Best Practices and Recommendations • Prime dependencies during initialization phase (optionally) • „Fake“ the calls to pre-initalize „some other expensive stuff“ • In case of DynamoDB client put the following code outside of the handler method to pre- initialize the Jackson Marshaller: AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build(); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.getTable(„mytable"); Item item = table.getItem("Id", 210); Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ getItem() call forces Jackson Marshallers to initialize
  • 36. Best Practices and Recommendations Using Tiered Compilation Achieve up to 60% faster startup times can use level 1 compilation with little risk of reducing warm start performance Mark Sailes: "Optimizing AWS Lambda function performance for Java” https://aws.amazon.com/de/blogs/compute/optimizing-aws-lambda-function-performance-for-java/
  • 37. Avoid: • reflection • runtime byte code generation • runtime generated proxies • dynamic class loading Use DI Frameworks which aren‘t reflection-based Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ Best Practices and Recommendations
  • 38. Cost optimization techniques Vadym Kazulkin @VKazulkin , ip.labs GmbH Best Practices and Recommendations
  • 39. Cost for Lambda REQUEST DURATION Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 40. Cost scales linearly with memory Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 41. More memory = more expensive? Kazulkin @VKazulkin , ip.labs GmbH
  • 42. Lambda Power Tuning 1/2 • Executes different settings in parallel • Outputs the optimal setting Image: https://github.com/alexcasalboni/aws-lambda-power-tuning Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 43. Lambda Power Tuning 2/2 • Executes different settings in parallel • Outputs the optimal setting Image: https://github.com/alexcasalboni/aws-lambda-power-tuning Alex Casalboni: “Deep dive: finding the optimal resources allocation for your Lambda functions“ https://dev.to/aws/deep-dive-finding-the-optimal-resources-allocation-for-your-lambda-functions-35a6 Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 44. Optimizing AWS Lambda cost and performance using AWS Compute Optimizer Source: Chad Schmutzer „Optimizing AWS Lambda cost and performance using AWS Compute Optimizer” https://aws.amazon.com/de/blogs/compute/optimizing-aws-lambda-cost-and-performance-using-aws-compute-optimizer/
  • 45. GraalVM enters the scene Source: https://www.graalvm.org/
  • 46. GraalVM Goals: Low footprint ahead-of-time mode for JVM-based languages High performance for all languages Convenient language interoperability and polyglot tooling Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
  • 47. GraalVM Architecture Sources: Practical Partial Evaluation for High-Performance Dynamic Language Runtimes http://chrisseaton.com/rubytruffle/pldi17-truffle/pldi17-truffle.pdf „The LLVM Compiler Infrastructure“ https://llvm.org/
  • 48. SubstrateVM Source: Oleg Šelajev, Thomas Wuerthinger, Oracle: “Deep dive into using GraalVM for Java and JavaScript” https://www.youtube.com/watch?v=a-XEZobXspo
  • 49. GraalVM on SubstrateVM A game changer for Java & Serverless? Java Function compiled into a native executable using GraalVM on SubstrateVM reduces • “cold start” times • memory footprint by order of magnitude compared to running on JVM.
  • 50. Current challenges with native executable using GraalVM • AWS doesn’t provide GraalVM (Native Image) as Java Runtime out of the box • AWS provides Custom Runtime Option
  • 52. GraalVM Complitation Modes Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
  • 53. AOT vs JIT Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
  • 54. Support of GraalVM native images in Frameworks Spring Native project for Spring (Boot) Quarkus: a Kubernetes Native Java framework developed by Red Hat tailored for GraalVM and HotSpot, crafted from best-of-breed Java libraries and standards. Micronaut: a modern, JVM-based, full-stack framework for building modular, easily testable microservice and serverless applications.
  • 55. Common principles for all frameworks • Rely on as little reflection as possible • Avoid runtime byte code generation, runtime generated proxies and dynamic class loading as much as possible • Process annotations at compile time • The common goals: • increase developer productivity • May decrease cold start times compared to plain Java solution (with and without the usage of GraalVM Native Image) using various compile-time optimization techniques • Currently only available for Micronaut
  • 56. Steps to deploy to AWS • Installation prerequisites • Framework of your choice (Micronaut, Quarkus, Spring Native) • GraalVM and Native Image • Apache Maven or Gradle • AWS CLI and AWS SAM CLI (or SAM local for local testing) • Build Linux executable of your application with GraalVM native-image • Use Maven or Gradle plugin • Deploy Linux executable as AWS Lambda Custom Runtime • Function.zip with bootstrap Linux executable Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 59. Build GraalVM Native Image with Quarkus ./mvnw package -Dpackaging=native-image -Dmicronaut.runtime=lambda Packaging can also have docker or docker-native value
  • 60. Lambda demo with common Java application frameworks Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples
  • 61. Frameworks Ready for Graal VM Native Image Vadym Kazulkin @VKazulkin , ip.labs GmbH https://www.graalvm.org/native-image/libraries-and-frameworks/
  • 62. Graal VM Conclusion • GraalVM and Frameworks are really powerful with a lot of potential • GraalVM Native Image improves cold starts and memory footprint significally • GraalVM Native Image is currently not without challenges • AWS Lambda Custom Runtime requires Linux executable only • Building Custom Runtime requires some additional effort • e.g. you need to scale CI pipeline to build memory-intensive native image yourself • Build time is a factor • You pay for the init-phase of the function packaged as AWS Lambda Custom and Docker Runtime • Init-phase is free for the managed runtimes like Java 8 , Java 11 and Java17 (Corretto)
  • 63. AWS SnapStart Overview Vadym Kazulkin @VKazulkin , ip.labs GmbH https://aws.amazon.com/de/blogs/compute/starting-up-faster-with-aws-lambda-snapstart/ JVM create/resume snapshot is based on CRaC
  • 64. AWS SnapStart Deployment and Invocation Vadym Kazulkin @VKazulkin , ip.labs GmbH https://aws.amazon.com/de/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/
  • 65. • Speed up warmup time of the Java applications • The C2 compiler is used for very hot methods, which uses profiling data collected from the running application to optimize as much as possible. • Techniques like aggressive method inlining and speculative optimizations can easily lead to better performing code than generated ahead of time (AOT) using a static compiler. • JVM needs both time and compute resources to determine which methods to compile and compiling them. This same work has to happen every time we run an application • Ideally, we would like to run the application and then store all the state about the compiled methods, even the compiled code and state associated with the application and then we’d like to be able to restore it https://www.azul.com/blog/superfast-application-startup-java-on-crac/ Ideas behind CRaC (Coordinated Restore at Checkpoint)
  • 66. CRaC (Coordinated Restore at Checkpoint) • Linux Checkpoint/Restore in Userspace (CRIU) available since 2012 allows a running application to be paused and restarted at some point later in time, potentially on a different machine. • The overall goal of the project is to support the migration of containers. • When performing a checkpoint, essentially, the full context of the process is saved: program counter, registers, stacks, memory-mapped and shared memory • To restore the application, all this data can be reloaded and (theoretically) it continues from the same point. • Challenges • open files • network connections • sudden change in the value of the system clock https://www.azul.com/blog/superfast-application-startup-java-on-crac/ https://github.com/CRaC/docs https://criu.org/Main_Page
  • 67. CRaC (Coordinated Restore at Checkpoint) • CRaC (Coordinated Restore at Checkpoint) Project • Based on Linux Checkpoint/Restore in Userspace (CRIU) • Simple API: beforeCheckpoint() and afterRestore() methods https://www.azul.com/blog/superfast-application-startup-java-on-crac/ https://github.com/CRaC/docs https://criu.org/Main_Page
  • 68. AWS SnapStart Deployment and Invocation Vadym Kazulkin @VKazulkin , ip.labs GmbH https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4 AWS SAM: GetProductByIdFunction: Type: AWS::Serverless::Function Properties: AutoPublishAlias: SnapStart SnapStart: ApplyOn: PublishedVersions
  • 69. AWS SnapStart Deployment and Invocation Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
  • 70. AWS SnapStart enabled with Pure Java Priming <groupId>io.github.crac</groupId> <artifactId>org-crac</artifactId> <version>0.1.3</version> Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
  • 71. AWS SnapStart enabled with Micronaut Priming Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
  • 72. AWS SnapStart enabled comparison Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
  • 73. AWS SnapStart with Micronaut extended Priming Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
  • 74. AWS SnapStart enabled with Priming comparison Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
  • 75. AWS SnapStart Challenges & Limitations Vadym Kazulkin @VKazulkin , ip.labs GmbH One big challenge: not the complete cold start time is shown in the CloudWatch queries measuring it with SnapStart enabled • Snapshot restore outside of Lambda are currently not captured • Measure end to end API Gateway request latency to see the total cold +warm start
  • 76. AWS SnapStart enabled API Gateway Latency with Priming comparison Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
  • 77. AWS SnapStart Challenges & Limitations • SnapStart supports the Java 11 and 17 (Corretto) managed runtime only • Deployment with SnapStart enabled takes more than 2,5 minutes additionally • SnapStart currently does not support : • Provisioned concurrency • arm64 architecture (supports only x86) • Amazon Elastic File System (Amazon EFS) • Ephemeral storage greater than 512 MB Vadym Kazulkin @VKazulkin , ip.labs GmbH https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html
  • 78.
  • 79. www.iplabs.de Accelerate Your Photo Business Get in Touch