Serverless Java Challenges & Triumphs

David Delabassee
David DelabasseeDevRel - Java Platform Group - Oracle
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Serverless Java
Challenges and Triumphs
1
Singapore JUG
March 25, 2019
David Delabassee - @delabassee
Oracle
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 2
Preamble…
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Belgium
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 5
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
6
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 7
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 8
Serverless
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Function As a Service
• Function
• As a Service
9
Small bits of code with a well defined job
Easy to understand and maintain
The system takes care of provisioning, patching, scaling, ...
Each function can scale independently
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 10
Interest in Serverless
Source: Google Trends
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 11
Serverless Java?
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 12
https://blog.github.com/2018-11-15-state-of-the-octoverse-top-programming-languages/
Top programming languages by contributors as of September 30, 2018
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 13
https://redmonk.com/rstephens/2019/03/20/redmonk-top-20-languages-over-time-january-2019/
RedMonk Top 20 Languages Over Time: Sept 2012 - Jan 2019
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 14
4.96% of functions are Java 8!?
https://serverless.com/blog/serverless-by-the-numbers-2018-data-report/
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 15
And the Trend isn’t Great!
https://serverless.com/blog/serverless-by-the-numbers-2018-data-report/
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Serverless Java Landscape
• AWS Lambda - Java 8 support (June 2015)
• Azure Function - Java 8 support (February 2019)
• Google Cloud Function - NA
16
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 17
http://redmonk.com/jgovernor/2016/10/12/when-web-companies-grow-up-they-turn-into-java-shops
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Serverless Java
• FaaS seen as a scripting platform for the web?
• Doesn't fit normal Java development patterns?
• JVM not suitable for short-lived “apps”?
18
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Blueprints for Serverless Java
• “Plain old Java”
• Established toolchains
• Ability to build complex applications
• Low latency/high performance
• Rich JVM ecosystem
19
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
• Open-source, Container NaAve, Serverless PlaDorm
• Apache v2 licence
• Run anywhere - Cloud / Datacenter / Laptop
• Fn ♥
• FuncAons are containers
20
https://github.com/fnproject/fn
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 21
Demo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Fn Java Function Development Kit
• Docker images
–A build image for repeatable builds
–An optimized runtime image
• JUnit test harness
• Maven support
• Input/output coercion
• Flow
• …
22
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Blueprints for Serverless Java
• “Plain old Java” ✓
• Established toolchains ✓
• Ability to build complex applications
• Low latency/high performance
• Rich JVM ecosystem
23
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 24
Fn Flow
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Serverless
25
Permanent Storage Lives Elsewhere
ts
10
5
5 5
5
8 7
7 8
10
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Fn Flow
• Build reliable and scalable Faas applica(ons
• Provides rich concurrency primi(ves including fork-join, chaining, delays
and error handling
• Java support based on Java 8 Comple(onStage API
For long-running, reliable, scalable functions
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Fn Flow
For long-running, reliable, scalable functions
Flow flow = Flows.currentFlow();
FlowFuture<byte[]> stage =
flow.invokeFunction(aFunc, input.getBytes())
.thenApply(HttpResponse::getBodyAsBytes);
byte[] result = stage.get();
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Fn Flow
28
Demo
Java FDK
Flow
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Blueprints for Serverless Java
• “Plain old Java” ✓
• Established toolchains ✓
• Ability to build complex applications ✓
• Low latency/high performance
• Rich JVM ecosystem
29
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Low latency/high performance
• Respect resource constraints
• Start fast
• Run in small(er) images
30
What do we want containerized JVMs to do?
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Respecting Resource Constraints
• JDK-8179498:attach in Linux should be relative to /proc/pid/root and
namespace aware as jcmd, jsack, etc. fail to attach (resolved in JDK 10)
• JDK-8193710: jcmd –l and jps commands do not list Java processes
running in Docker containers (resolved in JDK 11)
• And more... JDK-8203357: Container Metrics (resolved in JDK 11.0.1)
• JDK 11—JEP 318: Epsilon, i.e. No-Op, Garbage Collector (experimental)
31
Being Container Friendly
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Start Fast
32
Moving Startup Costs to Build-Time
• Class Data Sharing
–Avoid parsing JDK classes on start
• Application CDS
–Avoid parsing App classes on start
• AOT compilation
–Compile App classes to native .so libraries (experimental)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Start Fast
33
Small(er) Container Images = Faster Start-up
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Run Small(er) Images
34
Reduce layers size
• Java Function and its dependencies
• Java Runtime
• Operating System
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Run Small(er) Images
35
Reduce layers size
• Project Portola
– Run the JVM on musl
– https://openjdk.java.net/projects/portola/
• musl
– Lightweight, fast, simple, free, C standard library implementation
– http://www.musl-libc.org
• Alpine
– Security-oriented, lightweight Linux distro with 4MB base image
– https://www.alpinelinux.org
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Run Small(er) Images
36
Reduce Java Runtime layer size - jlink
Modules JLink flags Mb
JDK 12 Whole JDK! 318.7
openjdk:11-jre-slim 11 (default) NB: openjdk:12-jre-slim not yet available! 217.0
JRE 12 all (explicit) --add-module $(java --list-modules) 168.3 100.0%
+ --no-header-files --no-man-pages --strip-debug 143.0 85.0%
+ --compress=1 107.8 64.1%
+ --compress=2 83.7 49.7%
Custom JRE 12 base, logging --add-module $(jdeps --print-module-deps func.jar) 47.4 28.2% 100.0%
+ --no-header-files --no-man-pages --strip-debug 41.6 24.7% 87.8%
+ --compress=2 32.0 19.0% 67.5%
OpenJDK (build 12-ea+29) - alpine:3.9 x86_64
318 Mb 168 Mb 47 Mb 32 Mb
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 37
jlink/Alpine Demo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Run Small(er) Images
• GraalVM compiles Java source to a single native binary
• Tiny image sizes
• Low VM overhead
38
GraalVM
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 39
GraalVM Demo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Blueprints for Serverless Java
• “Plain old Java” ✓
• Established toolchains ✓
• Ability to build complex applications ✓
• Low latency/high performance ✓
• Rich JVM ecosystem
40
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Ongoing Ecosystem Evolution…
• Substrate VM
• Java release cadence
• Other JVM based languages
– Kotlin, Groovy, etc.
• …
• Fn init-image
41
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Blueprints for Serverless Java
• “Plain old Java” ✓
• Wide choice of good tooling ✓
• Ability to build complex applications ✓
• Low latency/high performance ✓
• Rich JVM ecosystem ✓
42
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 43
Serverless Java—Does it have a future? Absolutely!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 44
Call to Action
https://github.com/fnproject/fn
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Coming Soon: Oracle Functions
Function Dev KitsOpen Source Engine
Oracle Cloud Triggers
Events
HTTP
Timer
Streams
Container Native
Advanced DiagnosticsFine-grained Billing
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 46
Thanks!
1 of 46

Recommended

Java Serverless in Action - Voxxed Banff by
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffDavid Delabassee
232 views22 slides
JavaOne 2015: 12 Factor App by
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJoe Kutner
3.3K views83 slides
#JavaOne What's in an object? by
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?Charlie Gracie
3.2K views50 slides
Polygot Java EE on the GraalVM by
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
1K views49 slides
Java modules using project jigsaw@jdk 9 by
Java modules using project jigsaw@jdk 9Java modules using project jigsaw@jdk 9
Java modules using project jigsaw@jdk 9Mauricio "Maltron" Leal
617 views21 slides
Ausoug glassfish perth by
Ausoug glassfish perthAusoug glassfish perth
Ausoug glassfish perthLansenConsulting
1.1K views35 slides

More Related Content

What's hot

GlassFish in Production Environments by
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production EnvironmentsBruno Borges
9.7K views41 slides
Why jakarta ee matters (ConFoo 2021) by
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
221 views62 slides
Oracle WebLogic Server 12.2.1 Do More with Less by
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessEd Burns
1.5K views72 slides
Tecnologias Oracle em Docker Containers On-premise e na Nuvem by
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemBruno Borges
1.6K views59 slides
Java EE Arquillian Testing with Docker & The Cloud by
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudBruno Borges
3.3K views29 slides
Modularization With Project Jigsaw in JDK 9 by
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Simon Ritter
6.1K views39 slides

What's hot(20)

GlassFish in Production Environments by Bruno Borges
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production Environments
Bruno Borges9.7K views
Why jakarta ee matters (ConFoo 2021) by Ryan Cuprak
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
Ryan Cuprak221 views
Oracle WebLogic Server 12.2.1 Do More with Less by Ed Burns
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with Less
Ed Burns1.5K views
Tecnologias Oracle em Docker Containers On-premise e na Nuvem by Bruno Borges
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Bruno Borges1.6K views
Java EE Arquillian Testing with Docker & The Cloud by Bruno Borges
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
Bruno Borges3.3K views
Modularization With Project Jigsaw in JDK 9 by Simon Ritter
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9
Simon Ritter6.1K views
Developing modular Java applications by Julien Dubois
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
Julien Dubois11.9K views
The Kubernetes WebLogic revival (part 1) by Simon Haslam
The Kubernetes WebLogic revival (part 1)The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)
Simon Haslam305 views
Exploring Java Heap Dumps (Oracle Code One 2018) by Ryan Cuprak
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak2K views
Melhore o Desenvolvimento do Time com DevOps na Nuvem by Bruno Borges
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Bruno Borges3.9K views
20191119 Cloud Native Java : GraalVM by Taewan Kim
20191119 Cloud Native Java : GraalVM20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM
Taewan Kim1.1K views
Nuxeo WebEngine and GlassFish v3 by Nuxeo
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3
Nuxeo495 views
Is Enterprise Java Still Relevant (JavaOne 2015 session) by Ian Robinson
Is Enterprise Java Still Relevant (JavaOne 2015 session)Is Enterprise Java Still Relevant (JavaOne 2015 session)
Is Enterprise Java Still Relevant (JavaOne 2015 session)
Ian Robinson5.8K views
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013) by Andreas Koop
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Andreas Koop11K views
Java EE 8 Update by Ryan Cuprak
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
Ryan Cuprak9.6K views
Glassfish An Introduction by Jumping Bean
Glassfish An IntroductionGlassfish An Introduction
Glassfish An Introduction
Jumping Bean4.2K views
Java 9 Module System Introduction by Dan Stine
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System Introduction
Dan Stine785 views

Similar to Serverless Java Challenges & Triumphs

Serverless Java - Challenges and Triumphs by
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsDavid Delabassee
282 views41 slides
Serverless Java: JJUG CCC 2019 by
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Shaun Smith
296 views51 slides
General Capabilities of GraalVM by Oleg Selajev @shelajev by
General Capabilities of GraalVM by Oleg Selajev @shelajevGeneral Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajevOracle Developers
165 views35 slides
JVMs in Containers by
JVMs in ContainersJVMs in Containers
JVMs in ContainersDavid Delabassee
1.3K views38 slides
Randstad Docker meetup - Serverless by
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessDavid Delabassee
322 views37 slides
Java and Serverless - A Match Made In Heaven, Part 1 by
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Curity
162 views47 slides

Similar to Serverless Java Challenges & Triumphs(20)

Serverless Java - Challenges and Triumphs by David Delabassee
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
David Delabassee282 views
Serverless Java: JJUG CCC 2019 by Shaun Smith
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
Shaun Smith296 views
General Capabilities of GraalVM by Oleg Selajev @shelajev by Oracle Developers
General Capabilities of GraalVM by Oleg Selajev @shelajevGeneral Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajev
Oracle Developers165 views
Java and Serverless - A Match Made In Heaven, Part 1 by Curity
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1
Curity162 views
GraalVM: Run Programs Faster Everywhere by J On The Beach
GraalVM: Run Programs Faster EverywhereGraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster Everywhere
J On The Beach207 views
GraalVM Native Images by Oleg Selajev @shelajev by Oracle Developers
GraalVM Native Images by Oleg Selajev @shelajevGraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajev
Oracle Developers278 views
Node.js and Oracle Database: New Development Techniques by Christopher Jones
Node.js and Oracle Database: New Development TechniquesNode.js and Oracle Database: New Development Techniques
Node.js and Oracle Database: New Development Techniques
Christopher Jones5.5K views
“Quantum” Performance Effects: beyond the Core by C4Media
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core
C4Media214 views
Java 40 versions_sgp by michaelisvy
Java 40 versions_sgpJava 40 versions_sgp
Java 40 versions_sgp
michaelisvy49 views
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by... by scalaconfjp
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
scalaconfjp842 views

More from David Delabassee

Serverless Kotlin by
Serverless KotlinServerless Kotlin
Serverless KotlinDavid Delabassee
251 views24 slides
REST in an Async World by
REST in an Async WorldREST in an Async World
REST in an Async WorldDavid Delabassee
2.3K views50 slides
JAX-RS 2.1 Reloaded by
JAX-RS 2.1 ReloadedJAX-RS 2.1 Reloaded
JAX-RS 2.1 ReloadedDavid Delabassee
1.7K views43 slides
Java EE 8 - February 2017 update by
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 updateDavid Delabassee
6K views65 slides
Java EE Next by
Java EE NextJava EE Next
Java EE NextDavid Delabassee
2.2K views44 slides
Java EE Next - BeJUG JavaOne Afterglow 2016 by
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016David Delabassee
433 views26 slides

More from David Delabassee(20)

Java EE Next - BeJUG JavaOne Afterglow 2016 by David Delabassee
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016
David Delabassee433 views
HTTP/2 comes to Java (Dec. 2015 version) by David Delabassee
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)
David Delabassee690 views
EJB and CDI - Alignment and Strategy by David Delabassee
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
David Delabassee31.9K views
Java EE 8 - What’s new on the Web front by David Delabassee
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
David Delabassee960 views
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0 by David Delabassee
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
David Delabassee1.8K views
Java EE 8 - An instant snapshot by David Delabassee
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
David Delabassee10.7K views
HTTP/2 Comes to Java - What Servlet 4.0 Means to You by David Delabassee
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
David Delabassee13.8K views

Recently uploaded

aATP - New Correlation Confirmation Feature.pptx by
aATP - New Correlation Confirmation Feature.pptxaATP - New Correlation Confirmation Feature.pptx
aATP - New Correlation Confirmation Feature.pptxEsatEsenek1
222 views6 slides
Transport Management System - Shipment & Container Tracking by
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container TrackingFreightoscope
6 views3 slides
nintendo_64.pptx by
nintendo_64.pptxnintendo_64.pptx
nintendo_64.pptxpaiga02016
7 views7 slides
Ports-and-Adapters Architecture for Embedded HMI by
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
35 views19 slides
predicting-m3-devopsconMunich-2023-v2.pptx by
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptxTier1 app
14 views33 slides
ADDO_2022_CICID_Tom_Halpin.pdf by
ADDO_2022_CICID_Tom_Halpin.pdfADDO_2022_CICID_Tom_Halpin.pdf
ADDO_2022_CICID_Tom_Halpin.pdfTomHalpin9
6 views33 slides

Recently uploaded(20)

aATP - New Correlation Confirmation Feature.pptx by EsatEsenek1
aATP - New Correlation Confirmation Feature.pptxaATP - New Correlation Confirmation Feature.pptx
aATP - New Correlation Confirmation Feature.pptx
EsatEsenek1222 views
Transport Management System - Shipment & Container Tracking by Freightoscope
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container Tracking
Freightoscope 6 views
Ports-and-Adapters Architecture for Embedded HMI by Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert35 views
predicting-m3-devopsconMunich-2023-v2.pptx by Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app14 views
ADDO_2022_CICID_Tom_Halpin.pdf by TomHalpin9
ADDO_2022_CICID_Tom_Halpin.pdfADDO_2022_CICID_Tom_Halpin.pdf
ADDO_2022_CICID_Tom_Halpin.pdf
TomHalpin96 views
Streamlining Your Business Operations with Enterprise Application Integration... by Flexsin
Streamlining Your Business Operations with Enterprise Application Integration...Streamlining Your Business Operations with Enterprise Application Integration...
Streamlining Your Business Operations with Enterprise Application Integration...
Flexsin 5 views
How Workforce Management Software Empowers SMEs | TraQSuite by TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite7 views
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers44 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski16 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar58 views
Top-5-production-devconMunich-2023-v2.pptx by Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app9 views

Serverless Java Challenges & Triumphs

  • 1. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless Java Challenges and Triumphs 1 Singapore JUG March 25, 2019 David Delabassee - @delabassee Oracle
  • 2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 2 Preamble…
  • 3. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
  • 4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Belgium
  • 5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 5
  • 6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 6
  • 7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 7
  • 8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 8 Serverless
  • 9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Function As a Service • Function • As a Service 9 Small bits of code with a well defined job Easy to understand and maintain The system takes care of provisioning, patching, scaling, ... Each function can scale independently
  • 10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 10 Interest in Serverless Source: Google Trends
  • 11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 11 Serverless Java?
  • 12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 12 https://blog.github.com/2018-11-15-state-of-the-octoverse-top-programming-languages/ Top programming languages by contributors as of September 30, 2018
  • 13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 13 https://redmonk.com/rstephens/2019/03/20/redmonk-top-20-languages-over-time-january-2019/ RedMonk Top 20 Languages Over Time: Sept 2012 - Jan 2019
  • 14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 14 4.96% of functions are Java 8!? https://serverless.com/blog/serverless-by-the-numbers-2018-data-report/
  • 15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 15 And the Trend isn’t Great! https://serverless.com/blog/serverless-by-the-numbers-2018-data-report/
  • 16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Serverless Java Landscape • AWS Lambda - Java 8 support (June 2015) • Azure Function - Java 8 support (February 2019) • Google Cloud Function - NA 16
  • 17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 17 http://redmonk.com/jgovernor/2016/10/12/when-web-companies-grow-up-they-turn-into-java-shops
  • 18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Serverless Java • FaaS seen as a scripting platform for the web? • Doesn't fit normal Java development patterns? • JVM not suitable for short-lived “apps”? 18
  • 19. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Blueprints for Serverless Java • “Plain old Java” • Established toolchains • Ability to build complex applications • Low latency/high performance • Rich JVM ecosystem 19
  • 20. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. • Open-source, Container NaAve, Serverless PlaDorm • Apache v2 licence • Run anywhere - Cloud / Datacenter / Laptop • Fn ♥ • FuncAons are containers 20 https://github.com/fnproject/fn
  • 21. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 21 Demo
  • 22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Fn Java Function Development Kit • Docker images –A build image for repeatable builds –An optimized runtime image • JUnit test harness • Maven support • Input/output coercion • Flow • … 22
  • 23. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Blueprints for Serverless Java • “Plain old Java” ✓ • Established toolchains ✓ • Ability to build complex applications • Low latency/high performance • Rich JVM ecosystem 23
  • 24. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 24 Fn Flow
  • 25. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Serverless 25 Permanent Storage Lives Elsewhere ts 10 5 5 5 5 8 7 7 8 10
  • 26. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Fn Flow • Build reliable and scalable Faas applica(ons • Provides rich concurrency primi(ves including fork-join, chaining, delays and error handling • Java support based on Java 8 Comple(onStage API For long-running, reliable, scalable functions
  • 27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Fn Flow For long-running, reliable, scalable functions Flow flow = Flows.currentFlow(); FlowFuture<byte[]> stage = flow.invokeFunction(aFunc, input.getBytes()) .thenApply(HttpResponse::getBodyAsBytes); byte[] result = stage.get();
  • 28. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Fn Flow 28 Demo Java FDK Flow
  • 29. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Blueprints for Serverless Java • “Plain old Java” ✓ • Established toolchains ✓ • Ability to build complex applications ✓ • Low latency/high performance • Rich JVM ecosystem 29
  • 30. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Low latency/high performance • Respect resource constraints • Start fast • Run in small(er) images 30 What do we want containerized JVMs to do?
  • 31. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Respecting Resource Constraints • JDK-8179498:attach in Linux should be relative to /proc/pid/root and namespace aware as jcmd, jsack, etc. fail to attach (resolved in JDK 10) • JDK-8193710: jcmd –l and jps commands do not list Java processes running in Docker containers (resolved in JDK 11) • And more... JDK-8203357: Container Metrics (resolved in JDK 11.0.1) • JDK 11—JEP 318: Epsilon, i.e. No-Op, Garbage Collector (experimental) 31 Being Container Friendly
  • 32. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Start Fast 32 Moving Startup Costs to Build-Time • Class Data Sharing –Avoid parsing JDK classes on start • Application CDS –Avoid parsing App classes on start • AOT compilation –Compile App classes to native .so libraries (experimental)
  • 33. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Start Fast 33 Small(er) Container Images = Faster Start-up
  • 34. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Run Small(er) Images 34 Reduce layers size • Java Function and its dependencies • Java Runtime • Operating System
  • 35. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Run Small(er) Images 35 Reduce layers size • Project Portola – Run the JVM on musl – https://openjdk.java.net/projects/portola/ • musl – Lightweight, fast, simple, free, C standard library implementation – http://www.musl-libc.org • Alpine – Security-oriented, lightweight Linux distro with 4MB base image – https://www.alpinelinux.org
  • 36. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Run Small(er) Images 36 Reduce Java Runtime layer size - jlink Modules JLink flags Mb JDK 12 Whole JDK! 318.7 openjdk:11-jre-slim 11 (default) NB: openjdk:12-jre-slim not yet available! 217.0 JRE 12 all (explicit) --add-module $(java --list-modules) 168.3 100.0% + --no-header-files --no-man-pages --strip-debug 143.0 85.0% + --compress=1 107.8 64.1% + --compress=2 83.7 49.7% Custom JRE 12 base, logging --add-module $(jdeps --print-module-deps func.jar) 47.4 28.2% 100.0% + --no-header-files --no-man-pages --strip-debug 41.6 24.7% 87.8% + --compress=2 32.0 19.0% 67.5% OpenJDK (build 12-ea+29) - alpine:3.9 x86_64 318 Mb 168 Mb 47 Mb 32 Mb
  • 37. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 37 jlink/Alpine Demo
  • 38. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Run Small(er) Images • GraalVM compiles Java source to a single native binary • Tiny image sizes • Low VM overhead 38 GraalVM
  • 39. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 39 GraalVM Demo
  • 40. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Blueprints for Serverless Java • “Plain old Java” ✓ • Established toolchains ✓ • Ability to build complex applications ✓ • Low latency/high performance ✓ • Rich JVM ecosystem 40
  • 41. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Ongoing Ecosystem Evolution… • Substrate VM • Java release cadence • Other JVM based languages – Kotlin, Groovy, etc. • … • Fn init-image 41
  • 42. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Blueprints for Serverless Java • “Plain old Java” ✓ • Wide choice of good tooling ✓ • Ability to build complex applications ✓ • Low latency/high performance ✓ • Rich JVM ecosystem ✓ 42
  • 43. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 43 Serverless Java—Does it have a future? Absolutely!
  • 44. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 44 Call to Action https://github.com/fnproject/fn
  • 45. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Coming Soon: Oracle Functions Function Dev KitsOpen Source Engine Oracle Cloud Triggers Events HTTP Timer Streams Container Native Advanced DiagnosticsFine-grained Billing
  • 46. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 46 Thanks!