Serverless is the Abstraction We Deserve

A presentation at GOTO Chicago 2019 in April 2019 in Chicago, IL, USA by Jesse Butler

Slide 1

Slide 1

ive Serverless Is the Abstraction We Deserve Jesse Butler Cloud Developer Advocate, Oracle Cloud Infrastructure cloudnative.oracle.com @jlb13

Slide 2

Slide 2

“Serverless is the hero you deserve, but not the one you need right now.” - Me, like a year ago Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 3

Slide 3

Serverless is Just the Next Abstraction, Right? • Why the friction? Is there fear? • We might be unclear regarding what Serverless is really offering • Especially true if we don’t fully understand the liabilities within our current solutions Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 4

Slide 4

Abstraction Enables Powerful Solutions • Abstractions are good for computing • Tubes led to transistors, ICs eventually led to multi-core CPUs • Machine language led to assembly, C and the whole slew of higher level languages that we love more than C Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 5

Slide 5

Abstraction Lowers the Barrier to Entry • If we still needed soldering and wirewrap skills to do computering, the world would be a very different place • Word processing, music production, programming – everything benefits from abstraction Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 6

Slide 6

Abstraction Lowers the Barrier to Entry • If we still needed soldering and wirewrap skills to do computering, the world would be a very different place • Word processing, music production, programming – everything benefits from abstraction Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 7

Slide 7

Abstraction Lowers the Barrier to Entry • If we still needed soldering and wirewrap skills to do computering, the world would be a very different place • Word processing, music production, programming – everything benefits from abstraction Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 8

Slide 8

Abstraction Lowers the Barrier to Entry • If we still needed soldering and wirewrap skills to do computering, the world would be a very different place • Word processing, music production, programming – everything benefits from abstraction Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 9

Slide 9

Abstraction In Systems Can Feel Very Uncomfortable • When systems and infrastructure are abstracted, things can be weird • We might lose a lot of our well-worn solutions in this area, specifically • We feel we are pulling dependencies in that we can’t control • We can start to understand some of the friction… Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 10

Slide 10

Goals • Describe Serverless as both Architecture and Platform • Share my opinion regarding the primary benefits of Serverless • Break down some of the friction, and offer some guidance • Hopefully help you get started! Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 11

Slide 11

Monolithic Applications Users Application Database Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 12

Slide 12

Monolithic Applications Users Application Database Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 13

Slide 13

Virtualization and Consolidation Abstractions Containers Virtual machines Bare Metal To the Cloud Decreasing concern (and control) over infrastructure implementation Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 14

Slide 14

Microservices Deploying Code to Systems We Build in the Cloud with Containers and Kubernetes Load balancer Service Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Service Service Database Queue @jlb13

Slide 15

Slide 15

Serverless Deploying Code to Systems We Build in the Cloud with Containers and Kubernetes Load balancer Service Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Service Service Database Queue @jlb13

Slide 16

Slide 16

Trend towards Serverless Functions Abstractions Containers Virtual machines Bare Metal To the Cloud Infrastructure implementation and maintenance responsibility Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 17

Slide 17

What Can We Build With Serverless? • Web and Mobile Backends • Any other backend API implementations • Real-time Processing of Files, Streams • Batch Processing • Gluing up SaaS things • Kind of anything Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 18

Slide 18

Serverless as a Platform Event Sources Function Execution F(n) F(n) F(n) Backend Services F(n) Kubernetes, Docker, and/or Hypervisor Business Intelligence Analytics Triggers Compute, Network, Storage Databases Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 19

Slide 19

Serverless is a Spectrum (Stay With Me) Container Orchestration Kubernetes Nomad Docker Swarm Ideally managed, but still infrastructure you care about Full Container Services ECS, Fargate Azure CS GCP Cloud Run DIY FaaS OpenFaaS Fn Project OpenWhisk Managed service provision containers, abstracts infrastructure you care about Leverage container management system under the covers, introduce Functions architecture Awareness and control of infrastructure Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Managed Serverless AWS Lambda Azure Functions Google Cloud Functions Oracle Functions IBM Cloud Functions Fully managed platform for hosting and executing code None @jlb13

Slide 20

Slide 20

Containers are the new Process Model, Right? Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 21

Slide 21

Containers are the new Process Model, Right? Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 22

Slide 22

Don’t Conflate Requirements with Complexity Aversion Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 23

Slide 23

What Is Serverless • Event-driven architecture • Invisible infrastructure • Automatic scaling on demand • Granular billing for execution time • Fault tolerant and highly available Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 24

Slide 24

Serverless Deployment, the Duck Test Upload Function Source Code Configure Function Trigger Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Function is invoked when triggered Pay for execution time, not idle time @jlb13

Slide 25

Slide 25

Serverless is a Spectrum Container Orchestration Kubernetes Nomad Docker Swarm Ideally managed, but still infrastructure you care about Full Container Services ECS, Fargate Azure CS GCP Cloud Run DIY FaaS OpenFaaS Fn Project OpenWhisk Managed service provision containers, abstracts infrastructure you care about Leverage container management system under the covers, introduce Functions architecture Awareness and control of infrastructure Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Managed Serverless AWS Lambda Azure Functions Google Cloud Functions Oracle Functions IBM Cloud Functions Fully managed platform for hosting and executing code None @jlb13

Slide 26

Slide 26

What Is Serverless, Distilled Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 27

Slide 27

What Is Serverless Not • It’s not magic, it’s a choice • Brownfield: You need to break the monolith apart regardless • Greenfield: You need a solid design and to truly understand the platform • Nothing is free Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 28

Slide 28

Hype Cycle – Productive Adoption Cloud Computing Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 29

Slide 29

Hype Cycle – Serverless in Waves Serverless Computing Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 30

Slide 30

Get Through This Quickly… Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 31

Slide 31

…And Get Here Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 32

Slide 32

Serverless the Platform • Serverless is both an architecture and a platform • Our abstractions are converging • Comparatively, it’s a big change from cloud, or containers • Pets vs Cattle isn’t a thing with serverless, it’s a “don’t care” Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 33

Slide 33

Letting Go • There are trade-offs for the powerful abstractions of Serverless • We have to let go of the control we feel we have • Even harder if we’ve recently migrated to cloud on a different vector Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 34

Slide 34

Mother of all Dependencies • As we deploy infrastructure, even if it’s virtual, we feel in control • We roll out solutions as needed, when needed, because we can • To embrace Serverless fully, we lose some of this control and influence • Or, like… all of it. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 35

Slide 35

Control From Necessity • Control often comes out of necessity • “Something is on fire and I need to find out what’s going on…” Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 36

Slide 36

Standing in the Dumpster • Sometimes, we build really elegant solutions to these problems • And sometimes, the fires are due to the systems themselves Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 37

Slide 37

Acceptance of Abstraction within Context • Often, acceptance teeters on context • Everyone who writes code uses memory, we don’t think too much about the virtual memory implementation • We can accept some amount of abstraction as a good thing Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 38

Slide 38

The Cloud is One Big Abstraction • There is, in fact, a cloud. Many, really. • You can offload a ton of concerns though, which is nice • Cloud offers an opportunity to improve the way we build and ship software • But nothing inherently enforces this Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Well, lots of computers, and storage, and network, and managed services, and support, and capacity planning, and… yeah. This is silly. @jlb13

Slide 39

Slide 39

Let’s Talk About Containers • Containers are not complicated • Docker solves many problems with containers elegantly • But containers are ultimately an implementation detail Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 40

Slide 40

Let’s Talk About Kubernetes • Kubernetes has great abstractions • Kubernetes is an elegant, extensible solution for running containers at scale • At the end of the day, it’s a platform for building solutions Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 41

Slide 41

So What’s Wrong With This? • Plot-twist: nothing, really • Development teams can and do have great success adopting Kubernetes • For development-focused teams, Serverless just makes sense Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 42

Slide 42

Serverless as a Black Box • It’s about context • Lean into the abstraction • Serverless builds upon years of hard-learned systems lessons • Write application code against a well-defined interface • Complex systems concerns are pushed to the system Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 43

Slide 43

On to Functions • Ideally small, easy to reason about • Implemented to work together • Idempotency to maintain sanity • All sounds familiar, surely… Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 44

Slide 44

Single Responsibility Principal, 2003 ”Every module, class, or function should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class.” - Robert C Martin (Uncle Bob), on SRP Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 45

Slide 45

UNIX Philosophy, 1978 “Make each program do one thing well.” -Doug McIlroy, on the UNIX Philosophy Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 46

Slide 46

Story Time • I had to fix a bug once in a SCSI HBA driver • This driver was implemented in 40k LOC – All in one source file – With very few functions – The few in place were thousands of lines long – It was hot garbage as a result • First implemented about 15 years after Doug McIlroy’s wonderful advice Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 47

Slide 47

Serverless the Architecture • Structures and components of a software system • Practice of creating those components; how they are built • Serverless the platform is an implementation detail of Serverless the architecture Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 48

Slide 48

Big Ideas • Start small and compose solutions • Don’t own what you don’t have to • Plan ahead for observability • Think ahead to migration cost Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 49

Slide 49

Use Services and SaaS When Possible • DBaaS • Identity, Auth, Forms • Storage Services • Email, SMS • Maps, GPS • Media Streaming • Chat and Chatbots Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 50

Slide 50

Choose a Pattern that Helps you Minimize • If a function does more than one discrete thing, break it up • Better to proliferate than to decompensate • Observability and triage become infinitely easier at the boundaries Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 51

Slide 51

Separate and Simplify • Simplify your application estate • Events can and probably should define application boundaries • Share libraries between functions and applications, not execution context Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 52

Slide 52

Platform and Practice Challenges • How do we bring our current solutions into Serverless? • CI/CD, Configuration Management, Observability are all table stakes • This isn’t as hard as it seems, if we embrace the abstraction Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 53

Slide 53

Tooling and Pipelines • Development workflow is largely unchanged. Do the things that work. • As we’ve moved from bespoke compute environments, so too our automation has evolved • Vendors fill in blanks, from managed services to gateway-type services Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 54

Slide 54

Configuration Management • We have established practices here, also largely unchanged • Lean on managed services and aspects of the platform • Do what you can at deployment to control your runtime environment Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 55

Slide 55

Brownfield Adoption • Cloud offers more than other people’s computers and cables • This is going to happen, regardless • Far less moving parts with Serverless Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 56

Slide 56

Security • This becomes largely a vendor feature • It’s on you to not abuse the abstraction • You don’t need to know the details, but you still need to do the work Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 57

Slide 57

Observability • Metrics – Aggregate data regarding the behavior of a thing over time • Tracing – Instrumentation which provides an instance of an action, traversing the entire stack • Logging – Developer breadcrumbs we leave to give context for a certain code path Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 58

Slide 58

Triaging Issues • Monolith in a VM – log into the host, look at logs, run a debugger • Containers in Kubernetes – Istio, Jaeger, Prometheus, Grafana, Falco • Serverless is challenging. Logging is there, but that’s not useful at scale • Integrated solutions are needed Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 59

Slide 59

Vendor L***-*n • A recent favorite punching bag… • This is real, but is it a concern for you? • Think migration, rather than lock-in Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 60

Slide 60

Multi-cloud • Speaking of punching bags… • Drop the notion of running an application across cloud platforms • Think in terms of best-in-class options for a given application requirement • Put as much wood behind one arrowhead as possible, within reason Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 61

Slide 61

Is Serverless Simpler? • Compared to what? Not usually. • Serverless doesn’t really mean less complexity. It may mean more. • Serverless means an opportunity to focus your complexity where it matters • Solving for business problems is almost always better than solving for infrastructure problems Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 62

Slide 62

Is Serverless Better? • It can be! Let’s not be religious… • Less toil in deployment of systems is beneficial to focus • OpEx reductions can be profound • Tradeoff: we depend upon third parties to address issues as they arise • Is this really a tradeoff? Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 63

Slide 63

Final Thoughts • Put Serverless on your radar – Greenfield – Brownfield migration • Resist the urge to compare DevOps and Serverless. Apples to Apple Pie. • It’s not uncommon for a POC to roll into production • Go build some stuff! Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13

Slide 64

Slide 64

Thanks! cloud.oracle.com Copyright © 2019, Oracle and/or its affiliates. All rights reserved. @jlb13 @jlb13