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

Event-driven and serverless with Spring Cloud and Spring Native (jLove 2021)

Event-driven and serverless with Spring Cloud and Spring Native (jLove 2021)

Applications in a microservices architecture can communicate with each other in different ways. Adopting an event-driven paradigm based on asynchronous messaging provides services a way of communicating while reducing runtime coupling. Functions are a natural way of implementing event-driven business logic in terms of suppliers, processors, and consumers. Furthermore, when going serverless, we aim at executables with instant startup and efficiency. Enter Spring.

Spring Cloud Function favors using the functional programming paradigm to implement your business logic and provides useful features to build data pipelines, including type conversion and function composition. Functions can be exposed through different options (like web endpoints or message channels), and adapters are available to run them on platforms like Knative, AWS Lambda, Azure Functions, and GCP Functions. Spring Cloud Stream integrates your functions with messaging systems like RabbitMQ and Kafka without requiring any change to your code. Finally, Spring Native lets you compile your applications as native executable using GraalVM and providing instant startup, instant peak performance, and reduced memory consumption.

Thomas Vitale

June 25, 2021
Tweet

More Decks by Thomas Vitale

Other Decks in Programming

Transcript

  1. Thomas Vitale
    jLove Conference
    June 25th, 2021
    Event-driven and serverless
    With Spring Cloud and Spring Native
    @vitalethomas

    View full-size slide

  2. Thomas Vitale
    • Senior Software Engineer at
    Systematic, Denmark.

    • Spring, Cloud Native, DevOps,
    Kubernetes, Application Security.

    • Author of “Cloud Native Spring
    in Action” (Manning).
    About Me

    View full-size slide

  3. Serverless
    Dynamic scaling
    Request-driven
    Cost optimization
    thomasvitale.com @vitalethomas
    thomasvitale.com @vitalethomas

    View full-size slide

  4. Spring Native
    thomasvitale.com @vitalethomas

    View full-size slide

  5. Spring Native
    Native executables with GraalVM
    Slower

    Heavier

    Build
    Instant

    Startup
    Reduced

    Memory

    Consumption
    Instant

    Peak

    Performance
    Fewer

    Runtime

    Optimizations
    thomasvitale.com @vitalethomas

    View full-size slide

  6. Functions
    thomasvitale.com @vitalethomas
    thomasvitale.com @vitalethomas

    View full-size slide

  7. Functional Programming Paradigm
    Java 8 Functional Interfaces
    thomasvitale.com @vitalethomas
    Supplier Function Consumer

    View full-size slide

  8. Spring Cloud Function
    thomasvitale.com @vitalethomas

    View full-size slide

  9. Spring Cloud Function
    Business logic as functions
    thomasvitale.com @vitalethomas
    Transparent

    Type

    Conversion
    Function

    Arity
    Function

    Composition
    Reactive

    Support
    JAR

    Functions

    View full-size slide

  10. Spring Cloud Function
    Deployment and integrations
    thomasvitale.com @vitalethomas
    Knative CloudEvents RSocket
    Azure

    Functions
    Google Cloud
    Functions
    AWS

    Lambda

    View full-size slide

  11. Event-Driven
    thomasvitale.com @vitalethomas
    thomasvitale.com @vitalethomas

    View full-size slide

  12. Spring Cloud Stream
    thomasvitale.com @vitalethomas

    View full-size slide

  13. Spring Cloud Stream
    Event-driven microservices
    thomasvitale.com @vitalethomas
    Integration with
    event brokers
    Bindings

    with functions
    Publish

    Subscribe
    Consumer Groups Partitions

    View full-size slide

  14. Destination Binder
    Destination
    Binding
    Kafka RabbitMQ
    Function
    Spring Boot Application
    Destination
    Binding
    Spring Cloud Stream - Application Model
    thomasvitale.com @vitalethomas

    View full-size slide

  15. Thomas Vitale
    jLove Conference
    June 25th, 2021
    Event-driven and serverless
    With Spring Cloud and Spring Native
    @vitalethomas

    View full-size slide