Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Effectively running Java applications on AWS - Deep Dive at Devoxx Belgium 2023

Effectively running Java applications on AWS - Deep Dive at Devoxx Belgium 2023

There are several options to get Java running in the Cloud. Join this deep dive session with a mix of presentations and live demonstrations to learn how to effectively run Java applications on Amazon Web Services (AWS). You will get an overview about recent cloud-native developments in the Java ecosystem and Amazon Corretto, a production-ready distribution of the OpenJDK. We’ll guide you through different deployment options both for containers and Serverless functions including services like AWS Lambda, Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS). You will also understand how to leverage development tools such as CLIs and IDE support, infrastructure as code and Observability tooling. After this session you will be able to make well informed decisions when running Java workloads on AWS.

Dennis Kieselhorst

October 03, 2023
Tweet

More Decks by Dennis Kieselhorst

Other Decks in Programming

Transcript

  1. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Effectively running
    Java applications
    on AWS
    Maximilian Schellhorn
    Senior Solutions Architect
    Amazon Web Services
    D E E P D I V E
    Dennis Kieselhorst
    Principal Solutions Architect
    Amazon Web Services

    View full-size slide

  2. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    What to expect in the next hours…
    • Introduction Java on AWS
    ▪ Motivation – why Java matters for us
    ▪ OpenJDK versions and Amazon Corretto
    ▪ How to run Java on AWS?
    • How to move a Java application to the Cloud?
    ▪ Demo: Running a (containerized) Java workload on AWS
    ▪ Common Migration and Modernization scenarios
    • Developing modern, cloud-native Java applications on AWS
    ▪ Serverless with AWS Lambda
    ▪ Developer Tooling
    ▪ Demo: Building a Serverless Java Function on AWS Lambda

    View full-size slide

  3. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Motivation

    View full-size slide

  4. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    4
    My Java application
    is >20 years old.

    View full-size slide

  5. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    JavaScript
    Python
    Go
    Kotlin
    Scala
    Rust
    Ruby
    C#
    Building new apps in Java?

    View full-size slide

  6. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Evolution of compute over the last years
    • Restricted & ephemeral environments
    • Scaling horizontally
    • Start up-time and resource utilization became important
    • Need to decrease latency and memory consumption
    • Portability became less relevant
    • Abstraction via Containers

    View full-size slide

  7. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Java is adapting - several new projects to foster innovation
    • Broad ecosystem (libraries, tools and resources) & Developer
    experience
    • Over the past years companies invested in these technologies
    • New feature development: GraalVM native images, Project
    Leyden, CRaC (Coordinated Restore at Checkpoint), Accelerated
    Java release cycle
    • improved Garbage Collection (Shenandoah GC) and memory
    reduction via header size reduction (project Lilliput)

    View full-size slide

  8. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Java @ Amazon

    View full-size slide

  9. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    What is Amazon Corretto?
    • Downstream distribution of OpenJDK
    • Quarterly security releases
    • No-cost long-term releases – JDK 8, JDK 11, JDK 17, JDK 21
    • Feature release train (JDK 15, JDK 16, JDK 18, JDK 19, JDK 20 …)
    • Drop-in OpenJDK replacement
    • certified using the Java Technical Compatibility Kit (TCK) to ensure
    it meets the Java SE standard
    • is available on Linux, Windows, and macOS

    View full-size slide

  10. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    The history of Amazon Corretto
    • Created in late 2016 for Amazon internal use, released internally
    in 2017
    • Enabled regular release of security patches to production fast and
    without surprises from breaking changes
    • With adoption, customers started asking for improvements
    ▪ Optimized performance (speed, memory utilization, response time)
    ▪ Lingering bugs in the JVM or the libraries
    • Decision to distribute Corretto
    ▪ In 2018 AWS customers started asking us to release our binaries
    ▪ The end of free updates for Oracle JDK 8 was scheduled for January 2019

    View full-size slide

  11. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Java versions

    View full-size slide

  12. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Statistics for
    Java version
    usage
    Source: JRebel 2023
    Java Developer
    Productivity Report

    View full-size slide

  13. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Why should you upgrade?
    • JDK 11 (or older) is no longer being invested in
    • Many libraries and JVM fixes released after JDK8
    • What should you do? Explore upgrading to JDK 17 or 21
    • The performance improvements alone in 17 are worth the effort
    • It is common to see large (10–50%) improvements
    • The work to upgrade commonly takes from several days to two
    weeks.

    View full-size slide

  14. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    New Relic’s 2023 State of the Java Ecosystem Report
    • Adoption of Java 17, a recent Long Term Support (LTS) version of
    Java, has skyrocketed, growing 430% in the past year
    • Amazon Corretto is now the most-used Java Development Kit
    (JDK), with a 31% share of Java instances that are using New Relic.
    • 70% of Java applications reporting to New Relic do so from a
    container.
    https://newrelic.com/resources/report/2023-state-of-the-java-ecosystem

    View full-size slide

  15. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    OpenJDK versions and contributions
    • We will support JDK 8 until May, 2026 and JDK 11 until Sept, 2027
    • Non-LTS versions should be upgraded with 30 days of the next release
    2018 2019 2020 2021
    JDK17
    JDK16
    JDK15
    JDK14
    JDK13
    JDK12
    JDK11
    JDK10
    JDK9
    JDK8
    JDK18
    2022 2023
    JDK19
    JDK20
    JDK21

    View full-size slide

  16. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Growing contributions

    View full-size slide

  17. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Java at AWS:
    Lessons Learned from
    Upgrading and
    Modernizing a Massive
    JVM Codebase
    Wednesday from 15:10 - 16:00 in Room 3

    View full-size slide

  18. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    How to run Java on
    AWS?

    View full-size slide

  19. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Our sample application today
    AWS Cloud
    Unicorn Store
    Amazon
    EventBridge
    Publish Event
    UNICORN_CREATED
    Virtual private cloud (VPC)
    Amazon Relational
    Database (RDS)
    for PostgreSQL
    Private subnet
    Public subnet
    Load Balancer
    Store Unicorn
    Users
    POST
    PUT
    GET
    DELETE
    /unicorns

    View full-size slide

  20. AWS Global Infrastructure Regions & Availability Zones
    N A M E R I C A
    Available Region Announced # Availability Zone
    A S I A P A C I F I C
    A U S T R A L I A
    & N E W Z E A L A N D
    S A M E R I C A
    São Paulo 3
    E U R O P E
    Frankfurt
    Ireland
    London
    Milan
    Paris
    Spain
    3
    3
    3
    3
    3
    3
    Stockholm
    Zurich
    3
    3
    A F R I C A
    Cape Town 3
    M I D D L E E A S T
    Bahrain
    Tel Aviv
    UAE
    3
    3
    3
    Canada Central
    GovCloud US-East
    GovCloud US-West
    Northern California
    Northern Virginia
    Ohio
    3
    3
    3
    3
    6
    3
    Oregon
    Canada West
    4
    *Beijing
    *Ningxia
    Hong Kong
    Hyderabad
    Jakarta
    Mumbai
    3
    3
    3
    3
    3
    3
    Osaka
    Seoul
    Singapore
    Tokyo
    Malaysia
    Thailand
    3
    4
    3
    4
    Melbourne
    Sydney
    Auckland
    3
    3
    EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE

    View full-size slide

  21. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon Elastic Compute Cloud (Amazon EC2)
    Virtual servers in the cloud
    Physical servers in
    AWS global regions
    Guest 1 Guest 2 Guest n
    Hypervisor
    Host server
    650+ EC2 instances

    View full-size slide

  22. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Start with a
    source image
    Customize
    software and
    configurations
    Secure image with
    AWS-provided or
    custom hardening
    templates
    Test image with
    AWS provided or
    custom tests
    Distribute
    “golden” image to
    selected AWS
    Regions
    Repeat when updates are pending
    Build an EC2 Image

    View full-size slide

  23. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Typical application architecture
    Multiple copies for scale and
    redundancy
    Load
    Balancer
    Autoscaling
    OS
    Language
    Runtime
    App
    VM
    Build
    Deploy
    CI/CD

    View full-size slide

  24. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Shared Responsibility Model
    SOFTWARE
    COMPUTE STORAGE DATABASE NETWORKING
    HARDWARE/AWS GLOBAL INFRASTRUCTURE
    REGIONS AVAILABILITY ZONES EDGE LOCATIONS
    AWS
    RESPONSIBILITY
    FOR SECURITY ‘OF’
    THE CLOUD
    OPERATING SYSTEM, NETWORK & FIREWALL CONFIGURATION
    PLATFORM, APPLICATIONS, IDENTITY & ACCESS MANAGEMENT
    CUSTOMER DATA
    NETWORKING TRAFFIC
    PROTECTION (ENCRYPTION,
    INTEGRITY, IDENTITY)
    SERVER-SIDE ENCRYPTION
    (FILE SYSTEM AND/OR DATA)
    CLIENT-SIDE DATA
    ENCRYPTION & DATA INTEGRITY
    AUTHENTICATION
    CUSTOMER
    RESPONSIBILITY
    FOR SECURITY ‘IN’
    THE CLOUD

    View full-size slide

  25. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Shared responsibility on Amazon EC2 (released 2006)
    Physical Server(s)
    Hypervisor
    EC2 Instances
    OS
    Language
    Runtime
    App
    Autoscaling
    Build
    Deploy
    CI/CD
    AWS responsibility
    Customer responsibility
    Load Balancer
    $
    $
    Pay for
    provisioned
    resources

    View full-size slide

  26. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Containers

    View full-size slide

  27. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Container advantages over traditional VMs
    Better resource
    utilization
    Embrace stateless
    applications
    Portability Agility

    View full-size slide

  28. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Containers became popular
    Physical Server(s)
    Hypervisor
    EC2 Instance
    AWS responsibility
    Customer responsibility
    App
    Language
    Runtime
    OS
    Containers
    Container
    Orchestrator
    Container Orchestration Agent
    App
    Language
    Runtime

    View full-size slide

  29. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Shared responsibility on Amazon Elastic Container
    Service (released 2015)
    Physical Server(s)
    Hypervisor
    EC2 Instance
    Autoscaling
    AWS responsibility
    Customer responsibility
    OS
    Container
    Orchestrator
    Container
    Orchestrator
    Load Balancer
    Container Orchestration Agent
    Build
    Deploy
    CI/CD
    ECS
    Containers
    App
    Language
    Runtime
    App
    Language
    Runtime
    $
    $
    Pay for
    provisioned
    resources

    View full-size slide

  30. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Shared responsibility on AWS Fargate (released 2017)
    Physical Server(s)
    Hypervisor
    EC2 Instance
    Autoscaling
    AWS responsibility
    Customer responsibility
    OS
    Container
    Orchestrator
    Container Orchestration Agent
    OS
    Container Orchestration Agent
    EC2 Instance(s)
    Load Balancer
    Build
    Deploy
    CI/CD
    Containers
    App
    Language
    Runtime
    App
    Language
    Runtime
    $
    Pay for
    provisioned
    resources at the
    container level
    $

    View full-size slide

  31. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Shared responsibility on AWS App Runner (released 2021)
    Physical Server(s)
    Hypervisor
    Autoscaling
    AWS responsibility
    Customer responsibility
    OS
    Container
    Orchestrator
    Container Orchestration Agent
    OS
    Container Orchestration Agent
    Build
    Deploy
    CI/CD
    Autoscaling
    Build
    Deploy
    CI/CD
    Load Balancer
    Load Balancer
    EC2 Instance(s)
    Containers
    App
    Language
    Runtime
    App
    Language
    Runtime
    Containers
    Language
    Runtime
    Language
    Runtime
    Pay only during
    request processing
    $

    View full-size slide

  32. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Web applications API servers
    managed runtime Java
    Multi-concurrent
    Stateless
    AWS App Runner - fully managed service for web
    applications

    View full-size slide

  33. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    App Runner: Fully managed service for web applications
    AWS Fargate
    Amazon ECS
    Elastic Load Balancing
    AWS Auto Scaling
    AWS CodeBuild
    Web application
    Backend server

    View full-size slide

  34. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Our sample application on App Runner
    AWS Cloud
    Unicorn Store
    on AWS App Runner
    Amazon
    EventBridge
    Publish Event
    UNICORN_CREATED
    Virtual private cloud (VPC)
    Amazon Relational
    Database (RDS)
    for PostgreSQL
    Private subnet
    Store Unicorn
    Users
    POST
    PUT
    GET
    DELETE
    /unicorns
    Amazon ECR

    View full-size slide

  35. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Services for running Java applications beyond EC2
    AWS
    Lambda
    Serverless
    AWS
    Fargate
    Container
    orchestration
    Amazon Elastic
    Kubernetes
    Service (EKS)
    Amazon Elastic
    Container
    Service (ECS)
    Red Hat OpenShift
    Service on AWS (ROSA)
    Opinionated
    deployment AWS
    App Runner
    AWS Elastic
    Beanstalk
    AWS
    Batch
    AWS IoT
    Greengrass
    AWS
    Amplify
    Amazon
    Lightsail

    View full-size slide

  36. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    containers at scale
    Reduce decisions
    Reduce time build
    traditional applications
    operations
    minimum
    Amazon ECS delivers powerful simplicity

    View full-size slide

  37. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Our sample application on ECS
    AWS Cloud
    Unicorn Store
    Container
    Amazon
    EventBridge
    Publish Event
    UNICORN_CREATED
    Virtual private cloud (VPC)
    Amazon Relational
    Database (RDS)
    for PostgreSQL
    Private subnet
    Public subnet
    Load Balancer
    Store Unicorn
    Users
    POST
    PUT
    GET
    DELETE
    /unicorns
    Amazon ECR Amazon ECS AWS Fargate

    View full-size slide

  38. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon EKS or Amazon ECS?

    View full-size slide

  39. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    agility efficiency
    AWS optimized Kubernetes
    Secure
    Kubernetes deployments
    Build
    community around Kubernetes
    Amazon EKS delivers open flexibility

    View full-size slide

  40. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Integrated Kubernetes based application
    platform with built-in CI/CD, monitoring,
    and developer tools.
    existing
    skills
    Accelerate
    - Turn-key Platform

    View full-size slide

  41. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    business logic
    Scales to zero
    fast Java
    AWS Lambda – Serverless Compute at scale

    View full-size slide

  42. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Optimizations

    View full-size slide

  43. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Measure.
    Then optimize.
    There‘s no silver bullet.

    View full-size slide

  44. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Well-Architected Framework Container Build Lens
    https://docs.aws.amazon.com/wellarchitected/latest/container-build-lens/container-build-lens.html
    We provide cloud-agnostic
    questions and best practies on how
    to build and manage containers and
    container images.

    View full-size slide

  45. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    What is initialization?
    Start JVM
    Initialize
    Context and Classes
    Retrieve
    Container
    Image
    Run
    method
    Run
    method

    View full-size slide

  46. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    1
    2 Request
    Request
    Running application
    3 Request …
    • Initialize the environment once
    • Handle multiple request with the same instance (concurrently)
    • Instance keeps running after request processing
    • Scaling based on metrics or manually
    Java in a container
    Initialization

    View full-size slide

  47. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Topics for optimization
    • Reduce container image size
    • Build a custom Java runtime
    • Lazy loading of the container
    image
    • Ahead-of-time compilation
    • Optimize price-performance
    with AWS Graviton
    Kernel
    Base Image
    Image
    Image
    Container
    references
    parent
    image

    View full-size slide

  48. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Seekable OCI (SOCI)
    • Lazy loading snapshotter
    plugin for containerd
    • SOCI combines an unmodified
    container image with a SOCI
    index (no build-time
    conversion step required)
    • the SOCI snapshotter lazily
    pulls the image at runtime
    • gain ~50% in container
    startup performance for large
    images (>250 MB)

    View full-size slide

  49. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Optimize price-
    performance with
    AWS Graviton

    View full-size slide

  50. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Custom AWS silicon with 64-bit Arm cores
    Available in e.g. Amazon EC2, AWS Lambda,
    AWS Fargate, Amazon Relational Database
    Service
    Up to 40% better price performance over
    comparable current generation x86-based
    instances
    Up to 60% less energy for the same
    performance than comparable EC2 instances
    AWS Graviton

    View full-size slide

  51. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Multi-Architecture manifests
    Build image on arm64
    or cross compile
    Push to registry
    Push to registry
    Docker manifest
    push
    arm64 image
    Multi-arch
    manifest
    Docker manifest
    create
    Build image on x86 Push to registry
    x86 image

    View full-size slide

  52. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Common Migration &
    Modernization
    scenarios

    View full-size slide

  53. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    82

    View full-size slide

  54. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Pathways and 7Rs
    Applications
    Databases
    Move to managed data
    Managed provisioning, backups,
    patching, monitoring, and scaling
    No code changes
    Amazon RDS
    Migrate to
    the cloud
    Apps/DBs run on VMs
    No code changes
    Customer operates everything
    above the infrastructure
    VMware Cloud
    on AWS
    Amazon EC2
    Database on Amazon EC2
    Relocate/rehost
    Purpose-built databases
    High performance and scalability
    Licensing savings
    Amazon
    Aurora
    Amazon
    DynamoDB
    Amazon
    Neptune
    Amazon
    Redshift
    Move to open-source
    License freedom/savings
    Performance improvement
    Cross-platform support
    Refactor/rewrite
    Move to containers
    Develop and deploy faster
    Application portability
    No code changes
    Replatform
    Amazon ECS AWS Fargate Amazon EKS
    Move to cloud-
    native
    Move from idea to
    market, faster
    Lower costs

    AWS Lambda

    View full-size slide

  55. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Sample enterprise deployments
    Open Source IBM Red Hat Oracle
    App Server Apache TomEE
    Apache Tomcat
    WebSphere
    (Open Source version:
    Open Liberty)
    JBoss EAP
    (Open Source version: WildFly)
    WebLogic
    (former vendor: BEA)
    Relational
    Database
    MySQL/ MariaDB
    PostgreSQL
    IBM DB2 Oracle Database
    Additional
    Software
    OpenJDK
    Apache HTTPD
    Nginx
    IBM JDK
    IBM HTTP Server
    OpenJDK
    JBoss EWS (Tomcat/
    HTTPD)
    Oracle JDK
    Oracle Http Server
    Common
    Operating
    System
    Linux
    IBM Mainframe
    (z/OS), Windows
    Server, AIX, Linux,

    Red Hat Enterprise
    Linux
    Solaris,
    (Oracle) Linux, …

    View full-size slide

  56. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Modernization is a Journey
    Legacy
    On-Prem
    workloads
    Decreasing Cost of IT + Increasing Business Velocity
    Modernized
    Cloud-Native
    Apps
    Legacy,
    migrated apps
    On-Prem
    workloads
    On-Prem
    workloads
    Legacy,
    migrated apps
    Modernized
    Cloud-Native
    Apps
    Conduct
    assessment /
    Pilot
    Modernize a
    handful of apps -
    Refactor or Build
    new
    Continue to
    scale across the
    org to
    modernize
    business critical
    apps
    Cloud-Native
    transformation
    complete,
    optimization
    continues
    1 2 3
    Modernized
    Cloud-Native
    Application Estate
    $$$$ $$$ $$ $
    0%
    100%
    Multi-year Journey
    4

    View full-size slide

  57. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Break

    View full-size slide

  58. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Serverless Java

    View full-size slide

  59. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Serverful Java overview
    Application Load
    Balancer
    Web app
    Auto Scaling Group HTTP server
    Framework
    Application code
    Java application

    View full-size slide

  60. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Why serverless?
    Get to market faster,
    deliver features
    Reduced operational
    overhead
    Automatic scaling by
    unit of consumption
    High performance and
    scalability
    Pay for value
    Pay for value vs. pay
    for instance
    Security & HA
    Security and high
    availability built in

    View full-size slide

  61. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Event
    Changes in
    data state
    Requests to
    endpoints
    Changes in
    resource state
    Serverless Architecture
    Application code
    AWS Lambda
    function

    View full-size slide

  62. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Serverless is more than compute
    AWS
    Lambda
    AWS
    Fargate
    Amazon
    API Gateway
    Amazon SNS
    Amazon SQS
    Compute
    Data stores
    Integration
    Amazon Aurora
    Serverless
    Amazon Simple
    Storage Service
    (Amazon S3)
    Amazon
    DynamoDB
    AWS
    AppSync
    AWS
    Step Functions

    View full-size slide

  63. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Serverless with AWS
    Lambda

    View full-size slide

  64. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    What are Lambda functions?
    Handler function
    • Function executed on invocation
    • Java 8, Java 11, Java 17 supported
    Event
    • Invocation data sent to function
    • JSON event payload differs by source (API, State change, Queue)
    Context
    • Additional information from the service
    • Example: Request ID

    View full-size slide

  65. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Lambda Execution Model
    102
    Amazon
    SNS
    Amazon
    S3
    reqs
    Amazon
    Kinesis
    changes
    AWS Lambda
    service
    Amazon API
    Gateway
    Lambda
    function
    Lambda
    function
    Synchronous Asynchronous Poll
    Amazon
    SQS
    AWS Lambda
    Function URLs

    View full-size slide

  66. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Lambda Memory configuration
    AWS Lambda exposes a memory control
    CPU core and network capacity are allocated proportionally
    10240 MB
    128 MB
    Source: https://github.com/alexcasalboni/aws-lambda-power-tuning

    View full-size slide

  67. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Getting started

    View full-size slide

  68. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Lambda Java libraries
    aws-lambda-java-core
    ▪ Handler interfaces
    ▪ Context object
    aws-lambda-java-events
    ▪ Object types of AWS native integrations
    aws-lambda-java-tests
    ▪ Junit extensions to simplify testing

    View full-size slide

  69. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Package & Deploy Java applications to AWS Lambda
    Code
    Maven Shade Plugin
    Maven Assembly Plugin
    Gradle zip task
    Gradle shadow plugin
    ZIP or JAR Archive
    Uber Jar with Maven Shade Plugin Zip Archive with Gradle Task
    Build Uber Jars or Zip Archives with familiar build tooling
    Upload via AWS Console, AWS CLI , Amazon S3 or framework automation

    View full-size slide

  70. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Example: Simple Function URL
    AWS Lambda
    User
    Function Url

    View full-size slide

  71. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Example: REST API
    AWS Lambda
    Amazon API Gateway
    AWS Lambda
    GET
    POST
    com.unicorn.store.GetHandler
    /unicorns
    com.unicorn.store.PostHandler

    View full-size slide

  72. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Example: Queue processor
    Amazon SQS
    Queue
    Queue Processor
    Lambda function
    Lambda function
    Lambda function

    View full-size slide

  73. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Event Compatibility

    View full-size slide

  74. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Event Databases
    AWS Services
    Etc.
    Lambda
    Function
    API Request
    State change

    View full-size slide

  75. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Method 1: Handle request objects
    AWS Lambda
    Amazon API Gateway
    Amazon SQS
    Queue
    AWS Lambda
    AWS Lambda
    Amazon Simple Storage
    Service (Amazon S3)

    View full-size slide

  76. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Method 1: Handle request objects
    No need for embedded HTTP servers (API Gateway or Function URL take care of this)
    Handle Requests via aws-lambda-java-events or raw via Map or Input-Outputstream
    Framework implementations
    Spring Cloud Function
    Micronaut Serverless Function (Application Type)
    Quarkus aws-lambda extension or Funqy

    View full-size slide

  77. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    What about RestControllers?

    View full-size slide

  78. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Functions are invoked by events
    • AWS Lambda is invoked via events (API Event, S3 Object Event,
    SQS Event ..)
    • Events follow a certain structure
    • This is different from accepting a HTTP connection
    Amazon API Gateway
    AWS Lambda
    POST /v1/pets HTTP/2
    Host: x.execute-api.eu-west-1..
    User-Agent: curl/7.64.1
    Accept: */*
    Content-Type: application/json
    Content-Length: 39
    Body: {“data:“ : “test“}
    {
    "body": “{“data“: “test“}“ ,
    "resource": "/{proxy+}",
    "path": "/path/to/resource",
    "httpMethod": "POST",
    "isBase64Encoded": true,
    "headers": {
    "Accept-Encoding": "gzip",
    "Accept-Language": "en-US,en;q=0.8"
    },
    },
    "requestContext": {
    "accountId": "123456789012",
    "requestId": "c6af9ac6-7b61-..",
    ...
    }
    }

    View full-size slide

  79. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Adapter logic
    Web app
    function
    Invocation event
    mapped to
    framework request
    Function result
    mapped from
    framework
    response
    Web application wrapped in adapter logic.
    Amazon
    API Gateway
    Method 2: HTTP adapter

    View full-size slide

  80. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Method 2: Example with AWS Serverless Java Container
    • Transforms events so that frameworks can handle them as if it was an
    HTTP Request
    • Routing via RestController, POJO serialization, HTTP status codes
    • Add the library to your code and provide a configuration class
    Now supports
    Java17 and Spring
    Boot 3

    View full-size slide

  81. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Method 2: Advantages of HTTP Adapter
    Use the familiar @Controller programming style
    Easily port your existing applications to AWS Lambda
    Framework implementations
    Spring Boot via Serverless Java Container
    Micronaut via micronaut-function-aws-api-proxy
    Quarkus via AWS Lambda HTTP extension
    com.amazonaws.serverless.proxy.spring.SpringDelegatingLambdaContainerHandler

    View full-size slide

  82. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    DEMO
    Deploying a Spring Boot Application
    to AWS Lambda

    View full-size slide

  83. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Performance

    View full-size slide

  84. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    1
    2 Request
    Request
    Running application
    3 Request …
    • Initialize the environment once
    • Handle multiple request with the same instance (concurrently)
    • Instance keeps running after request processing
    • Scaling based on metrics or manually
    Java in a container
    Initialization

    View full-size slide

  85. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Execution
    Environment
    ready?
    Download
    Code
    Start
    Runtime
    Initialize
    Function
    Code
    Code
    execution
    Request
    Code
    execution
    No
    Yes
    Create
    Execution
    Environment
    Execution Environment
    Cold start
    Warm start
    AWS Lambda request handling

    View full-size slide

  86. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    • Initialize execution environment on first invoke
    • An execution environment handles a single request at a time
    • If an execution environment is busy with a request – another environment
    is started – simpler programming model
    • Scales to zero if there is no request – Managed auto scaling
    1
    Initialization Execution
    Execution
    2
    Execution
    3
    Initialization
    4
    Execution
    Java with AWS Lambda
    Env #1
    Env #2

    View full-size slide

  87. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    0
    2
    4
    6
    8
    10
    12
    14
    0 1 2 3 4 5 6 7 8 9
    Tiered Compilation
    Compile Time frameworks
    No framework
    No optimization
    Lightweight dep.
    Function handler
    GraalVM
    Effort to modernize
    Cold-start (seconds)
    Provisioned Concurrency
    AWS Lambda performance optimizations
    Default with Java 17 on
    AWS Lambda

    View full-size slide

  88. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Lambda Provisioned Concurrency
    Sets floor on minimum number of
    execution environments
    Pre-warm execution environments
    to reduce cold-start impact
    Can save costs in certain situations

    View full-size slide

  89. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Lambda SnapStart
    Up to 10x faster start-up
    performance
    NEW

    View full-size slide

  90. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Lambda SnapStart
    microVM snapshot technology
    • Takes a snapshot of the memory and disk state
    • Snapshot encryption & caching for low-latency access
    • Creates new Lambda environments from cached snapshot
    • Fully Managed

    View full-size slide

  91. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Code
    execution
    Invoke
    Resume
    Resume
    Snapshot
    Post
    Snapshot
    Hook
    (optional)
    Pre
    Snapshot
    Hook
    (optional)
    Create
    Execution
    Environment
    Init during deployment
    Download
    Code
    Start
    Runtime
    Initialize
    Function
    Code
    Create
    Snapshot
    first request
    How SnapStart works

    View full-size slide

  92. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SnapStart benefits
    • No additional cost
    • Minimal to no code changes
    • Customization via Runtime Hooks
    Without SnapStart
    With SnapStart
    6.725
    - 80 %
    1.15
    Full Duration
    Results will vary based on your application

    View full-size slide

  93. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    DEMO
    AWS Lambda SnapStart

    View full-size slide

  94. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    0
    2
    4
    6
    8
    10
    12
    14
    0 1 2 3 4 5 6 7 8 9
    Tiered Compilation
    Compile Time frameworks
    No framework
    No optimization
    Lightweight dep.
    Function handler
    GraalVM
    Effort to modernize
    Cold-start (seconds)
    Provisioned Concurrency
    AWS Lambda performance optimizations
    Default with Java 17 on
    AWS Lambda
    SnapStart

    View full-size slide

  95. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    GraalVM native images on AWS Lambda
    Create a native binary and deploy as AWS Lambda custom runtime
    Sub-second application startup and low memory footprint
    Frameworks provide built-in support (Micronaut, Quarkus, Spring)
    bootstrap

    View full-size slide

  96. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Deep Dive: Java on AWS Lambda Workshop
    https://catalog.workshops.aws/java-on-aws-lambda

    View full-size slide

  97. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Serverless Java Replatforming Guide

    View full-size slide

  98. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Powertools for AWS Lambda
    J A V A L I B R A R Y T O S I M P L I F Y T R A C I N G , S T R U C T U R E D L O G G I N G A N D C U S T O M M E T R I C S
    • Facilitate best practice adoption
    • Increase developer velocity
    • Optional modules:
    • Parameter handling
    • Idempotency
    • SQS Large Message and Batching Options
    • Serialization, Validation and custom resource support

    View full-size slide

  99. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Java on AWS
    Developer Tooling

    View full-size slide

  100. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    The development flow
    IDE Support Frameworks & SDK Review & Analyze Build & Deploy

    View full-size slide

  101. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    IDE Support

    View full-size slide

  102. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Toolkit for IntelliJ IDEA
    • AWS Resource explorer
    • Inspect AWS Cloudformation stacks
    • View and search Cloudwatch Logs
    • Serverless Development (Debug, Invoke, Package) Lambda functions
    • Connect to Amazon RDS with temporary credentials
    • Amazon CodeWhisperer integration

    View full-size slide

  103. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Toolkit for Visual Studio Code
    • AWS Resource & CDK explorer
    • Cloudformation YAML Support
    • Viewing Cloudwatch Log Streams
    • Check ECR images, write ECS task definition files
    • Debug & develop Serverless applications
    • Model Step Functions locally

    View full-size slide

  104. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon CodeWhisperer
    B U I L D A P P L I C A T I O N S F A S T E R A N D M O R E S E C U R E L Y W I T H Y O U R A I C O D I N G C O M P A N I O N
    Real-time code
    suggestions
    Reference tracker
    Security scan
    IDE context
    automatically sent to
    CodeWhisperer
    Receive code suggestions
    Amazon
    CodeWhisperer
    Uses AI to generate
    code recommendations
    based on prior code and
    comments in your IDE
    Writing code
    in the IDE

    View full-size slide

  105. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.

    View full-size slide

  106. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.

    View full-size slide

  107. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Frameworks & SDK

    View full-size slide

  108. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS SDK for Java v2
    Easily interact with AWS Services from your Java code (S3, SNS, SQS etc.)
    Integrated retry and backoff behavior
    Leverage different strategies for IAM authentication
    GraalVM native image compatible

    View full-size slide

  109. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Spring framework
    Spring Cloud for Amazon Web Services (https://awspring.io)
    • Interact with AWS services using well-known Spring APIs and idioms
    • Examples:
    • Spring Messaging API with Amazon SQS
    • Spring Cache API with Amazon ElasticSearch
    • Emails via Amazon SES
    • Bootstrap property sources with AWS Parameter Store or Secrets Manager
    Spring Cloud Function (AWS)
    • Use in conjunction with AWS Lambda to avoid payload translation
    • Use Spring features in a functional environment
    B U I L D M O D E R N J A V A B A S E D E N T E R P R I S E A P P L I C A T I O N S

    View full-size slide

  110. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Micronaut
    Certified for Amazon Corretto
    Majority of work during compile-time
    • Eliminates reflection, runtime proxies, dynamic class loading
    • Smaller startup time & memory footprint
    AWS CDK Support, AWS SDK integration, AWS Lambda SnapStart Support
    Easily create GraalVM native images
    M O D E R N J V M - B A S E D , C L O U D N A T I V E F R A M E W O R K

    View full-size slide

  111. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Quarkus
    Build time processing & reduction in reflection usage
    Reduced startup time & lower memory footprint
    First-Class Support for GraalVM Native Images
    Extensions for a variety of AWS services (KMS, S3, SQS, SNS, DynamoDB)
    Kubernetes & AWS Lambda extensions
    K U B E R N E T E S & C L O U D N A T I V E J A V A F R A M E W O R K

    View full-size slide

  112. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Review & Analyze

    View full-size slide

  113. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon CodeGuru Reviewer
    AWS Best Practices: Correct use of AWS APIs
    Resource Leaks: Correct resource handling
    Not sanitized user input (e.g., cross-site scripting, LDAP injection, OWASP Top 10)
    Sensitive Information Leak: Compliance Issues (e.g., logging of credit card number)

    View full-size slide

  114. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon CodeGuru Profiler
    Memory profiling, hotspots and heap summary
    Finds methods with high-potential for performance optimization
    Supports AWS Lambda, AWS EC2, Amazon ECS, EKS, Fargate and on-premise.

    View full-size slide

  115. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Build & Deploy

    View full-size slide

  116. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Familiar
    Your language
    Just classes and methods
    Tool support
    Compatible with testing
    frameworks you’re already using
    Abstraction
    Sane defaults
    Reusable classes
    AWS Cloud Development Kit (AWS CDK)

    View full-size slide

  117. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Abstraction via higher level constructs

    View full-size slide

  118. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SAM template transform
    Creates:
    • Lambda function
    • Runtime
    • Execution Policy
    • Code
    • Handler
    • API Gateway
    • API endpoint
    • Permissions
    Create DynamoDB table with sane
    defaults
    AWSTemplateFormatVersion: '2010-09-09’
    Transform: AWS::Serverless-2016-10-31
    Resources:
    GetHtmlFunction:
    Type: AWS::Serverless::Function
    Properties:
    CodeUri: s3://sam-demo-bucket/function.jar
    Handler: com.unicorn.store.RequestHandler
    Runtime: java17
    Policies: DynamoDBReadPolicy
    Events:
    GetToDo:
    Type: Api
    Properties:
    Path: /todo/{id}
    Method: GET
    Listable:
    Type: AWS::Serverless::Simple Table
    AWS Serverless Application Model (AWS SAM)

    View full-size slide

  119. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS SAM CLI
    sam init Generates a AWS SAM template and example application code
    sam build Build the application package
    sam deploy Deploys your serverless application to the AWS Cloud
    sam local Test your application code locally
    sam logs Stream functions logs to your local machine

    View full-size slide

  120. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Outlook & Recap

    View full-size slide

  121. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Running Java in the cloud
    AWS
    Lambda
    Serverless
    AWS
    Fargate
    Container
    orchestration
    Amazon Elastic
    Kubernetes
    Service (EKS)
    Amazon Elastic
    Container
    Service (ECS)
    Red Hat OpenShift
    Service on AWS (ROSA)
    Opinionated
    deployment AWS
    App Runner
    AWS Elastic
    Beanstalk
    AWS
    Batch
    AWS IoT
    Greengrass
    AWS
    Amplify
    Amazon
    Lightsail

    View full-size slide

  122. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Overview: Java on AWS Immersion Day
    https://catalog.workshops.aws/java-on-aws

    View full-size slide

  123. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Connect with us!
    https://aws.amazon.com/contact
    -us/

    View full-size slide

  124. EFFECTIVELY RUNNING JAVA APPLICATIONS ON AWS – DEEP DIVE
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Thank you!

    View full-size slide