Slide 1

Slide 1 text

Putting the F in FaaS

Slide 2

Slide 2 text

! @trieloff

Slide 3

Slide 3 text

⚡⚡⚡

Slide 4

Slide 4 text

! @adobeio

Slide 5

Slide 5 text

Opinions are my own

Slide 6

Slide 6 text

Ideas are not

Slide 7

Slide 7 text

⚡ Putting the F in FaaS

Slide 8

Slide 8 text

WTF?

Slide 9

Slide 9 text

WT ?

Slide 10

Slide 10 text

F is for Functions

Slide 11

Slide 11 text

Fundamentally, there are only two programming styles: functional and dysfunctional.

Slide 12

Slide 12 text

Functions in FaaS

Slide 13

Slide 13 text

Stateless

Slide 14

Slide 14 text

Stateless Short-lived

Slide 15

Slide 15 text

Stateless Short-lived Single-purpose

Slide 16

Slide 16 text

Stateless Short-lived Single-purpose Boring

Slide 17

Slide 17 text

!"

Slide 18

Slide 18 text

⚡ Serverless Functional Patterns for the Aspiring Enterprise Architect

Slide 19

Slide 19 text

Fundamentally, there are only two architecture styles: functional and dysfunctional.

Slide 20

Slide 20 text

! @timallenwagner The Serverless Manifesto 1. Functions are the unit of deployment and scaling 2. bla 3. bla 4. bla 5. Never pay for idle 6. bla

Slide 21

Slide 21 text

! @yochayk Applied Serverless Design Patterns 1. Function Chaining 2. ASync HTTP (HTTP 202) 3. Fanout (Parallel) 4. Fanout + Fan-in 5. Long Running Function with Timeout

Slide 22

Slide 22 text

! @ben11kehoe What's Missing From Serverless Providers Node is the WRONG runtime for serverless

Slide 23

Slide 23 text

! @ben11kehoe What's Missing From Serverless Providers Node is the WRONG runtime for serverless

Slide 24

Slide 24 text

! @ben11kehoe What's Missing From Serverless Providers Node is the WRONG runtime for serverless (because it’s making you do async wrong)

Slide 25

Slide 25 text

Greenspun's tenth rule Any sufficiently complicated C or Fortran program contains an ad- hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. tl;dr: LISP did it first

Slide 26

Slide 26 text

⚡ What LISP can Teach You About Serverless Patterns

Slide 27

Slide 27 text

LISP !" Clojure

Slide 28

Slide 28 text

map/pmap (a.k.a. Fan-Out) (map some-function some-data) Apply some-function to each entry of the array of data in some-data. Then return the result as a new array. In parallel: use pmap. Why? To process lots of data.

Slide 29

Slide 29 text

apply (a.k.a. Proxy) (apply some-function x y z) Call some-function with arguments x, y, and z. Why? To make the function to be called a variable itself.

Slide 30

Slide 30 text

comp (a.k.a. Function Chaining) (comp some-function some-other-function) Create a function that first calls some-function on the arguments, and then some-other-function on the results. Why? To call multiple services in order.

Slide 31

Slide 31 text

reduce (a.k.a. Fan-In) (reduce some-function some-data) Call some-function on the first item of some-data, then call some-function again, using the result of the prior invocation and the next item in some-data as arguments. Why? To compress large data sets into small results.

Slide 32

Slide 32 text

fold (a.k.a. Fan-In with on Top) (fold reducef combined some-data) Break some-data into multiple sets, run (reduce reducef) on each, then run (combine combinef) on the results. Why? To compress really large data sets into small results, in multiple steps.

Slide 33

Slide 33 text

iterate (a.k.a. Endless Function) (iterate start-value some-function) Create a function that creates a data stream starting with start-value from repeated calls to some-function. Why? To turn some-function into a data emitter, without some-function needing state.

Slide 34

Slide 34 text

juxt (a.k.a. Parallel Functions) (juxt some-function some-other-function) Makes a function that calls some-function and some-other- function and returns a combined result. Why? To combine the results of multiple functions in one call.

Slide 35

Slide 35 text

memoize (a.k.a. Good Ol’ Cache) (memoize some-function) Return a cached version of some-function that returns the same value for the same arguments. Why? To trade slow computing against fast cache lookups.

Slide 36

Slide 36 text

partial (a.k.a. Wrapper) (partial some-function value) Creates a function that calls some-function with value as an argument, in addition to other arguments. Why? To provide default values and make powerful functions less dangerous.

Slide 37

Slide 37 text

That’s all the F you need

Slide 38

Slide 38 text

⏰❓

Slide 39

Slide 39 text

Can my Serverless Vendor do this?

Slide 40

Slide 40 text

Probably. You need: 1. A Serverless (FaaS) Runtime 2. An Event Passing System 3. A Document Database with Triggers

Slide 41

Slide 41 text

! @trieloff