1. What is FaaS (or “Serverless”)
2. The Fn Project
4. As you like it - performed by Fn functions, written in Ruby & Java
“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
- Royal Shakespeare Company
Why dost thy Serverless Architecture have
so many servers?
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
For a fuller discussion...
Mike Roberts article on MartinFowler.com
“Fundamentally, FaaS is about running backend code without managing
your own server systems or your own long-lived server applications.”
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
Functions != Functional
● Functions can have side effects
● Functions don’t have to be idempotent
Write your functions in any language.
Run them in any environment.
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
● 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
Functions as Containers
● Function and dependencies
● Single - purpose
● Self - Contained
● Run on Demand
An Fn Function
● Small chunk of code wrapped into container
● Input from STDIN & Environment
● Output to STDOUT
● Logs to STDERR
Fn deploy details
● Bump version in func.yaml
● Build container (multi stage)
● Push container to registry
● Create / Update function route
1 2 3
● “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
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
Function Development Kits (FDKs)
● Developer writes a handler function to the FDKs interface
○ Parses STDIN
○ Provides input data to function
○ Handles writing output and errors
○ Manages multiple invocations
● Makes it a lot easier to write hot functions
● Ruby ( https://github.com/fnproject/fdk-ruby )
○ ...more on the way...
Without an FDK
● func.* (e.g. func.sh)
● Promises based Orchestration
○ No new “special” language
○ Supports “Saga Pattern”
● A Flow is...
○ ...written in Code
○ ...written as Function
○ ...deployed as a function (within an application)
● Language Support:
● In the works:
● To - do:
As You Like It
● FaaS ⇒ Greater developer productivity
● Fn Project ⇒ FaaS Framework
○ Open Source
○ Language Agnostic
○ Multiple FDKs
● Feedback and contributions welcome!