SlideShare a Scribd company logo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 1
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 2
Serverless Java
Shaun Smith
Director of Product Management
Oracle Cloud Infrastructure—Serverless
@shaunMsmith
May 18, 2019
Challenges and Triumphs
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, timing, and pricing of any
features or functionality described for Oracle’s products may change and remains at the
sole discretion of Oracle Corporation.
3
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 4
Serverless
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Serverless is an abstraction of infrastructure and its
operations including provisioning, scaling, patching, etc.
FaaS (Functions-as-a-Service) is the compute
component in a serverless platform
5
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 6
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example Java Function
7
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Serverless Today
8
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 9
Interest in Serverless
Source: Google Trends
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 10
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 11
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 12
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 13
Source: https://jaxenter.com/technologies-dominate-2019-poll-152470.html
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Peak of Inflated Expectations
Plateau of Productivity
Slope of Enlightenment
Trough of Disillusionment
14
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Serverless Java?
15
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 16
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. | 17
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
New Relic: 9.1% of functions are Java 8!?
https://blog.newrelic.com
18
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Serverless.com: 6.1% of all functions are Java!?
https://serverless.com/blog/2018-serverless-community-survey-huge-growth-usage/
19
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Serveless.com, Large Companies > 1000: 14.9% Java
https://serverless.com/blog/2018-serverless-community-survey-huge-growth-usage/
20
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
And the Trend isn’t Great
https://serverless.com/blog/serverless-by-the-numbers-2018-data-report/
21
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
http://redmonk.com/jgovernor/2016/10/12/when-web-companies-grow-up-they-turn-into-java-shops
22
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Why isn’t Java popular for Functions?
• FaaS seen as a scripting platform for the web?
• Doesn't fit normal Java development patterns?
• Java not suitable for short-lived “apps”?
• Not supported?
–Google Cloud Functions—N/A
–AWS Lambda—Java support added June 2015
–Oracle Functions—Limited Availability Dec. 2018
–Azure Functions—Java 8 GA on Feb 2019
23
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Blueprint for Serverless Java
• “Plain old Java”
• Established toolchains
• Ability to build complex applications
• Low latency/high performance
• Java ecosystem
24
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
www.fnproject.io
25
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• Open-source, Container Naive, Serverless Plajorm
• Apache v2 licence
• Run anywhere - Cloud / Datacenter / Laptop
• Fn ♥
• Funcions are containers
26
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 27
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 28
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fn Java Function Development Kit (FDK)
• Docker Images
–A build image for repeatable builds
–An optimized runtime image
• JUnit Test Harness
• Maven support
• Input/output coercion
• Flow
• …
29
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 30
Java Functions Demo!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Blueprint for Serverless Java
• “Plain old Java” ✓
• Established toolchains ✓
• Ability to build complex applications
• Low latency/high performance
• JVM ecosystem
31
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 32
Fn Flow
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fn Flow
• Provides rich concurrency primitives including fork-join, chaining, delays
and error handling
• Java support based on Java 8 CompletableFuture API
• Build reliable and scalable FaaS applications
For long-running, reliable, scalable functions
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fn Flow Demo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
http://microservices.io/patterns/data/saga.html
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 36
Fn Flow Demo!
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
37
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Low Latency/High Performance – Java in Containers
What do we want containerized Java applications to do?
–Respect resource constraints
–Start fast
–Run fast
38
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Container Friendly Java – Respecting Resource Constraints
• JDK-8179498: attach in linux should be relaive
to /proc/pid/root and namespace aware as jcmd, jstack, etc. fail to
arach (resolved in JDK 10)
• JDK-8193710: jcmd -l and jps commands do not list Java processes
running in Docker containers (resolved in JDK 11)
• JDK-8203357: Container Metrics (resolved in JDK 11.0.1)
• JEP 318: Epsilon: A No-Op Garbage Collector (Experimental in JDK 11)
• …
39
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fast Startup – Moving Costs to Build-Time
1. Class Data Sharing (CDS)
– Avoid parsing JDK classes on start
2. Application CDS
– Avoid parsing App classes on start
3. AOT compilation
– Compile App classes to native .so libraries (experimental)
40
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fast Startup – Small Container Images
Small JVM container images means faster startup by reducing:
–Image to host transfer time
–Docker Copy on Write (COW) cache creation
–Docker Overlay FS setup
41
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fast Startup — Building Smaller Java Container Images
1. Use jlink to remove unused core libraries
2. Start with small base images
3. GraaVM native image - compile Java to a static binary
42
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fast Startup — Small Base Images
Security-oriented, lightweight Linux distribution
with 4MB base image
Lightweight, fast, simple, free, C standard library
implementation
43
Reduce OS layer size
Project Portola’s goal is to run the JVM on Alpine Linux/Musl
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fast Startup — Smaller Java Applications
44
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
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. |
Fast Startup — Smaller Java Applications
• GraalVM compiles Java source to a single native binary
• Tiny image sizes
• Low VM overhead
45
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 46
GraalVM
Functions Demo!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Blueprint for Serverless Java
• “Plain old Java” ✓
• Wide choice of good tooling ✓
• Ability to build complex applications ✓
• Low latency/high performance ✓
• Rich JVM ecosystem ✓
47
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 48
Serverless Java?
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 49
Serverless Java? Absolutely!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Shaun Smith
fnproject.io
@shaunMsmith
50
Thank you!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 51

More Related Content

What's hot (20)

PDF
JDK 10 Java Module System
Wolfgang Weigend
 
PPTX
Modularization With Project Jigsaw in JDK 9
Simon Ritter
 
PDF
Cloud Native Java GraalVM 이상과 현실
Taewan Kim
 
PDF
Oracle Keynote from JMagghreb 2014
Simon Ritter
 
PPTX
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Bruno Borges
 
PDF
Java: Create The Future Keynote
Simon Ritter
 
PDF
JDK 9 Java Platform Module System
Wolfgang Weigend
 
PPTX
JDK 9: Big Changes To Make Java Smaller
Simon Ritter
 
PDF
A Java Implementer's Guide to Better Apache Spark Performance
Tim Ellison
 
PPTX
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Bruno Borges
 
PPTX
JDK 9: Big Changes To Make Java Smaller
Simon Ritter
 
PDF
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Bruno Borges
 
PPTX
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Chris Muir
 
PPTX
JDK 9: Mission Accomplished. What Next For Java?
Simon Ritter
 
PDF
Oracle ADF Architecture TV - Design - Architecting for ADF Mobile Integration
Chris Muir
 
PDF
Introduction to JavaFX on Raspberry Pi
Bruno Borges
 
PDF
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Chris Muir
 
PDF
Monitoring of Web Applications and GlassFish for Performance and Availability...
SL Corporation
 
PDF
JDK-9: Modules and Java Linker
Bhanu Prakash Gopularam
 
PDF
Oracle ADF Architecture TV - Design - Designing for Internationalization
Chris Muir
 
JDK 10 Java Module System
Wolfgang Weigend
 
Modularization With Project Jigsaw in JDK 9
Simon Ritter
 
Cloud Native Java GraalVM 이상과 현실
Taewan Kim
 
Oracle Keynote from JMagghreb 2014
Simon Ritter
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Bruno Borges
 
Java: Create The Future Keynote
Simon Ritter
 
JDK 9 Java Platform Module System
Wolfgang Weigend
 
JDK 9: Big Changes To Make Java Smaller
Simon Ritter
 
A Java Implementer's Guide to Better Apache Spark Performance
Tim Ellison
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Bruno Borges
 
JDK 9: Big Changes To Make Java Smaller
Simon Ritter
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Bruno Borges
 
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Chris Muir
 
JDK 9: Mission Accomplished. What Next For Java?
Simon Ritter
 
Oracle ADF Architecture TV - Design - Architecting for ADF Mobile Integration
Chris Muir
 
Introduction to JavaFX on Raspberry Pi
Bruno Borges
 
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Chris Muir
 
Monitoring of Web Applications and GlassFish for Performance and Availability...
SL Corporation
 
JDK-9: Modules and Java Linker
Bhanu Prakash Gopularam
 
Oracle ADF Architecture TV - Design - Designing for Internationalization
Chris Muir
 

Similar to Serverless Java: JJUG CCC 2019 (20)

PDF
Serverless Java Challenges & Triumphs
David Delabassee
 
PPTX
Serverless Kotlin
David Delabassee
 
PDF
JVMs in Containers
David Delabassee
 
PPTX
Practical Tips for Hardening Java Applications
Shaun Smith
 
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Jakarta_EE
 
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
The Eclipse Foundation
 
PDF
Red Hat Java Update and Quarkus Introduction
John Archer
 
PDF
USAA Mono-to-Serverless.pdf
RichHagarty
 
PDF
Java-light-speed NebraskaCode.pdf
RichHagarty
 
PDF
Java in the Age of Containers and Serverless
Markus Eisele
 
PPTX
[JOI] TOTVS Developers Joinville - Java #1
Rubens Dos Santos Filho
 
PDF
Javantura v6 - Java SE, Today and Tomorrow - Dalibor Topic
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
The State of Java under Oracle at JCertif 2011
Arun Gupta
 
PPTX
Are you ready for cloud-native java JavaCro2019
Jamie Coleman
 
PDF
Open source for you - November 2017
Heart Disk
 
PDF
Running Java Applications on Cloud Foundry
VMware Tanzu
 
PPTX
Are you ready for cloud-native Java?
Graham Charters
 
PPTX
Java 101
javafxpert
 
PDF
Run your Java code on Cloud Foundry
Andy Piper
 
PPTX
CNCF Live Webinar: Low Footprint Java Containers with GraalVM
LibbySchulze
 
Serverless Java Challenges & Triumphs
David Delabassee
 
Serverless Kotlin
David Delabassee
 
JVMs in Containers
David Delabassee
 
Practical Tips for Hardening Java Applications
Shaun Smith
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Jakarta_EE
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
The Eclipse Foundation
 
Red Hat Java Update and Quarkus Introduction
John Archer
 
USAA Mono-to-Serverless.pdf
RichHagarty
 
Java-light-speed NebraskaCode.pdf
RichHagarty
 
Java in the Age of Containers and Serverless
Markus Eisele
 
[JOI] TOTVS Developers Joinville - Java #1
Rubens Dos Santos Filho
 
Javantura v6 - Java SE, Today and Tomorrow - Dalibor Topic
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
The State of Java under Oracle at JCertif 2011
Arun Gupta
 
Are you ready for cloud-native java JavaCro2019
Jamie Coleman
 
Open source for you - November 2017
Heart Disk
 
Running Java Applications on Cloud Foundry
VMware Tanzu
 
Are you ready for cloud-native Java?
Graham Charters
 
Java 101
javafxpert
 
Run your Java code on Cloud Foundry
Andy Piper
 
CNCF Live Webinar: Low Footprint Java Containers with GraalVM
LibbySchulze
 
Ad

More from Shaun Smith (14)

PPTX
A 1.5MB Java Container App? Yes you can!
Shaun Smith
 
PPTX
Functions and DevOps
Shaun Smith
 
PPTX
Democratizing Serverless
Shaun Smith
 
PDF
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Shaun Smith
 
PDF
Lightweight Java in the Cloud
Shaun Smith
 
PDF
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
Shaun Smith
 
PPT
Practical RESTful Persistence
Shaun Smith
 
PPTX
The Evolution of Java Persistence
Shaun Smith
 
ODP
EclipseCon 2011-Gemini Naming
Shaun Smith
 
ODP
EclipseCon 2011-Gemini Intro
Shaun Smith
 
ODP
EclipseCon 2011-Gemini JPA
Shaun Smith
 
PPT
RESTful Data Access Services with Java EE
Shaun Smith
 
PPT
RESTful services with JAXB and JPA
Shaun Smith
 
PPT
OSGi Persistence With EclipseLink
Shaun Smith
 
A 1.5MB Java Container App? Yes you can!
Shaun Smith
 
Functions and DevOps
Shaun Smith
 
Democratizing Serverless
Shaun Smith
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Shaun Smith
 
Lightweight Java in the Cloud
Shaun Smith
 
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
Shaun Smith
 
Practical RESTful Persistence
Shaun Smith
 
The Evolution of Java Persistence
Shaun Smith
 
EclipseCon 2011-Gemini Naming
Shaun Smith
 
EclipseCon 2011-Gemini Intro
Shaun Smith
 
EclipseCon 2011-Gemini JPA
Shaun Smith
 
RESTful Data Access Services with Java EE
Shaun Smith
 
RESTful services with JAXB and JPA
Shaun Smith
 
OSGi Persistence With EclipseLink
Shaun Smith
 
Ad

Recently uploaded (20)

PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 

Serverless Java: JJUG CCC 2019

  • 1. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 1
  • 2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 2 Serverless Java Shaun Smith Director of Product Management Oracle Cloud Infrastructure—Serverless @shaunMsmith May 18, 2019 Challenges and Triumphs
  • 3. 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, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. 3
  • 4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 4 Serverless
  • 5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless is an abstraction of infrastructure and its operations including provisioning, scaling, patching, etc. FaaS (Functions-as-a-Service) is the compute component in a serverless platform 5
  • 6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 6
  • 7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example Java Function 7
  • 8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless Today 8
  • 9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 9 Interest in Serverless Source: Google Trends
  • 10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 10
  • 11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 11
  • 12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 12
  • 13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 13 Source: https://jaxenter.com/technologies-dominate-2019-poll-152470.html
  • 14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Peak of Inflated Expectations Plateau of Productivity Slope of Enlightenment Trough of Disillusionment 14
  • 15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless Java? 15
  • 16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 16 https://blog.github.com/2018-11-15-state-of-the-octoverse-top-programming-languages/ Top programming languages by contributors as of September 30, 2018
  • 17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 17
  • 18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | New Relic: 9.1% of functions are Java 8!? https://blog.newrelic.com 18
  • 19. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless.com: 6.1% of all functions are Java!? https://serverless.com/blog/2018-serverless-community-survey-huge-growth-usage/ 19
  • 20. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serveless.com, Large Companies > 1000: 14.9% Java https://serverless.com/blog/2018-serverless-community-survey-huge-growth-usage/ 20
  • 21. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | And the Trend isn’t Great https://serverless.com/blog/serverless-by-the-numbers-2018-data-report/ 21
  • 22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | http://redmonk.com/jgovernor/2016/10/12/when-web-companies-grow-up-they-turn-into-java-shops 22
  • 23. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Why isn’t Java popular for Functions? • FaaS seen as a scripting platform for the web? • Doesn't fit normal Java development patterns? • Java not suitable for short-lived “apps”? • Not supported? –Google Cloud Functions—N/A –AWS Lambda—Java support added June 2015 –Oracle Functions—Limited Availability Dec. 2018 –Azure Functions—Java 8 GA on Feb 2019 23
  • 24. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Blueprint for Serverless Java • “Plain old Java” • Established toolchains • Ability to build complex applications • Low latency/high performance • Java ecosystem 24
  • 25. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | www.fnproject.io 25
  • 26. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | • Open-source, Container Naive, Serverless Plajorm • Apache v2 licence • Run anywhere - Cloud / Datacenter / Laptop • Fn ♥ • Funcions are containers 26
  • 27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 27
  • 28. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 28
  • 29. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fn Java Function Development Kit (FDK) • Docker Images –A build image for repeatable builds –An optimized runtime image • JUnit Test Harness • Maven support • Input/output coercion • Flow • … 29
  • 30. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 30 Java Functions Demo!
  • 31. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Blueprint for Serverless Java • “Plain old Java” ✓ • Established toolchains ✓ • Ability to build complex applications • Low latency/high performance • JVM ecosystem 31
  • 32. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 32 Fn Flow
  • 33. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fn Flow • Provides rich concurrency primitives including fork-join, chaining, delays and error handling • Java support based on Java 8 CompletableFuture API • Build reliable and scalable FaaS applications For long-running, reliable, scalable functions
  • 34. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fn Flow Demo
  • 35. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | http://microservices.io/patterns/data/saga.html
  • 36. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 36 Fn Flow Demo!
  • 37. 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 37
  • 38. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Low Latency/High Performance – Java in Containers What do we want containerized Java applications to do? –Respect resource constraints –Start fast –Run fast 38
  • 39. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Container Friendly Java – Respecting Resource Constraints • JDK-8179498: attach in linux should be relaive to /proc/pid/root and namespace aware as jcmd, jstack, etc. fail to arach (resolved in JDK 10) • JDK-8193710: jcmd -l and jps commands do not list Java processes running in Docker containers (resolved in JDK 11) • JDK-8203357: Container Metrics (resolved in JDK 11.0.1) • JEP 318: Epsilon: A No-Op Garbage Collector (Experimental in JDK 11) • … 39
  • 40. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fast Startup – Moving Costs to Build-Time 1. Class Data Sharing (CDS) – Avoid parsing JDK classes on start 2. Application CDS – Avoid parsing App classes on start 3. AOT compilation – Compile App classes to native .so libraries (experimental) 40
  • 41. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fast Startup – Small Container Images Small JVM container images means faster startup by reducing: –Image to host transfer time –Docker Copy on Write (COW) cache creation –Docker Overlay FS setup 41
  • 42. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fast Startup — Building Smaller Java Container Images 1. Use jlink to remove unused core libraries 2. Start with small base images 3. GraaVM native image - compile Java to a static binary 42
  • 43. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fast Startup — Small Base Images Security-oriented, lightweight Linux distribution with 4MB base image Lightweight, fast, simple, free, C standard library implementation 43 Reduce OS layer size Project Portola’s goal is to run the JVM on Alpine Linux/Musl
  • 44. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fast Startup — Smaller Java Applications 44 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 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
  • 45. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fast Startup — Smaller Java Applications • GraalVM compiles Java source to a single native binary • Tiny image sizes • Low VM overhead 45
  • 46. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 46 GraalVM Functions Demo!
  • 47. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Blueprint for Serverless Java • “Plain old Java” ✓ • Wide choice of good tooling ✓ • Ability to build complex applications ✓ • Low latency/high performance ✓ • Rich JVM ecosystem ✓ 47
  • 48. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 48 Serverless Java?
  • 49. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 49 Serverless Java? Absolutely!
  • 50. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Shaun Smith fnproject.io @shaunMsmith 50 Thank you!
  • 51. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 51