Slide 1

Slide 1 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless Architectures and Patterns in Action Abhishek Gupta Senior Product Manager Oracle Cloud Infrastructure—Serverless @abhi_tweeter March 15, 2019

Slide 2

Slide 2 text

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. 2

Slide 3

Slide 3 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Agenda • Hello Serverless • Open source fnproject and Oracle Functions • “… in action” – use cases + demos • QnA 3

Slide 4

Slide 4 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | For slides and code… https://github.com/abhirockzz/oraclecode2019 4

Slide 5

Slide 5 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless 5

Slide 6

Slide 6 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 6

Slide 7

Slide 7 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 7 Serverless characteristics There are servers, but don’t worry about them (provisioning, patching etc.) Scale (in and out) automatically Cost effective – pay only for use

Slide 8

Slide 8 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Functions • Simple piece of code that does one job • Event driven • More often than not – Stateless – Short • All the Serverless goodness! • Don’t worry about underlying infra • Pay only when code executes • Auto scale 8 The serverless application programming model IaaS PaaS CaaS FaaS Lower abstraction Higher abstraction Higher control Lower control

Slide 9

Slide 9 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 9 FaaS-inating options Oracle Functions Open source Cloud offerings and lots more….

Slide 10

Slide 10 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fn Project & Oracle Functions 10

Slide 11

Slide 11 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fn—An open source Functions Platform • Open Source—no vendor lock-in • Docker Based—leverage Docker ecosystem • Platform Independent—laptop, server, cloud • Scheduler Independent—deploy to Kubernetes, Swarm, Mesos, etc. • Approachable—easy for new users, low level controls for advanced users 11 www.fnproject.io

Slide 12

Slide 12 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Introducing Oracle Functions Autonomous Platform auto-scales functions No servers to provision, manage Pay Per Use Pay for execution, not for idle time No Lock-in Built on open-source Fn Project and Docker Oracle Functions Functions-as-a-Service Oracle Cloud Integrated Container Native Multi-tenant Secure Open Source Engine 12 Coming soon (currently in Limited Availability)

Slide 13

Slide 13 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Key concepts 13

Slide 14

Slide 14 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 14 A Function

Slide 15

Slide 15 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 15 Function Development Kits (FDKs) FDK documentation fn server FDK function http-stream protocol

Slide 16

Slide 16 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | deploy and run 16 - function - func.yaml - Dockerfile deploy invoke Pull image, run container Docker registry Server (fn or Oracle Functions)

Slide 17

Slide 17 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 17 CLI

Slide 18

Slide 18 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | “HelloWorld” demo 18

Slide 19

Slide 19 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 19 fn - hello world demo 1. fn start 2. fn init --runtime go --name hellofunc 3. fn use context default 4. fn create app oracodemo 5. fn –v deploy --app oracodemo --local 6. fn invoke oracodemo hellofunc

Slide 20

Slide 20 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 20 Moving to the cloud - Oracle Functions 1. fn start 2. fn init --runtime go --name hellofunc 3. fn use context 4. fn create app oracodemo 5. fn –v deploy --app oracodemo --local 6. fn invoke oracodemo hellofunc

Slide 21

Slide 21 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Serverless Use Cases & Patterns 21

Slide 22

Slide 22 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 22 Backend systems Event-Driven systems Integration Automation • APIs • Web apps • Simple apps • Event driven apps • Stream Processing • Webhooks • Workflows • IaaS monitoring • Scheduled/Batch jobs

Slide 23

Slide 23 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Backend systems 23

Slide 24

Slide 24 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Single purpose apps 24 Tensorflow Image Classification Fn CLI (or any other client) Oracle Functions (using Tensorflow Java SDK)

Slide 25

Slide 25 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | APIs (data services) 25 API Gateway Mobile Web Oracle Functions Legacy system Other backend(s)

Slide 26

Slide 26 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | FaaS APIs + ‘friends’ = Serverless Web apps 26 API Gateway Object Storage Front end assets (HTML, JS etc.) User

Slide 27

Slide 27 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Event-Driven systems 27

Slide 28

Slide 28 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Asynchronous processing OCI Object Storage Object Storage events – created, deleted, updated etc. Oracle Functions Drops text file to input bucket 1 2 3 Converts to PDF and stores in output bucket Text to PDF conversion

Slide 29

Slide 29 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Stream Processing • Built to handle continuous (streams of) data – Durable/persistent • Possible to replay and reprocess data (aka time travel) – Message Ordering, low latency, different guarantees • Amazon Kinesis, Apache Kafka etc. • Streaming-FaaS integration – Native – tight coupling b/w streaming and FaaS platforms • vendor specific e.g. Kinesis -> Lambda – Custom – roll your own • vendor agnostic, flexible e.g. Kafka -> FaaS • Need a server component 29

Slide 30

Slide 30 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Kafka -> Kafka Connect -> FaaS 30 Kafka Connect (sink connectors) Kafka Connect (source connectors) Producers Consumers Sources Oracle Functions Stream Processors

Slide 31

Slide 31 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Integration 31

Slide 32

Slide 32 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Webhooks • Wikipedia – “user-defined HTTP callbacks” – “usually triggered by some event” • Event driven on steroids – trigger functions using (almost) any event source • Easily integrate with third party systems like GitHub, Slack, Twilio etc. 32 Slack service (with configured webhook) Random API Slack workspace (user) 1 2 3 4 funcy – trimmed down version of the Giphy Slack app

Slide 33

Slide 33 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 33 https://blog.csanchez.org/2019/02/19/serverless-jenkins-pipelines-with-project-fn/

Slide 34

Slide 34 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Function Orchestration • Problem(s) – How do I integrate functions to build complex apps ? – Orchestrate their behavior – Manage intermediate state • Options - AWS Step Functions, Azure Durable Functions, Fn Flow etc. • Fn Flow – Build long-running functions with rich sets of language- specific primitives including fork-join, chaining, delays and error handling – Supports complex parallel processes that are readable and testable (including unit tests) with standard programming tools 34 Fn Flow Java User Guide

Slide 35

Slide 35 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Automation 35

Slide 36

Slide 36 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Infra monitoring 36 IaaS Create, start, stop, terminate etc. Events…. Oracle Functions Monitoring Oracle DB lifecycle events OCI Email Delivery Service

Slide 37

Slide 37 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Scheduled Jobs • Configure and forget! • Good for automating repetitive tasks – Reminders, alerts (email, SMS etc.) – Backups, import/export – etc. 37

Slide 38

Slide 38 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Tips • SRP - try to do one thing well • Factor in cold start times – may or may not be critical, depending on the use case • Externalize state – Do not depend on ‘hot’ functions • Be careful when using databases – Rely on your Serverless friends • Avoid chaining function calls – Leverage higher order orchestration services if possible 38

Slide 39

Slide 39 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Credits • Our engineering teams • Customers and community • Fellow Product Managers… 39

Slide 40

Slide 40 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Links • Blog - https://medium.com/fnproject • Twitter - https://twitter.com/fnproject • GitHub – Fn – https://github.com/fnproject/fn – FDKs - https://github.com/fnproject/?&q=fdk – Fn Flow - https://github.com/fnproject/flow • Slack - https://fnproject.slack.com/ • Oracle Functions - https://blogs.oracle.com/cloud-infrastructure/announcing-oracle- functions • GitHub repo for this talk - https://github.com/abhirockzz/oraclecode2019 40

Slide 41

Slide 41 text

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Thank you ! 41

Slide 42

Slide 42 text

No content