-
AWSLambdaJavaSnapStart
Different examples of solutions API Gateway->Lambda->DynamoDB with Lambda managed Java runtimes with different Lambda memory settings, compilation options, (a)synchronous HTTP clients, Lambda layers, GC algorithms and hardware architecture (x86 vs arm64) including Lambda SnapStart enabling and priming techniques to measure Lambda performance
Let's look how to implement it with Quarkus. In the AWS SAM Template (template.yaml) we point the AWS Lambda function handler to the generic QuarkusStreamHandler implementation:
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
If we compare these metrics with AWS Lambda with plain Java (and AWS SDK for Java version 2) and Micronaut Framework with SnapStart enbled we'll notice that using the Micronaut Framework the average cold start with Quarkus is quite comparable with the first and better than the latter. If we compile our application with GraalVM Native Image and deploy our Lambda as Custom Runtime (which is beyond the scope if this article), we can further reduce the cold start to between 450 and 550ms, see the measurements for the comparable application.
-
Spring Boot
Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
In the next part of series we'll explore Spring Boot for writing Lambda functions and measure the cold start with and without enabling of the SnapSart.
-
Quarkus Framework is Kubernetes Native Java stack (personally I don't understand this term :)) tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards. For us it's important that this framework is very well suited for writing Serverless applications. Like Micronaut, it gives us the possibility to create our application using the launcher or CLI, provides API Gateway integration, GraalVM (Native Image) integation, supports Maven und Gradle and much more. It also supports MicroProfile and Funqy for multi cloud solutions. It also processes annotations at compile time and doesn't use reflection, runtime byte code generation, runtime generated proxies and dynamic class loading.
Related posts
-
Choosing the Right Java Microservices Framework: Spring Boot, Quarkus, Micronaut, and Beyond
-
Is it okay to use com.sun.net.httpserver.HttpServer?
-
why does java require tomcat?
-
Quarkus 2.0 Delivers Continuous Testing, CLI and Supports Minimal JDK 11
-
🏅 Http4k: Top 5 Server-Side Frameworks for Kotlin in 2022