Upgrade to Pro — share decks privately, control downloads, hide ads and more …

oracle-code-2019-serverless-architectures-and-p...

 oracle-code-2019-serverless-architectures-and-patterns-in-action.pdf

Abhishek Gupta

March 15, 2019
Tweet

More Decks by Abhishek Gupta

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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
  4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | For slides and code… https://github.com/abhirockzz/oraclecode2019 4
  5. 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
  6. 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
  7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 9 FaaS-inating options Oracle Functions Open source Cloud offerings and lots more….
  8. 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
  9. 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)
  10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 15 Function Development Kits (FDKs) FDK documentation fn server FDK function http-stream protocol
  11. 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)
  12. 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
  13. 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 <name> 4. fn create app <additional info> oracodemo 5. fn –v deploy --app oracodemo --local 6. fn invoke oracodemo hellofunc
  14. 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
  15. 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)
  16. 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)
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 33 https://blog.csanchez.org/2019/02/19/serverless-jenkins-pipelines-with-project-fn/
  23. 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
  24. 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
  25. 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
  26. 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
  27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Credits • Our engineering teams • Customers and community • Fellow Product Managers… 39
  28. 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