> Markdown version of [/videos/2075-practical-performance-tuning-for-serverless-java-on-aws](https://www.wearedevelopers.com/videos/2075-practical-performance-tuning-for-serverless-java-on-aws). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Practical performance tuning for Serverless Java on AWS Are high cold start latencies crippling your Serverless Java workloads? Discover how to slash P90 execution times to under two seconds using AWS Lambda SnapStart and GraalVM Native Image. - **Speakers:** [Vadym Kazulkin](https://www.wearedevelopers.com/@vadym-kazulkin) - **Event:** World Congress 2026 Europe - Virtual Stage - **Published:** July 2, 2026 - **Duration:** 43:35 - **URL:** https://www.wearedevelopers.com/videos/2075-practical-performance-tuning-for-serverless-java-on-aws ## Summary Serverless Java deployments on AWS Lambda often struggle with high cold start latency, a challenge compounded when introducing heavy frameworks like Hibernate ORM or migrating from NoSQL (DynamoDB) to relational databases like Aurora DSQL. Because Java relies on lazy class loading and complex runtime initialization, unoptimized execution environments can stall up to seven seconds during scale-out events. This latency directly impacts application responsiveness, necessitating targeted optimization strategies that balance raw performance with operational overhead. A highly effective, managed approach to reducing this overhead is combining AWS Lambda SnapStart with resource priming. SnapStart alters the deployment lifecycle by running static initializers ahead of time and snapshotting the execution environment. Developers can further optimize this by utilizing CRaC API hooks to prime the environment—executing fake database requests to pre-initialize HTTP clients, HikariPool connections, and Jackson mappers. This technique converts lazy loading to eager loading before the snapshot is taken, reliably bringing P90 cold starts down to under two seconds without entirely sacrificing the flexibility of standard JVMs. For workloads demanding strict millisecond-latency, GraalVM Native Image offers ahead-of-time compilation that dramatically shrinks both cold start times and memory footprint. However, this raw performance comes at the cost of immense deployment complexity. GraalVM enforces a closed-world assumption, requiring exhaustive reflection configuration and tracing agents that can easily break during minor framework dependency updates, particularly when handling bytecode enhancement in Hibernate. Ultimately, teams must choose between the manageable maintenance of SnapStart and the aggressive, low-latency execution of GraalVM, avoiding experimental Project Leyden caches on managed runtimes due to dynamic background patching. **Keywords:** serverless java optimization, aws lambda cold starts, aurora dsql performance, dynamodb integration, hibernate orm latency, hikaripool management, lambda snapstart configuration, crac api priming, graalvm native image, ahead-of-time compilation, java lazy loading mitigation, execution environment snapshotting, project leyden limitations, jdbc serverless scaling ## Chapters 1. **Hosting serverless Java web applications on AWS** (00:01) — Using AWS Lambda and API Gateway enables scalable application hosting while minimizing operational overhead. 1. **Scaling relational databases with serverless Aurora DSQL** (01:11) — Aurora DSQL provides a PostgreSQL-compatible serverless database that scales without exhausting connection pools. 1. **Comparing DynamoDB, JDBC, and Hibernate in serverless applications** (02:58) — A sample product API demonstrates implementation differences between DynamoDB, plain JDBC, and Hibernate ORM. 1. **Understanding AWS Lambda execution environments and cold starts** (08:24) — The lifecycle of Lambda execution environments introduces latency through JVM initialization and class loading. 1. **Measuring baseline performance for serverless Java frameworks** (11:30) — Initial benchmarking reveals multi-second cold starts when using frameworks like Hibernate on AWS Lambda. 1. **Reducing cold start latency with AWS Lambda SnapStart** (15:24) — SnapStart captures a snapshot of the initialized execution environment to accelerate subsequent function invocations. 1. **Pre-initializing application state using snapshot priming techniques** (17:48) — Eagerly loading classes and database connections before a snapshot is taken drastically improves restore times. 1. **Analyzing performance gains from SnapStart and priming techniques** (23:55) — Combining SnapStart with API gateway request priming reduces cold start latency to under two seconds. 1. **Additional techniques for optimizing AWS Lambda function performance** (27:55) — Adjusting architecture type, memory allocation, and HTTP clients provides further incremental performance improvements. 1. **Ahead-of-time compilation using GraalVM native image** (29:23) — Compiling Java applications into native executables reduces memory footprint and significantly accelerates startup times. 1. **Overcoming configuration challenges with GraalVM and Hibernate** (31:35) — Generating reflection and resource metadata is required to successfully compile dynamic frameworks into native images. 1. **Comparing GraalVM performance against SnapStart and priming** (33:48) — GraalVM native image outperforms SnapStart in raw startup speed but requires complex build-time configurations. 1. **Exploring Spring Boot, managed instances, and Project Leyden** (37:38) — Emerging deployment models offer alternative scaling characteristics and initialization strategies for complex Java workloads. 1. **Choosing the right optimization strategy for serverless Java** (41:39) — Selecting between SnapStart and GraalVM depends entirely on the application latency requirements and framework complexity. ## Related Moments - [Optimizing Java startup processes for fast serverless workloads](https://www.wearedevelopers.com/videos/1008-serverless-java-in-action-cloud-agnostic-design-patterns-and-tips) (from "Serverless Java in Action: Cloud Agnostic Design Patterns and Tips") - [Optimizing application performance via GraalVM native images](https://www.wearedevelopers.com/videos/537-bootiful-spring-boot-3) (from "Bootiful Spring Boot 3") - [Why Java lags in serverless adoption on AWS](https://www.wearedevelopers.com/videos/1555-high-performance-serverless-java-on-aws) (from "High performance Serverless Java on AWS") - [Introduction to going serverless with Spring Framework](https://www.wearedevelopers.com/videos/443-going-serverless-using-the-spring-framework-ecosystem) (from "Going serverless using the Spring Framework ecosystem") - [Evolving serverless compute with Firecracker and SnapStart](https://www.wearedevelopers.com/videos/100214-20-years-of-solving-unsolvable-problems) (from "20 Years of Solving Unsolvable Problems") - [Goals of Project Leyden for JVM performance](https://www.wearedevelopers.com/videos/100161-supercharge-your-jvm-performance-with-project-leyden) (from "Supercharge your JVM performance with Project Leyden") ## Related Articles - [Making Data Warehouses Fast: A Developer’s Story](https://www.wearedevelopers.com/magazine/107-making-data-warehouses-fast-a-developer-s-story) - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) - [Top 10 Java Libraries](https://www.wearedevelopers.com/magazine/364-top-10-java-libraries) - [Dev Digest 120 - Apple and peers](https://www.wearedevelopers.com/magazine/455-dev-digest-120-apple-and-peers) ## Related Jobs - [Senior Backend Engineer (Java)](https://www.wearedevelopers.com/jobs/ext/19369-senior-backend-engineer-java) at **Bonial International GmbH** - [Principal Software Engineer](https://www.wearedevelopers.com/jobs/ext/149130-principal-software-engineer) at **Twilio** - [Software Engineer L2 - Cloud Infrastructure](https://www.wearedevelopers.com/jobs/ext/1282024-software-engineer-l2-cloud-infrastructure) at **Twilio** - [Software Engineer L3](https://www.wearedevelopers.com/jobs/ext/1840587-software-engineer-l3) at **Twilio** - [Software Engineer L2 - Cloud Infrastructure](https://www.wearedevelopers.com/jobs/ext/1644423-software-engineer-l2-cloud-infrastructure) at **Twilio** - [Lead Software Engineer - Data Engineering](https://www.wearedevelopers.com/jobs/ext/2000968-lead-software-engineer-data-engineering) at **Dynatrace**