Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
@adrienblind
Introduction to Serverless
Adrien Blind
@adrienblind
Are you a server hugger?
@adrienblind
What do you really want
Deliver rapidely and flowly valuable apps
for the business
@adrienblind
What do you really want
Cloud
Agile
DevOps
Microservice
architecture
Craftsmanship
Deliver rapidely and flowly valuable apps
for the business
@adrienblind
What do you really want
On demand
Pay as you go
ElasticCloud
Deliver rapidely and flowly valuable apps
for the business
Agile
DevOps
Microservice
architecture
Craftsmanship
@adrienblind
A new kid on the block ?
@adrienblind
A new “cloudy” kid on the block
@adrienblind
A single definition for Serverless?
“Serverless computing is a cloud computing execution model in which the cloud provider dynamically manages the
allocation of machine resources”
- Wikipedia
“Serverless computing refers to the concept of building and running applications that do not require server
management. It describes a finer-grained deployment model where applications, bundled as one or more
functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand
needed at the moment.”
- CNCF foundation whitepaper on Serverless
“Serverless architectures refer to applications that significantly depend on third-party services (knows as Backend
as a Service or "BaaS") or on custom code that's run in ephemeral containers (Function as a Service or "FaaS") [...].
such architectures remove the need for the traditional 'always on' server system sitting behind an application.”
- Mike Roberts, martinfowler.com (2016)
“If your PaaS can efficiently start instances in 20ms that run for half a second, then call it serverless.”
- Adrian Cockroft (2016)
@adrienblind
What are we talking about
❏ Dev/App perspective
Arch. design & granularity? Ephemeral apps? PaaS pattern?
Mostly all of them!
❏ Ops/platform perspective: infrastructure abstraction
Elastic → autoscaling
On-demand → boot in 20ms
Pay-as-you-go → Scale to zero
Cloud managed services
& … NoOps?
@adrienblind
2 major serverless tendencies
❏ BaaS, aka Backend-as-a-Service
&
❏ FaaS, aka Functions-as-a-Service
@adrienblind
❏ Checkout first what we do already have today…
we’ll dig into BaaS & FaaS in few minutes ;)
@adrienblind
Cloud: IaaS
❏ End-product is almost the same (virtual machines)
❏ Facilitates lift & shift
❏ Interaction with the product change: cloud principles, automation/infra-as-
code
❏ Stimulated the commoditization trend: ops no longer deliver per-app
infrastructure architectures
❏ Starts to shift resiliency & scalability topics from infra to app
Ok… But not Serverless at all.
@adrienblind
❏ Containers isolate apps from their subsequent OS
❏ Orchestrators enables to consider a pool of OS as a global capacity (CaaS)
❏ Possible Auto-scalability but mostly based on infrastructure metrics (CPU)
❏ However, pricing model mostly related to subsequent infrastructure used (cluster nodes)
❏ Containers commonly associated to finer app granularity/microservices, which may lead to more
efficient startup time
You now start observing few Serverless characteristics
Cloud: CaaS
+
Create more
abstraction from IaaS
@adrienblind
Cloud: PaaS or PaaS?
❏ PaaS stands for Platform-as-a-Service
❏ Application PaaS (aPaaS) pioneer: Google App engine
❏ xPaaS = managed services (DBaaS, object storage, etc.)
❏ Complete abstraction of the service from infrastructure
❏ Pricing model not related to infrastructure
❏ Autoscaling & resilient by design
Quite Serverless compliant, nope ?
@adrienblind
❏ BaaS, aka Backend-as-a-Service
@adrienblind
Backend-as-a-Service architecture
BaaS → no!
PaaS
CaaS
IaaS
@adrienblind
❏Not a cloud service offer, it’s an architecture concept
❏Trend initially launched for mobile apps
❏Build apps directly leveraging on PaaS services
❏Security paradigms shifts
From perimetric to embedded
Auth/Authz/Cipher everything (your backend is exposed, mate…)
Backend-as-a-Service architecture
Authentication
Object Storage
Databases
(ex. DynamoDB, etc.)
Mobile app
Or Browser
@adrienblind
❏ FaaS, aka Functions-as-a-Service
@adrienblind
Client
Gateway
FaaS
platform
FaaS compute capacity abstracted from app perspective
Cloud: FaaS
❏ Ephemeral: platform waits requests...
@adrienblind
Client
Instanciated
function
(your code)
Gateway
FaaS
platform
FaaS compute capacity abstracted from app perspective
Cloud: FaaS
❏ Ephemeral: platform waits requests and
triggers function on demand, which “lives”
the time to deliver the result: your code is
not always-on, waiting calls!
@adrienblind
❏ Ephemeral: platform waits requests and
triggers function on demand, which “lives”
the time to deliver the result: your code is
not always-on, waiting calls!
❏ Dynamic scalability & resilience provided
by the platform: more calls, more
instances
❏ Extremely fine grained pay-per-use on
public cloud: per-call costs
Client
Instanciated
function
(your code)
Instanciated
function
(your code)
Instanciated
function
(your code)
Gateway
FaaS
platform
FaaS compute capacity abstracted from app perspective
Cloud: FaaS
@adrienblind
❏Beware of design constraints applying to your app
❏ Service/function granularity
❏ Stateless services, use distributed cache, etc.
❏ Small wake up time
❏ No long-running services
❏Like for the Virtual machines & container history, shortly after their venue
came the orchestration challenge… Deal with function graph calls (ex.
Amazon Step)
❏Possible Vendor lock-in: check out serverless.io to get an abstraction fmk ?
❏Testing → you must deploy on the platform everytime
❏Adapt DevOps practices: monitoring, deployment, versioning...
FaaS constraints
@adrienblind
All major cloud vendors have products
Alternatively you can deploy your own FaaS fmk
You may leverage on existing CaaS and put value on top of it
• Container encapsulation of the function
• Kubernetes orchestration
FaaS on public cloud vs FaaS on premises
Amazon Google Azure OVH
OpenWhisk OpenFaaS OracleFN
@adrienblind
❏ OpenFaas: an example FaaS platform
@adrienblind
Introduction to OpenFaaS
 Originally a cool hack built by docker captain Alex Ellis for
Dockercon conference. A new, but real product now.
 Enable to trigger functions enclosed in docker images. So:
You can put any app/language, till there is a binary to start
Works Linux and Windows OS
On premises, on cloud, hybridated…
 https://www.openfaas.com
@adrienblind
OpenFaas leverage on containers & orchestration
Illustration from openfaas.com
@adrienblind
An example platform: introduction to OpenFaaS
 API gateway
Route inbound requests to your functions
Collect metrics through Prometheus
Autoscales modifying service replicas counts
Offers a convenient UI + endpoints for the CLI
@adrienblind
An example platform: introduction to OpenFaaS
 Function watchdog
A tiny HTTP server, enclosed along with your app in the docker image
Receive request from the API Gateway, triggers your app
Provide args and catch result through STDIN/STDOUT
Now, you know why you can enclose almost everything ;)
Illustration from openfaas.comIllustration from openfaas.com
@adrienblind
$ faas-cli new helloworld --lang python
The only line of code you’ll write in the function template
print("Hello, World!")
$ faas-cli build -f helloworld.yml
$ faas-cli push -f helloworld.yml
$ faas-cli deploy -f helloworld.yml
$ curl http://faas.me/function/helloworld
Hello, World!
“Hello, World!” example With OpenFaaS
@adrienblind
Benefits
 Leverage on your CaaS platform for serverless &
traditional usecase at the same time
 Leverage on top of Docker paradigms
Universality of languages/app supported
Easy CD/CI, automation
 Do not reinvent the wheel 
@adrienblind
❏ Sum Up
@adrienblind
❏ Serverless is an architecture
trend, not just a new cloud
service offer (aka FaaS)
❏ A serverless app is a mashup of
value-added, managed services:
aPaaS, xPaaS, FaaS…
❏ Fits today’s architecture stakes:
cloud native apps, 12 factors...
Serverless key aspects from Dev/App perspective
Schema from martinfowler.com
Devs gain a greater productivity, refocusing on business valuable code
@adrienblind
Ops gets more efficiency and cost-saving,
offloading several concerns to platform
❏ You no longer manage infrastructure aspects directly: Auto-
scalability & resilience provided by design
❏ Close but not fully NoOps (monitor app!)
❏ Cloud promise at its finest “resolution”
On-demand, Elastic, Pay-Per-Use
Serverless key aspects from Ops/platform perspective
@adrienblind
Focus on value & better TTM
but support platform constraints
More flexibility, more tuning
capacity… but assume plumbing
Functions
Serverless key aspects
ABSTRACT
FOCUSINFRA
Microservices
Monoliths
CaaS
IaaS
FaaS
& PaaS
@adrienblind
❏ Small microservices
❏ Stream processing
❏ Event-driven-programming
❏ Batch / Scheduled tasks
❏ May even replace some old compute grids ;)
❏ …
Some usecases
@adrienblind
Finally, THE silver bullet?
Highly valuable, but does not fit every usecases !
@adrienblind
❏ Extra: enlarge the picture
@adrienblind
IoT & Serverless
❏ IoT generates large loads of small & basic-to-process
events, in huge quantity
❏ It calls for an event-driven programming approach
❏ … which fits well with the idea of simple, elementary
functions of Serverless/FaaS computing
Serverless
+
IoT
@adrienblind
Edge Computing & Serverless
❏ Google Trends graphs for “Serverless” & “Edge computing” terms
❏ Beware, scales are not the same however ;)
❏ Anyway, an interesting correlation to notice, isn’t it ?
@adrienblind
WTF with Edge computing?
❏ Offload computing tasks close to the
data, at the boarder of the network / out
from the cloud
❏ Example, precompute face recognition
close to a camera, to avoid uploading the
whole video flow to the cloud
❏ Particularly valuable in an IoT landscape
CLOUD
@adrienblind
Major cloud vendors are building their strategy on top of the following triptic,
to unleash their service from the cloud and provide an end-to-end offer
For instance: Azure IoT Edge / Sphere, AWS Greengrass...
Unleash from the cloud
Serverless
Architecture
Edge
Computing
Internet Of
Things
@adrienblind
There are 2 kind of spurs my friend.
Those that do serverless, those that don’t.

More Related Content

An introduction to Serverless

  • 2. @adrienblind Are you a server hugger?
  • 3. @adrienblind What do you really want Deliver rapidely and flowly valuable apps for the business
  • 4. @adrienblind What do you really want Cloud Agile DevOps Microservice architecture Craftsmanship Deliver rapidely and flowly valuable apps for the business
  • 5. @adrienblind What do you really want On demand Pay as you go ElasticCloud Deliver rapidely and flowly valuable apps for the business Agile DevOps Microservice architecture Craftsmanship
  • 6. @adrienblind A new kid on the block ?
  • 8. @adrienblind A single definition for Serverless? “Serverless computing is a cloud computing execution model in which the cloud provider dynamically manages the allocation of machine resources” - Wikipedia “Serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment.” - CNCF foundation whitepaper on Serverless “Serverless architectures refer to applications that significantly depend on third-party services (knows as Backend as a Service or "BaaS") or on custom code that's run in ephemeral containers (Function as a Service or "FaaS") [...]. such architectures remove the need for the traditional 'always on' server system sitting behind an application.” - Mike Roberts, martinfowler.com (2016) “If your PaaS can efficiently start instances in 20ms that run for half a second, then call it serverless.” - Adrian Cockroft (2016)
  • 9. @adrienblind What are we talking about ❏ Dev/App perspective Arch. design & granularity? Ephemeral apps? PaaS pattern? Mostly all of them! ❏ Ops/platform perspective: infrastructure abstraction Elastic → autoscaling On-demand → boot in 20ms Pay-as-you-go → Scale to zero Cloud managed services & … NoOps?
  • 10. @adrienblind 2 major serverless tendencies ❏ BaaS, aka Backend-as-a-Service & ❏ FaaS, aka Functions-as-a-Service
  • 11. @adrienblind ❏ Checkout first what we do already have today… we’ll dig into BaaS & FaaS in few minutes ;)
  • 12. @adrienblind Cloud: IaaS ❏ End-product is almost the same (virtual machines) ❏ Facilitates lift & shift ❏ Interaction with the product change: cloud principles, automation/infra-as- code ❏ Stimulated the commoditization trend: ops no longer deliver per-app infrastructure architectures ❏ Starts to shift resiliency & scalability topics from infra to app Ok… But not Serverless at all.
  • 13. @adrienblind ❏ Containers isolate apps from their subsequent OS ❏ Orchestrators enables to consider a pool of OS as a global capacity (CaaS) ❏ Possible Auto-scalability but mostly based on infrastructure metrics (CPU) ❏ However, pricing model mostly related to subsequent infrastructure used (cluster nodes) ❏ Containers commonly associated to finer app granularity/microservices, which may lead to more efficient startup time You now start observing few Serverless characteristics Cloud: CaaS + Create more abstraction from IaaS
  • 14. @adrienblind Cloud: PaaS or PaaS? ❏ PaaS stands for Platform-as-a-Service ❏ Application PaaS (aPaaS) pioneer: Google App engine ❏ xPaaS = managed services (DBaaS, object storage, etc.) ❏ Complete abstraction of the service from infrastructure ❏ Pricing model not related to infrastructure ❏ Autoscaling & resilient by design Quite Serverless compliant, nope ?
  • 15. @adrienblind ❏ BaaS, aka Backend-as-a-Service
  • 17. @adrienblind ❏Not a cloud service offer, it’s an architecture concept ❏Trend initially launched for mobile apps ❏Build apps directly leveraging on PaaS services ❏Security paradigms shifts From perimetric to embedded Auth/Authz/Cipher everything (your backend is exposed, mate…) Backend-as-a-Service architecture Authentication Object Storage Databases (ex. DynamoDB, etc.) Mobile app Or Browser
  • 18. @adrienblind ❏ FaaS, aka Functions-as-a-Service
  • 19. @adrienblind Client Gateway FaaS platform FaaS compute capacity abstracted from app perspective Cloud: FaaS ❏ Ephemeral: platform waits requests...
  • 20. @adrienblind Client Instanciated function (your code) Gateway FaaS platform FaaS compute capacity abstracted from app perspective Cloud: FaaS ❏ Ephemeral: platform waits requests and triggers function on demand, which “lives” the time to deliver the result: your code is not always-on, waiting calls!
  • 21. @adrienblind ❏ Ephemeral: platform waits requests and triggers function on demand, which “lives” the time to deliver the result: your code is not always-on, waiting calls! ❏ Dynamic scalability & resilience provided by the platform: more calls, more instances ❏ Extremely fine grained pay-per-use on public cloud: per-call costs Client Instanciated function (your code) Instanciated function (your code) Instanciated function (your code) Gateway FaaS platform FaaS compute capacity abstracted from app perspective Cloud: FaaS
  • 22. @adrienblind ❏Beware of design constraints applying to your app ❏ Service/function granularity ❏ Stateless services, use distributed cache, etc. ❏ Small wake up time ❏ No long-running services ❏Like for the Virtual machines & container history, shortly after their venue came the orchestration challenge… Deal with function graph calls (ex. Amazon Step) ❏Possible Vendor lock-in: check out serverless.io to get an abstraction fmk ? ❏Testing → you must deploy on the platform everytime ❏Adapt DevOps practices: monitoring, deployment, versioning... FaaS constraints
  • 23. @adrienblind All major cloud vendors have products Alternatively you can deploy your own FaaS fmk You may leverage on existing CaaS and put value on top of it • Container encapsulation of the function • Kubernetes orchestration FaaS on public cloud vs FaaS on premises Amazon Google Azure OVH OpenWhisk OpenFaaS OracleFN
  • 24. @adrienblind ❏ OpenFaas: an example FaaS platform
  • 25. @adrienblind Introduction to OpenFaaS  Originally a cool hack built by docker captain Alex Ellis for Dockercon conference. A new, but real product now.  Enable to trigger functions enclosed in docker images. So: You can put any app/language, till there is a binary to start Works Linux and Windows OS On premises, on cloud, hybridated…  https://www.openfaas.com
  • 26. @adrienblind OpenFaas leverage on containers & orchestration Illustration from openfaas.com
  • 27. @adrienblind An example platform: introduction to OpenFaaS  API gateway Route inbound requests to your functions Collect metrics through Prometheus Autoscales modifying service replicas counts Offers a convenient UI + endpoints for the CLI
  • 28. @adrienblind An example platform: introduction to OpenFaaS  Function watchdog A tiny HTTP server, enclosed along with your app in the docker image Receive request from the API Gateway, triggers your app Provide args and catch result through STDIN/STDOUT Now, you know why you can enclose almost everything ;) Illustration from openfaas.comIllustration from openfaas.com
  • 29. @adrienblind $ faas-cli new helloworld --lang python The only line of code you’ll write in the function template print("Hello, World!") $ faas-cli build -f helloworld.yml $ faas-cli push -f helloworld.yml $ faas-cli deploy -f helloworld.yml $ curl http://faas.me/function/helloworld Hello, World! “Hello, World!” example With OpenFaaS
  • 30. @adrienblind Benefits  Leverage on your CaaS platform for serverless & traditional usecase at the same time  Leverage on top of Docker paradigms Universality of languages/app supported Easy CD/CI, automation  Do not reinvent the wheel 
  • 32. @adrienblind ❏ Serverless is an architecture trend, not just a new cloud service offer (aka FaaS) ❏ A serverless app is a mashup of value-added, managed services: aPaaS, xPaaS, FaaS… ❏ Fits today’s architecture stakes: cloud native apps, 12 factors... Serverless key aspects from Dev/App perspective Schema from martinfowler.com Devs gain a greater productivity, refocusing on business valuable code
  • 33. @adrienblind Ops gets more efficiency and cost-saving, offloading several concerns to platform ❏ You no longer manage infrastructure aspects directly: Auto- scalability & resilience provided by design ❏ Close but not fully NoOps (monitor app!) ❏ Cloud promise at its finest “resolution” On-demand, Elastic, Pay-Per-Use Serverless key aspects from Ops/platform perspective
  • 34. @adrienblind Focus on value & better TTM but support platform constraints More flexibility, more tuning capacity… but assume plumbing Functions Serverless key aspects ABSTRACT FOCUSINFRA Microservices Monoliths CaaS IaaS FaaS & PaaS
  • 35. @adrienblind ❏ Small microservices ❏ Stream processing ❏ Event-driven-programming ❏ Batch / Scheduled tasks ❏ May even replace some old compute grids ;) ❏ … Some usecases
  • 36. @adrienblind Finally, THE silver bullet? Highly valuable, but does not fit every usecases !
  • 38. @adrienblind IoT & Serverless ❏ IoT generates large loads of small & basic-to-process events, in huge quantity ❏ It calls for an event-driven programming approach ❏ … which fits well with the idea of simple, elementary functions of Serverless/FaaS computing Serverless + IoT
  • 39. @adrienblind Edge Computing & Serverless ❏ Google Trends graphs for “Serverless” & “Edge computing” terms ❏ Beware, scales are not the same however ;) ❏ Anyway, an interesting correlation to notice, isn’t it ?
  • 40. @adrienblind WTF with Edge computing? ❏ Offload computing tasks close to the data, at the boarder of the network / out from the cloud ❏ Example, precompute face recognition close to a camera, to avoid uploading the whole video flow to the cloud ❏ Particularly valuable in an IoT landscape CLOUD
  • 41. @adrienblind Major cloud vendors are building their strategy on top of the following triptic, to unleash their service from the cloud and provide an end-to-end offer For instance: Azure IoT Edge / Sphere, AWS Greengrass... Unleash from the cloud Serverless Architecture Edge Computing Internet Of Things
  • 42. @adrienblind There are 2 kind of spurs my friend. Those that do serverless, those that don’t.