Slide 1

Slide 1 text

@kevindubois @danieloh30 Cloud Agnostic Design Patterns and Tips (for Serverless and Java)

Slide 2

Slide 2 text

@kevindubois @danieloh30 The Cloud

Slide 3

Slide 3 text

@kevindubois @danieloh30 Who We Are! Daniel Oh Developer Advocate, Java Champion @danieloh30 Kevin Dubois Developer Advocate, Java Champion @kevindubois

Slide 4

Slide 4 text

@kevindubois @danieloh30 Part 1 - Where are you in your Cloud Journey?

Slide 5

Slide 5 text

@kevindubois @danieloh30 Cloud Computing: Respond more quickly to demand No provisioning/managing of hardware High availability, Disaster Recovery, Resilience Grow your application in a manageable way Use only the resources you need ! €€ …

Slide 6

Slide 6 text

@kevindubois @danieloh30 CI/CD GitOps Networking Container Registry (Some) Components of an Application Platform Developer Tools Monitoring Logging

Slide 7

Slide 7 text

@kevindubois @danieloh30

Slide 8

Slide 8 text

@kevindubois @danieloh30

Slide 9

Slide 9 text

@kevindubois @danieloh30

Slide 10

Slide 10 text

@kevindubois @danieloh30

Slide 11

Slide 11 text

@kevindubois @danieloh30 But…

Slide 12

Slide 12 text

@kevindubois @danieloh30 ● Regulatory changes ● Outages ● Price changes, contract renegotiations ● Other vendor offers better hw / services ● New CIO/CTO ● Shadow IT ● … What if …

Slide 13

Slide 13 text

@kevindubois @danieloh30

Slide 14

Slide 14 text

@kevindubois @danieloh30 So … ?

Slide 15

Slide 15 text

@kevindubois @danieloh30 Hybrid / Multi Cloud!?

Slide 16

Slide 16 text

@kevindubois @danieloh30

Slide 17

Slide 17 text

@kevindubois @danieloh30

Slide 18

Slide 18 text

@kevindubois @danieloh30 Open Source & Cloud Native Ecosystem FTW!

Slide 19

Slide 19 text

@kevindubois @danieloh30 Part 2 - Adopting Serverless in your Cloud Native Journey

Slide 20

Slide 20 text

@kevindubois @danieloh30 Serverless “Serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment” -- CNCF Definition, https://www.cncf.io/blog/2018/02/14/cncf-takes-first-step-towards-serverless-computing/

Slide 21

Slide 21 text

@kevindubois @danieloh30 https://www.cncf.io/blog/2023/12/20/cncf-cloud-native-finops-cloud-financial-management-microsurvey/

Slide 22

Slide 22 text

@kevindubois @danieloh30 overprovisioned & wasting resources underprovisioned & unhappy users! Traditional Deployments NOT Serverless

Slide 23

Slide 23 text

@kevindubois @danieloh30 Serverless Use only what you need! with Serverless

Slide 24

Slide 24 text

@kevindubois @danieloh30 Java & Serverless

Slide 25

Slide 25 text

@kevindubois @danieloh30 JVM Scaling

Slide 26

Slide 26 text

@kevindubois @danieloh30 Supersonic. Subatomic. Java

Slide 27

Slide 27 text

@kevindubois @danieloh30 Build Time Runtime @ @ > The Quarkus Way Runtime Build Time @ @ > Package model Build Time Runtime @ @ >

Slide 28

Slide 28 text

@kevindubois @danieloh30 The Quarkus Way enables Native Compilation OOTB JVM Build Time @ @ > Package model Native

Slide 29

Slide 29 text

@kevindubois @danieloh30 Quarkus + Native (via GraalVM) 0.016 Seconds Quarkus + JVM (via OpenJDK) 0.943 Seconds Traditional Cloud-Native Stack 4.3 Seconds Supersonic, Subatomic Java Quarkus + Native (via GraalVM) 12 MB Quarkus + JVM (via OpenJDK) 73 MB Traditional Cloud-Native Stack 136 MB

Slide 30

Slide 30 text

@kevindubois @danieloh30 Java warmup time https://youtu.be/bWmuqh6wHgE (first 13 minutes)

Slide 31

Slide 31 text

@kevindubois @danieloh30 AWS Lambda, Functions... Built around the FaaS components and other services such as API Gateways. It enabled a variety of use cases but it is far from ideal for general computing and with room for improvements. 1.0 ➔ HTTP and other few Sources ➔ Functions only ➔ Limited execution time (5 min) ➔ No orchestration ➔ Limited local development experience FaaS

Slide 32

Slide 32 text

@kevindubois @danieloh30

Slide 33

Slide 33 text

@kevindubois @danieloh30

Slide 34

Slide 34 text

@kevindubois @danieloh30 Writing cloud agnostic functions with Java & Quarkus

Slide 35

Slide 35 text

@kevindubois @danieloh30 github.com/serverless-java-in-action/examples

Slide 36

Slide 36 text

@kevindubois @danieloh30 quarkus create app funqy \ -x quarkus-funqy-amazon-lambda

Slide 37

Slide 37 text

DEMO

Slide 38

Slide 38 text

@kevindubois @danieloh30 Part 3 - Design Cloud Agnostic Serverless Architecture

Slide 39

Slide 39 text

@kevindubois @danieloh30

Slide 40

Slide 40 text

@kevindubois @danieloh30 AWS Lambda, Functions... Built around the FaaS components and other services such as API Gateways. It enabled a variety of use cases but it is far from ideal for general computing and with room for improvements. 1.0 ➔ HTTP and other few Sources ➔ Functions only ➔ Limited execution time (5 min) ➔ No orchestration ➔ Limited local development experience Serverless Containers With the advent of containers & Kubernetes, many frameworks and solutions started to auto-scale containers. Cloud providers created offerings using managed services completely abstracting Kubernetes APIs. 1.5 ➔ Fargate, Cloud Run, Container Instances ➔ Knative, KEDA, etc ➔ Kubernetes based auto-scaling ➔ Microservices and Functions ➔ Easier to debug & test locally ➔ Polyglot & Portable Serverless is evolving...

Slide 41

Slide 41 text

@kevindubois @danieloh30

Slide 42

Slide 42 text

@kevindubois @danieloh30 Knative https://github.com/knative

Slide 43

Slide 43 text

@kevindubois @danieloh30 Immutable revisions Deploy new features: performing canary, A/B or blue-green testing with gradual traffic rollout with no sweat and following best practices. Any programming language Use any programming language or runtime of choice. From Java, Python, Go and JavaScript to Quarkus, SpringBoot or Node.js. No need to configure number of replicas, or idling. Scale to zero when not in use, auto scale to thousands during peak, with built-in reliability and fault-tolerance. Automatic scaling Simplified developer experience to deploy applications/code on serverless containers abstracting infrastructure & focusing on what matters. Containers made easy Ready for the Hybrid Cloud Truly portable serverless running anywhere Kubernetes runs, that is on-premises or on any public cloud. Leverage data locality and SaaS when needed. prem aws azur e Event Driven Architectures Build loosely coupled & distributed apps connecting with a variety of built-in or third-party event sources or connectors powered by Operators. Knative is an Open Source, Cloud Agnostic Solution to build Serverless and Event Driven Applications on Kubernetes Knative

Slide 44

Slide 44 text

@kevindubois @danieloh30 with serverless workloads Efficient Node Utilization == Less Nodes == Energy + Cost Savings

Slide 45

Slide 45 text

@kevindubois @danieloh30 $ kn func create -l quarkus myfunc $ kn func deploy $ kn service create myservice --image=xyz github.com/serverless-java-in-action/examples

Slide 46

Slide 46 text

@kevindubois @danieloh30 AWS Lambda, Functions... Built around the FaaS components and other services such as API Gateways. It enabled a variety of use cases but it is far from ideal for general computing and with room for improvements. 1.0 ➔ HTTP and other few Sources ➔ Functions only ➔ Limited execution time (5 min) ➔ No orchestration ➔ Limited local development experience Serverless Containers With the advent of containers & Kubernetes, many frameworks and solutions started to auto-scale containers. Cloud providers created offerings using managed services completely abstracting Kubernetes APIs. 1.5 ➔ Fargate, Cloud Run, Container Instances ➔ Knative, KEDA, etc ➔ Kubernetes based auto-scaling ➔ Microservices and Functions ➔ Easier to debug & test locally ➔ Polyglot & Portable Integration & State The maturity and benefits of Serverless are recognized industry wide and it adds the missing parts to make pattern suitable for general purpose workloads and used on the enterprise. 2.0 ➔ Basic state handling ➔ Enterprise Integration Patterns ➔ Advanced Messaging Capabilities ➔ Blended with your PaaS ➔ Enterprise-ready event sources ➔ Solutions and outcome focused

Slide 47

Slide 47 text

@kevindubois @danieloh30

Slide 48

Slide 48 text

@kevindubois @danieloh30 Knative Eventing Eventing is a set of APIs for routing events from Producers to Consumers (known as Sinks) CloudEvent specification allows for the creation of Serverless components that are driven by Event rather than Traffic

Slide 49

Slide 49 text

@kevindubois @danieloh30 CloudEvents CNCF graduated project - https://cloudevents.io/ Provides a common event schema => Interoperability, portability Extensible through extension attributes SDKs for different programming languages Protocol-agnostic (HTTP, AMQP, MQTT, …) Wide adoption

Slide 50

Slide 50 text

@kevindubois @danieloh30 Knative Eventing Usage Patterns Source to Sink

Slide 51

Slide 51 text

@kevindubois @danieloh30 Knative Eventing Usage Patterns Channel and Subscription

Slide 52

Slide 52 text

@kevindubois @danieloh30 Knative Eventing Usage Patterns Broker and Trigger

Slide 53

Slide 53 text

@kevindubois @danieloh30 Who wants more demos?

Slide 54

Slide 54 text

@kevindubois @danieloh30

Slide 55

Slide 55 text

@kevindubois @danieloh30

Slide 56

Slide 56 text

@kevindubois @danieloh30 github.com/kdubois/CamelQuarkusVoter

Slide 57

Slide 57 text

@kevindubois @danieloh30 Serverless + AI ? https://knative.dev/docs/about/case-studies/deepc/

Slide 58

Slide 58 text

@kevindubois @danieloh30 Wrapping it up… ● Cloud providers offer a LOT of cool stuff ● We need to be mindful of cloud lock-in ● Serverless is much more than just FAAS ● Use Open Source when you can, proprietary services when you must ● If you find yourself limited by Open Source solutions, contribute and participate!

Slide 59

Slide 59 text

@kevindubois @danieloh30 Free Developer e-Books & tutorials! developers.redhat.com/eventtutorials

Slide 60

Slide 60 text

@kevindubois @danieloh30 Serverless Java in Action Kevin Dubois & Daniel Oh

Slide 61

Slide 61 text

@kevindubois @danieloh30 Agenda Cloud Native Track - 10 & 11th April 2024 Wednesday, April 10th 17.00 Your Java code in the Kubernetes native Era: A live coding experience - Daniel Oh Thursday, April 11th API Management as code: A declarative approach to handling API artifacts – Hugo Guerrero 11.30 Going from containers, to pods, to Kubernetes - help for your developer environments - Cedric Clyburn 10.00 13.30 Quarkus 3: The road to virtual threads for cheaper, faster and easier concurrent Applications - Daniel Oh Java automation for yesterday, today and tomorrow – Andrew Block & Harsha Cherukuri 16.00 Supersonic, Subatomic GitHub - Jason Lee 15.00

Slide 62

Slide 62 text

@kevindubois @danieloh30 Get started Sign up at developers.redhat.com Find out more about Red Hat’s project and products, and what it offers developers

Slide 63

Slide 63 text

@kevindubois @danieloh30 Join us

Slide 64

Slide 64 text

Book Signing with Daniel Oh Thursday, April 11th At 2:40pm Come meet Daniel Oh and have him sign a free copy of “Quarkus for Spring Developers”. (Limited Quantities) Use this QR code to get a free digital copy.

Slide 65

Slide 65 text

@kevindubois @danieloh30 Thank you! Daniel Oh Developer Advocate, Java Champion @danieloh30 Kevin Dubois Developer Advocate, Java Champion @kevindubois