Quarkus brings Serverless
to Java developers
Daniel Oh
DevConf.US 2019
About Me
danieloh30
Daniel Oh
@danieloh30doh@redhat.com
● Principal Technical Product Marketing Manager at Red Hat
○ Cloud Native App Development
○ Agile & DevOps practices
● CNCF Ambassador / DevOps Institute Ambassador
● Java Developer
● Opensource.com Moderator
● Public Speaker & Writer
Developer Journey - Monolith
Application
@danieloh30 @QuarkusIO
Developer Journey - Modules
@danieloh30 @QuarkusIO
Developer Journey - Microservices
@danieloh30 @QuarkusIO
Developer Journey - Distributed Microservices
@danieloh30 @QuarkusIO
Developer Journey - Multiple Data and Entries
@danieloh30 @QuarkusIO
Developer Journey - Functions
@danieloh30 @QuarkusIO
Event Function (µ)Service
f( )
Developer Journey - How it works
function main() {
return {payload: 'Hello world'};
}
@danieloh30 @QuarkusIO
How do enterprise developers imagine the
serverless computing?
@danieloh30 @QuarkusIO
#nocode
Developer Journey - Principles
● No worries about Infrastructure
● Auto scaling
● Pay as you go
@danieloh30 @QuarkusIO
@danieloh30 @QuarkusIO
Serverless challenges by Managed service
Multi Cloud
Dependencies
Unable to run functions
across private cloud, public
cloud, and on-premise
Limited runtiems, languages,
and frameworks
@danieloh30 @QuarkusIO
● Containers
● Kubernetes
● Istio Service Mesh
● APIs as a Service
Managing by yourself
@danieloh30 @QuarkusIO
13+
Serverless or FaaS open sources projects
based Kubernetes
Serverless with Kubernetes
@danieloh30 @QuarkusIO
Kubernetes is not easy for developers
But...
@danieloh30 @QuarkusIO
@danieloh30 @QuarkusIO
Knative
Kubernetes-based platform
Created originally by Google with contributions from
over 50 different companies to build and run
serverless applications on Kubernetes.
@danieloh30
Primary Components
● Build
● Serving
● Eventing
@danieloh30 @QuarkusIO
Supersonic Subatomic Java
A Kubernetes Native Java stack tailored for GraalVM &
OpenJDK HotSpot, crafted from the best of breed Java
libraries and standards
@danieloh30 @QuarkusIO
A stack to write Java apps
Cloud Native, Microservices, Serverless
@danieloh30 @QuarkusIO
Why is Quarkus for Serverless?
@danieloh30 @QuarkusIO
Why is Quarkus for Serverless?
DEMO
@danieloh30 @QuarkusIO
A cohesive platform for optimized developer joy:
● Based on standards, but not limited
● Unified configuration
● Zero config, live reload in the blink of an eye
● Streamlined code for the 80% common usages,
flexible for the 20%
● No hassle native executable generation
Benefit No. 1: Developer Joy
@danieloh30 @QuarkusIO
Benefit No. 2: Supersonic Subatomic Java
Memory (RSS) in Megabytes
Quarkus + GraalVM
13 MB
Quarkus + OpenJDK
74 MB
Traditional Cloud-Native Stack
74 MB
REST
@danieloh30 @QuarkusIO
Benefit No. 2: Supersonic Subatomic Java
Memory (RSS) in Megabytes
REST + CRUD
Quarkus + GraalVM
35 MB
Quarkus + OpenJDK
130 MB
Traditional Cloud-Native Stack
218 MB
@danieloh30 @QuarkusIO
Benefit No. 2: Supersonic Subatomic Java
Boot + First Response Time (in seconds)
Quarkus + GraalVM 0.014 Seconds
REST
REST + CRUD
Quarkus + OpenJDK 0.75 Seconds
Quarkus + GraalVM 0.055 Seconds
Quarkus + OpenJDK 2.5 Seconds
Traditional Cloud-Native Stack 9.5 Seconds
Traditional Cloud-Native Stack 4.3 Seconds
@danieloh30 @QuarkusIO
Benefit No. 3: Unifies Imperative and Reactive
● Combine both Reactive and imperative development in the same application
● Inject the EventBus or the Vertx context
● Use the technology that fits your use-case
@Inject
SayService say;
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return say.hello();
}
@Inject @Stream(”kafka”)
Publisher<String> reactiveSay;
@GET
@Produces(MediaType.SERVER_SENT_EVENTS)
public Publisher<String> stream() {
return reactiveSay;
}
@danieloh30 @QuarkusIO
Benefit No. 4: Best of Breed Frameworks & Standards
Eclipse Vert.x Hibernate RESTEasy Apache Camel Eclipse MicroProfile Netty
Kubernetes OpenShift Jaeger Prometheus Apache Kafka Infinispan
https://opensource.com/article/18/11/open-source-serverless-platforms
https://opensource.com/article/18/11/developing-functions-service-apache-openwhisk
https://opensource.com/article/19/4/enabling-serverless-kubernetes
https://blog.openshift.com/knative-serving-your-serverless-services/
https://blog.openshift.com/knative-building-your-serverless-service/
https://blog.openshift.com/knative-configurations-routes-and-revisions/
https://github.com/redhat-developer-demos/knative-tutorial
Resources
@danieloh30 @QuarkusIO
@danieloh30 @QuarkusIO
https://quarkus.io
@QuarkusIO
https://quarkusio.zulipchat.com
THANK YOU & QUESTION?
Following me: @danieloh30

[DevConf.US 2019]Quarkus Brings Serverless to Java Developers