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

Serverless Java with Spring Boot

Serverless Java with Spring Boot

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

Spring Cloud Function favours 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 can 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 executables using GraalVM and provides instant startup, instant peak performance, and reduced memory consumption.

Thomas Vitale

June 08, 2022
Tweet

More Decks by Thomas Vitale

Other Decks in Technology

Transcript

  1. Systematic • Software Architect at Systematic, Denmark. • Author of

    “Cloud Native Spring in Action” (Manning). • Spring Security and Spring Cloud contributor. Thomas Vitale thomasvitale.com @vitalethomas
  2. Serverless Architectures Developers focus on code Focus on business logic

    Developer Platform Infrastructure Provisioning Workload Management Autoscaling Scaling to zero thomasvitale.com @vitalethomas
  3. Spring Native Native executables with GraalVM Slower Heavier Build Instant

    Startup Reduced Memory Consumption Instant Peak Performance Fewer Runtime Optimizations thomasvitale.com @vitalethomas
  4. Packaging Spring Boot JAR and native thomasvitale.com @vitalethomas JAR Native

    Gradle bootJar Maven spring-boot:repackage Gradle nativeCompile Maven -Pnative package
  5. Packaging Spring Boot Container images with Cloud Native Buildpacks thomasvitale.com

    @vitalethomas Container Image Gradle bootBuildImage Maven spring-boot:build-image
  6. Knative Serving Serverless Containers on Kubernetes Developer-friendly abstractions From code

    to URL Autoscaling Scaling to zero Progressive Rollouts Request-driven Event-driven Cloud agnostic thomasvitale.com @vitalethomas
  7. Serverless experience on Kubernetes From containers to deployment with Knative

    Image pack kpack bootBuildImage kn URL Kubernetes Cluster Container Container Container Knative Serving thomasvitale.com @vitalethomas
  8. Spring Cloud Function Business logic as functions thomasvitale.com @vitalethomas Transparent

    Type Conversion Function Arity Function Composition Reactive Support JAR Functions
  9. Spring Cloud Stream Event-driven microservices thomasvitale.com @vitalethomas Integration with event

    brokers Bindings with functions Publish Subscribe Consumer Groups Partitions
  10. Discount codes Manning • 35% discount code, valid for all

    products in all format • ctwdevtalksro22 • manning.com
  11. Resources Source code and more • Sample project: • https://github.com/ThomasVitale/devtalks-2022-serverless-java

    • Knative and Spring - Bringing back the func: • https://youtu.be/EKDYE_dStTI thomasvitale.com @vitalethomas