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

Modern Java App Development in the Cloud

Modern Java App Development in the Cloud

GeeCon Krakow 2023

Mads Opheim

April 19, 2023
Tweet

More Decks by Mads Opheim

Other Decks in Technology

Transcript

  1. GeeCon Krakow 2023
    Modern Java App Development
    in the Cloud
    Rustam Mehmandarov
    @RMehmandarov
    Mads Opheim
    @MadsOpheim

    View Slide

  2. The main story:
    From code --->
    to production

    View Slide

  3. 3
    Questions?
    Url: sli.do
    Code: #geecon
    Room 1
    (we have hoodies and stickers!)

    View Slide

  4. Our application
    We want an application that gives us two random words
    4

    View Slide

  5. Screenshot e.l.
    5

    View Slide

  6. Screenshot e.l.
    6

    View Slide

  7. Step 1:
    The logic
    7

    View Slide

  8. 8

    View Slide

  9. Step 2:
    Running code
    9

    View Slide

  10. Screenshot e.l.
    10

    View Slide

  11. Jakarta EE +
    MicroProfile
    to the rescue!
    11

    View Slide

  12. Wait!
    What is this
    MicroProfile
    thing?

    View Slide

  13. Jakarta EE for
    microservices
    13

    View Slide

  14. Authentication 3.0
    Concurrency 3.0
    CDI 4.0
    Persistence 3.1
    Faces 4.0
    Security 3.0
    Servlet 6.0
    Standard Tag Libraries 3.0
    Server Pages 3.1
    WebSocket 2.1
    Bean Validation 3.0
    Debugging Support 2.0
    Enterprise Beans Lite 4.0
    Managed Beans 2.0
    Transactions 2.0
    Jakarta EE 10 Platform
    Jakarta EE 10 Web Profile
    Jakarta EE 10 Platform
    Interceptors 2.1
    Dependency Injection 2.0
    Authorization 2.1
    Activation 2.1
    Batch 2.1
    Connectors 2.1
    Messaging 3.1
    Enterprise Beans 4.0
    Mail 2.1
    JSON Binding 3.0
    Annotations 2.1
    Updated Not Updated New
    Jakarta EE 10 Core Profile
    Expression Language 5.0
    Restful Web Services 3.1
    Json Processing 2.1
    Dependency Injection 2.0
    CDI Lite 4

    View Slide

  15. 15
    MicroProfile 6.0
    Jakarta EE 10
    Core Profile
    Config 3.0
    Fault
    Tolerance 4.0
    JWT
    Authentication
    2.1
    Health 4.0
    Metrics 5.0
    Open
    Tracing 3.0
    Open API 3.1
    = Updated = No change from last release
    = New
    Rest Client
    3.0
    Standalone
    Context
    Propagation
    1.3
    Reactive
    Streams
    Operators 3.0
    Outside umbrella
    Reactive
    Messaging
    3.0
    GraphQL 2.0
    LRA 2.0
    MicroProfile Releases in 2022
    Telemetry 1.0

    View Slide

  16. ● MicroProfile is an open-source community specification
    for Enterprise Java microservices
    ● A community of individuals, organizations, and vendors
    collaborating within an open source Eclipse Foundation
    Working Group to bring microservices to
    the Enterprise Java community
    16
    What is MicroProfile?

    View Slide

  17. 17
    Working Group Corporate Members

    View Slide

  18. Why
    MicroProfile?

    View Slide

  19. Write your logic,
    not boilerplate code
    19

    View Slide

  20. Lightweight
    20

    View Slide

  21. Interchangeable
    21

    View Slide

  22. 22
    Current MicroProfile Implementations

    View Slide

  23. Where do I
    start?

    View Slide

  24. 24
    https://start.microprofile.io/

    View Slide

  25. 25

    View Slide

  26. It works on my machine!
    Now what?
    26

    View Slide

  27. Step 3:
    Containerize it!
    27

    View Slide

  28. Your Dockerfile
    Things to consider:
    - Multistage builds
    - Slim base images
    - Layers
    - etc.
    28

    View Slide

  29. Step 4:
    To the Cloud!
    ...and beyond?
    29

    View Slide

  30. Automate
    your builds!
    ...and
    everything
    else!

    View Slide

  31. 31
    Cloud Build

    View Slide

  32. Dockerfile
    - or -
    cloudbuild.yaml
    32

    View Slide

  33. So now we have built a
    container image in the Cloud.
    Now what?
    33

    View Slide

  34. Serverless,
    of course!

    View Slide

  35. 35

    View Slide

  36. 36

    View Slide

  37. When not to go
    serverless?
    37

    View Slide

  38. Step 5:
    Make it fast! 🏎
    38

    View Slide

  39. Runtimes differ...
    39

    View Slide

  40. 40

    View Slide

  41. HowTo: Migrating to Quarkus
    1. Download the Quarkus starter, copy the
    Dockerfiles and pom files into your project
    2. Adapt the pom file to your project
    3. Move config to application.properties
    4. Update your cloudbuild.yaml
    5. Run
    41

    View Slide

  42. 42

    View Slide

  43. Step 6:
    And even faster!
    🏎🏎
    43

    View Slide

  44. +
    44

    View Slide

  45. Voila! 🎉

    View Slide

  46. 46
    Question time!
    url: sli.do
    code: #geecon

    View Slide

  47. Everything’s on GitHub!
    47
    https://github.com/mehmandarov/microprofile-randomstrings
    https://github.com/madsop/quarkus-multistage
    https://microprofile.io
    https://quarkus.io
    https://cloud.google.com

    View Slide

  48. Thank you!
    Rustam Mehmandarov
    @RMehmandarov
    Mads Opheim
    @MadsOpheim

    View Slide