{"id":16284991,"url":"https://github.com/goodforgod/awslambda-java-examples","last_synced_at":"2025-03-20T02:31:23.948Z","repository":{"id":192678895,"uuid":"357654397","full_name":"GoodforGod/awslambda-java-examples","owner":"GoodforGod","description":"🧪 AWS Lambda Java GraalVM examples \u0026 Benchmark.","archived":false,"fork":false,"pushed_at":"2023-09-14T08:50:17.000Z","size":609,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T13:46:27.048Z","etag":null,"topics":["aws","aws-lambda","benchmark","examples","lambda","micronaut","quarkus","simple-lambda","spring","spring-boot","spring-cloud-function"],"latest_commit_sha":null,"homepage":"http://goodforgod.dev/awslambda-java-examples/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodforGod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-13T18:37:20.000Z","updated_at":"2024-03-19T23:21:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4b204fd-9b26-4f4e-a35a-20989fedb712","html_url":"https://github.com/GoodforGod/awslambda-java-examples","commit_stats":null,"previous_names":["goodforgod/awslambda-java-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fawslambda-java-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fawslambda-java-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fawslambda-java-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fawslambda-java-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodforGod","download_url":"https://codeload.github.com/GoodforGod/awslambda-java-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538588,"owners_count":20468745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","benchmark","examples","lambda","micronaut","quarkus","simple-lambda","spring","spring-boot","spring-cloud-function"],"created_at":"2024-10-10T19:21:49.775Z","updated_at":"2025-03-20T02:31:23.016Z","avatar_url":"https://github.com/GoodforGod.png","language":"Java","readme":"# AWSLambda Java Examples\n\n[![Minimum required Java version](https://img.shields.io/badge/Java-17%2B-blue?logo=openjdk)](https://openjdk.org/projects/jdk/17/)\n[![GitHub Action](https://github.com/goodforgod/awslambda-java-examples/workflows/Benchmark%20Build-Time/badge.svg)](https://github.com/GoodforGod/awslambda-java-examples/actions?query=workflow%3A%22Benchmark%20Build-Time%22)\n\nRepository with AWSLambda examples for different frameworks Java Frameworks compiled\nfor [GraalVM](https://www.oracle.com/cis/java/graalvm/what-is-graalvm/) such:\n\n- [Micronaut](https://docs.micronaut.io/latest/guide/)\n- [Spring](https://docs.spring.io/spring-framework/reference/index.html)\n- [Quarkus](https://quarkus.io/guides/)\n- [SimpleLambda](https://github.com/GoodforGod/simple-awslambda)\n\n## Benchmark\n\nBenchmark tries to compare different Java frameworks that can be used to\nbuild [AWS Lambda Function](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html).\nBenchmark compares cold start time, hot start time, building process, etc.\n\n### GraalVM Versions\n\nAll examples use `GraalVM 22.3.0` cause at that time Spring \u0026 Quarkus latest available GraalVM build image\nwas `GraalVM 22.3.0`.\nThose frameworks are limited by their plugins/buildpacks/etc, so you **can't** use latest available GraalVM native image\nreleased, all depends on framework toolkit which upgrades with lag.\n\nThus, Micronaut \u0026 SimpleLambda have advantage as GraalVM building process \u0026 Jar building process can be *easily*\nindependent.\n\n### Framework Versions\n\n| Spring Boot | Spring Cloud | Micronaut | Quarkus | SimpleLambda | \n|-------------|--------------|-----------|---------|--------------|\n| 3.1.3       | 4.0.5        | 4.0.3     | 3.3.0   | 1.0.0        |\n\n### Cold Start\n\nTest data is collected based on 5 runs and average for each value is present in table below:\n\n| Framework     | Spring | Quarkus | Micronaut (Application) | Micronaut (Function) | SimpleLambda + Micronaut | SimpleLambda |\n|---------------|--------|---------|-------------------------|----------------------|--------------------------|--------------|\n| Build (ms)    | 527.4  | 349.0   | 442.8                   | 398.8                | 278.5                    | 237.1        |\n| Duration (ms) | 212.1  | 236.5   | 110.9                   | 63.2                 | 18.3                     | 31.8         |\n| Billed (ms)   | 739.8  | 586.0   | 554.2                   | 462.4                | 297.2                    | 282.6        |\n| Memory (Mb)   | 115    | 76      | 89                      | 83                   | 60                       | 52           |\n\n![](docs/cold-start-billed-time.png)\n\n### Hot Start\n\nTest data is collected based on 5 runs and average for each value is present in table below:\n\n| Framework     | Spring | Quarkus | Micronaut (Application) | Micronaut (Function) | SimpleLambda + Micronaut | SimpleLambda |\n|---------------|--------|---------|-------------------------|----------------------|--------------------------|--------------|\n| Duration (ms) | 2.9    | 1.2     | 1.9                     | 1.8                  | 1.4                      | 1.4          |\n| Billed (ms)   | 3.2    | 2.0     | 2.2                     | 2.0                  | 2.0                      | 2.0          |\n| Memory (Mb)   | 115    | 76      | 90                      | 84                   | 61                       | 53           |\n\nHot start billed time is same across all competitors cause when function is instantiated it performs relatively fast.\n\n![](docs/hot-start-memory.png)\n\n### Build Time\n\nData is based on build benchmark\nin [GitHub CI action](https://github.com/GoodforGod/awslambda-java-examples/actions/runs/6077660352):\n\n| Framework        | Spring | Quarkus | Micronaut (Application) | Micronaut (Function) | SimpleLambda + Micronaut | SimpleLambda |\n|------------------|--------|---------|-------------------------|----------------------|--------------------------|--------------|\n| Build Time (sec) | 500    | 427     | 298                     | 293                  | 185                      | 200          |\n\n![](docs/function-build-time.png)\n\n### Build Size\n\nResult function `zip` archive size in Mb:\n\n| Framework | Spring | Quarkus | Micronaut (Application) | Micronaut (Function) | SimpleLambda + Micronaut | SimpleLambda |\n|-----------|--------|---------|-------------------------|----------------------|--------------------------|--------------|\n| Size (Mb) | 23.9   | 14.7    | 16.9                    | 15.7                 | 11.2                     | 9.86         |\n\n![](docs/function-size.png)\n\n### Functionality\n\nTable with some useful and interesting functionality that some frameworks provides, so it won't look that some\nframeworks are bad and others are great.\n\n| Framework           | Spring                                                                                                                         | Quarkus                                                                  | Micronaut (Application)                                                                                                                                                    | Micronaut (Function)                                                                                                                                                       | SimpleLambda + Micronaut                                                                                                                                        | SimpleLambda                                                                                                                                                    |\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| DI \u0026 IoC            | ✔️                                                                                                                             | ✔️                                                                       | ✔️                                                                                                                                                                         | ❌                                                                                                                                                                          | ✔️                                                                                                                                                              | ❌                                                                                                                                                               |\n| AWS Gateway Support | ❌                                                                                                                              | ✔️                                                                       | ✔️                                                                                                                                                                         | ✔️                                                                                                                                                                         | ✔️                                                                                                                                                              | ✔️                                                                                                                                                              |\n| AWS Gateway Routing | [🔷](https://docs.spring.io/spring-cloud-function/docs/3.1.3/reference/html/spring-cloud-function.html#_aws_function_routing) | [🔷](https://quarkus.io/guides/aws-lambda-http)                         | ✔️                                                                                                                                                                         | ❌                                                                                                                                                                          | ❌                                                                                                                                                               | ❌                                                                                                                                                               |\n| AWS Integrations    | [✔️](https://spring.io/projects/spring-cloud-aws)                                                                              | [✔️](https://docs.quarkiverse.io/quarkus-amazon-services/dev/index.html) | [✔️](https://micronaut-projects.github.io/micronaut-aws/latest/guide/)                                                                                                     | ❌                                                                                                                                                                          | [✔️](https://micronaut-projects.github.io/micronaut-aws/latest/guide/)                                                                                          | ❌                                                                                                                                                               |\n| GraalVM Metadata    | [Auto](https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html)                                       | [Auto](https://quarkus.io/guides/building-native-image)                  | [Auto](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)/[Manual](https://docs.micronaut.io/latest/guide/#graalServices) | [Auto](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)/[Manual](https://docs.micronaut.io/latest/guide/#graalServices) | [Auto](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)/[Manual](https://github.com/GoodforGod/graalvm-hint) | [Auto](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)/[Manual](https://github.com/GoodforGod/graalvm-hint) |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodforgod%2Fawslambda-java-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodforgod%2Fawslambda-java-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodforgod%2Fawslambda-java-examples/lists"}