The document provides an introduction to serverless computing, explaining its significance as an architectural trend that enables rapid and efficient app development without traditional server management. It covers key concepts such as backend-as-a-service (BaaS) and functions-as-a-service (FaaS), highlighting their impact on development, operations, and infrastructure strategies. Additionally, it explores the relationship between serverless computing, cloud services, edge computing, and the Internet of Things (IoT), emphasizing their relevance in modern app architecture.
@adrienblind
What do youreally want
Cloud
Agile
DevOps
Microservice
architecture
Craftsmanship
Deliver rapidely and flowly valuable apps
for the business
5.
@adrienblind
What do youreally want
On demand
Pay as you go
ElasticCloud
Deliver rapidely and flowly valuable apps
for the business
Agile
DevOps
Microservice
architecture
Craftsmanship
@adrienblind
A single definitionfor 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 wetalking 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
Cloud: IaaS
❏ End-productis 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 isolateapps 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 orPaaS?
❏ 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
❏Not a cloudservice 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
❏ Ephemeral: platformwaits 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 designconstraints 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 cloudvendors 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
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
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 newhelloworld --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 onyour 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
❏ Serverless isan 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 moreefficiency 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
@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 Edgecomputing?
❏ 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 vendorsare 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