Git Product home page Git Product logo

awslambdajavawithspringboot's Introduction

Explore ways to run Spring Boot application with AWS Lambda Java or Customer Runtime with GraalVM Native Image

Architecture

Application Architecture

Project Description

The code example include storing and retrieving product from the Amazon DynamoDB. I put Amazon API Gateway in front of my Lambdas.

I explore the following ways to run Spring Boot application with AWS Lambda Java or Customer Runtime with GraalVM Native Image:

  • Lambda with Java 21 Runtime and Spring Boot 3.2 and aws-serverless-java-container
  • Lambda with Java 21 Runtime and Spring Boot 3.2 and Spring Cloud Function
  • Lambda with Java 21 Runtime and Spring Boot 3.2 and Lambda Web Adapter
  • Lambda with Custom Runtime and Spring Boot 3.2 and GraalVM Native Image

I made all the test for the following use cases:

  • Lambda function without SnapStart enabled
  • Lambda function with SnapStart enabled but without usage of Priming
    -- doesn't currently work for AWS Custom Runtimes, so for GraalVM Native Image
  • Lambda function with SnapStart enabled but with usage of Priming (DynamoDB request invocation and if possible proxing the whole web request)
    -- doesn't currently work for AWS Custom Runtimes, so for GraalVM Native Image

Installation and deployment

Clone git repository locally
git clone https://github.com/Vadym79/AWSLambdaJavaWithSpringBoot.git

Compile and package the Java application with Maven from the root (where pom.xml is located) of the project
mvn clean package

Deploy your application with AWS SAM
sam deploy -g  

In order not to use AWS Lambda SnapStart comment both lines in the globals's section of the Lambda function.

Globals:
Function:
#SnapStart:
#ApplyOn: PublishedVersions

In order to user AWS Lambda SnapStart uncomment both lines above. For different Priming optimizations enabling of SnapStart is required.
SnapStart doesn't currently work for AWS Custom Runtimes, so for GraalVM Native Image.

Further Readings

My article series "Spring Boot 3 application on AWS Lambda"

My article series "AWS Lambda SnapStart"

awslambdajavawithspringboot's People

Contributors

vadym79 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.