Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
FaaS You Like It
(If Shakespeare had written
Functions as a Service)
“All the world’s a stage, And all the men and women
merely players; They have their exits and their entrances,
And one man...
Cast
Cloud Architect - Ewan Slater
Agenda
1. What is FaaS (or “Serverless”)
2. The Fn Project
3. FDKs
4. As you like it - performed by Fn functions, written ...
Synopsis
“As You Like It subverts the traditional rules of romance.
Gender roles, nature and politics are confused in a pl...
Bewilderment:
Why dost thy Serverless Architecture have
so many servers?
Soliloquy
<Grumpy-Old-Man-Moment>
There are only two hard things in Computer
Science: cache invalidation and naming
things.
- Phil Karlton
I don’t like “Serverless” as a name
● Hidden Servers
● Transient Servers
● Abstracted Infrastructure
● Anything really
"For everyone's sake, someone
please come up with a better
name than serverless”
- Simon Wardley
</Grumpy-Old-Man-Moment>
Suspension of Disbelief
“The Play’s the thing…”
Actor learns own part
● Cues (input)
● Lines (output)
● Stage Directions (state)
Actor ⇒ Function
Single responsibility
Audience care about action
Not what happens backstage
Business doesn’t care about
infrastructure
FaaS: action not infrastructure
Increase developer
Productivity
by adding another layer of
Abstraction
(a recurring theme)
FaaS
● Write small functions
● Do one thing well
● Easy to Understand
● Easy to Maintain
● Run on Abstracted Infrastructur...
Avoid
What is “Serverless”?
● Serverless is an abstraction of infrastructure and its operations including
provisioning, scaling,...
For a fuller discussion...
Mike Roberts article on MartinFowler.com
https://martinfowler.com/articles/serverless.html
“Fun...
From Microservices to Functions
Granularity
Scale
Time
PaaS vs FaaS
● Granularity, Scale & Time
○ Paas (or IaaS) ⇒ (Micro)Service, long - running
○ FaaS ⇒ Function, invoked on d...
Functions != Functional
● Functions can have side effects
● Functions don’t have to be idempotent
FaaS Upsides
● Make development easier
● Improve developer productivity
● Increased agility (Dev & Business)
● Reduce cost...
FaaS Downsides
● “ball of mud”
● Lock - in
● Restricted choice
○ Language
○ Run - time environment
Language Support
● AWS
○ Node, Python, Java, C#, Go
● Google
○ Node
● Azure
○ C#, JavaScript, F#, (Java - preview)
“Gadzooks! No Ruby?”
(Or Erlang, or Rust, or FORTRAN etc.)
Choice:
Write your functions in any language.
Run them in any environment.
Fn Project:
Write your functions in any language*.
Run them in any environment*.
*Supports / supported by Docker
Fn Project ( fnproject.io )
● Open-source serverless compute platform
● Can be deployed to any cloud or on-premises
● Cont...
Functions as Containers
● Function and dependencies
● Single - purpose
● Self - Contained
● Stateless
● Ephemeral
● Run on...
An Fn Function
● Small chunk of code wrapped into container
● Input from STDIN & Environment
● Output to STDOUT
● Logs to ...
Fn deploy details
● Bump version in func.yaml
● Build container (multi stage)
● Push container to registry
● Create / Upda...
Fn Server
● “API Gateway”
● Manages apps and functions
○ (app ⇒ group of functions)
● Synchronous function calls
○ Execute...
Docker in Docker
● Limited “blast radius”
○ Doesn’t affect outer VM
○ Kill Fn container & restart
● Docker version indepen...
Architecture
Hot and Cold
● Cold Functions
○ Run once only
○ Terminate immediately
○ New container every invocation
● Hot Functions
○ R...
Synchronous Request
Asynchronous Request
Function Development Kits (FDKs)
● Developer writes a handler function to the FDKs interface
● FDK
○ Parses STDIN
○ Provid...
FDKs
● Ruby ( https://github.com/fnproject/fdk-ruby )
● Others
○ Python
○ Go
○ Java
○ Node
○ Rust
○ ...more on the way...
Without an FDK
● Dockerfile
● func.yaml
● func.* (e.g. func.sh)
● DIY
Orchestration
Flow
● Promises based Orchestration
○ No new “special” language
○ Composable
○ Flexible
○ Supports “Saga Pattern”
● A Flow...
Flow
● Language Support:
○ Java
○ Python
○ Node
● In the works:
○ Go
● To - do:
○ Ruby
As You Like It
bitbucket.org/ewan_slater/comedy/src/master/
Summary
● FaaS ⇒ Greater developer productivity
● Fn Project ⇒ FaaS Framework
○ Open Source
○ Portable
○ Language Agnostic...
Links & Contact
● Fn Project ( fnproject.io )
○ github.com/fnproject
○ Slack
● Twitter
○ Fn Project: @fnproj
○ Me: @ewansl...
Proceed, proceed: we will begin these rites,
As we do trust they'll end, in true delights.
(all exit to the pub)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
Upcoming SlideShare
Loading in …5
×

FaaS you like it (if Shakespeare had written Functions-as-a-Service)

78 views

Published on

My slides from the London Cloud Native Meetup on 7th August 2018.

Covering serverless, FaaS (Functions-as-a-Service) and the Fn project (with a bit of help from William Shakespeare).

Published in: Software
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

FaaS you like it (if Shakespeare had written Functions-as-a-Service)

  1. 1. FaaS You Like It (If Shakespeare had written Functions as a Service)
  2. 2. “All the world’s a stage, And all the men and women merely players; They have their exits and their entrances, And one man in his time plays many parts…”
  3. 3. Cast Cloud Architect - Ewan Slater
  4. 4. Agenda 1. What is FaaS (or “Serverless”) 2. The Fn Project 3. FDKs 4. As you like it - performed by Fn functions, written in Ruby & Java
  5. 5. Synopsis “As You Like It subverts the traditional rules of romance. Gender roles, nature and politics are confused in a play that reflects on how bewildering yet utterly pleasurable life can be.” - Royal Shakespeare Company
  6. 6. Bewilderment: Why dost thy Serverless Architecture have so many servers?
  7. 7. Soliloquy <Grumpy-Old-Man-Moment>
  8. 8. There are only two hard things in Computer Science: cache invalidation and naming things. - Phil Karlton
  9. 9. I don’t like “Serverless” as a name ● Hidden Servers ● Transient Servers ● Abstracted Infrastructure ● Anything really
  10. 10. "For everyone's sake, someone please come up with a better name than serverless” - Simon Wardley
  11. 11. </Grumpy-Old-Man-Moment>
  12. 12. Suspension of Disbelief
  13. 13. “The Play’s the thing…”
  14. 14. Actor learns own part ● Cues (input) ● Lines (output) ● Stage Directions (state)
  15. 15. Actor ⇒ Function
  16. 16. Single responsibility
  17. 17. Audience care about action
  18. 18. Not what happens backstage
  19. 19. Business doesn’t care about infrastructure
  20. 20. FaaS: action not infrastructure
  21. 21. Increase developer Productivity by adding another layer of Abstraction
  22. 22. (a recurring theme)
  23. 23. FaaS ● Write small functions ● Do one thing well ● Easy to Understand ● Easy to Maintain ● Run on Abstracted Infrastructure (“Serverless”) platform
  24. 24. Avoid
  25. 25. What is “Serverless”? ● Serverless is an abstraction of infrastructure and its operations including provisioning, scaling, patching, etc. ● Serverless architecture is when an app is built entirely on serverless components (compute, storage, networking) ● Function as a Service (FaaS) is the compute component in a serverless architecture
  26. 26. For a fuller discussion... Mike Roberts article on MartinFowler.com https://martinfowler.com/articles/serverless.html “Fundamentally, FaaS is about running backend code without managing your own server systems or your own long-lived server applications.”
  27. 27. From Microservices to Functions
  28. 28. Granularity
  29. 29. Scale
  30. 30. Time
  31. 31. PaaS vs FaaS ● Granularity, Scale & Time ○ Paas (or IaaS) ⇒ (Micro)Service, long - running ○ FaaS ⇒ Function, invoked on demand If your PaaS can efficiently start instances in 20ms that run for half a second, then call it serverless. - Adrian Cockcroft
  32. 32. Functions != Functional ● Functions can have side effects ● Functions don’t have to be idempotent
  33. 33. FaaS Upsides ● Make development easier ● Improve developer productivity ● Increased agility (Dev & Business) ● Reduce costs (Dev & Operations)
  34. 34. FaaS Downsides ● “ball of mud” ● Lock - in ● Restricted choice ○ Language ○ Run - time environment
  35. 35. Language Support ● AWS ○ Node, Python, Java, C#, Go ● Google ○ Node ● Azure ○ C#, JavaScript, F#, (Java - preview)
  36. 36. “Gadzooks! No Ruby?”
  37. 37. (Or Erlang, or Rust, or FORTRAN etc.)
  38. 38. Choice: Write your functions in any language. Run them in any environment.
  39. 39. Fn Project: Write your functions in any language*. Run them in any environment*. *Supports / supported by Docker
  40. 40. Fn Project ( fnproject.io ) ● Open-source serverless compute platform ● Can be deployed to any cloud or on-premises ● Containers are primitives ● Active w/ 2500+ commits across 50+ contributors ● Independently governed with representation at CNCF ● support for the upcoming CloudEvents specification ○ (CNCF Serverless working group ) ● integration with the Serverless Framework toolkit
  41. 41. Functions as Containers ● Function and dependencies ● Single - purpose ● Self - Contained ● Stateless ● Ephemeral ● Run on Demand
  42. 42. An Fn Function ● Small chunk of code wrapped into container ● Input from STDIN & Environment ● Output to STDOUT ● Logs to STDERR
  43. 43. Fn deploy details ● Bump version in func.yaml ● Build container (multi stage) ● Push container to registry ● Create / Update function route MyFunc:0.0.2 MyFunc:0.0.2 MyFunc:0.0.2 Your code Fn Service myfunc → /r/myapp/myfunc:0.0.2 1 2 3
  44. 44. Fn Server ● “API Gateway” ● Manages apps and functions ○ (app ⇒ group of functions) ● Synchronous function calls ○ Executed immediately ● Asynchronous function calls ○ Queued and executed when capacity available ● Runs as a Container ● Hosts function containers using Docker - in - Docker
  45. 45. Docker in Docker ● Limited “blast radius” ○ Doesn’t affect outer VM ○ Kill Fn container & restart ● Docker version independence ○ (inner can differ from outer) ● Reduce chance of container name collisions
  46. 46. Architecture
  47. 47. Hot and Cold ● Cold Functions ○ Run once only ○ Terminate immediately ○ New container every invocation ● Hot Functions ○ Run at least once ○ Wait before terminating ○ Potentially reusable
  48. 48. Synchronous Request
  49. 49. Asynchronous Request
  50. 50. Function Development Kits (FDKs) ● Developer writes a handler function to the FDKs interface ● FDK ○ Parses STDIN ○ Provides input data to function ○ Handles writing output and errors ○ Manages multiple invocations ● Makes it a lot easier to write hot functions
  51. 51. FDKs ● Ruby ( https://github.com/fnproject/fdk-ruby ) ● Others ○ Python ○ Go ○ Java ○ Node ○ Rust ○ ...more on the way...
  52. 52. Without an FDK ● Dockerfile ● func.yaml ● func.* (e.g. func.sh) ● DIY
  53. 53. Orchestration
  54. 54. Flow ● Promises based Orchestration ○ No new “special” language ○ Composable ○ Flexible ○ Supports “Saga Pattern” ● A Flow is... ○ ...written in Code ○ ...written as Function ○ ...deployed as a function (within an application)
  55. 55. Flow ● Language Support: ○ Java ○ Python ○ Node ● In the works: ○ Go ● To - do: ○ Ruby
  56. 56. As You Like It bitbucket.org/ewan_slater/comedy/src/master/
  57. 57. Summary ● FaaS ⇒ Greater developer productivity ● Fn Project ⇒ FaaS Framework ○ Open Source ○ Portable ○ Language Agnostic ○ Multiple FDKs ● Feedback and contributions welcome!
  58. 58. Links & Contact ● Fn Project ( fnproject.io ) ○ github.com/fnproject ○ Slack ● Twitter ○ Fn Project: @fnproj ○ Me: @ewanslater
  59. 59. Proceed, proceed: we will begin these rites, As we do trust they'll end, in true delights. (all exit to the pub)

×