Quick introduction to Apache OpenWhisk, an open source, distributed Serverless platform that executes functions (fx) in response to events at any scale. OpenWhisk manages the infrastructure, servers and scaling using Docker containers so you can focus on building amazing and efficient applications.
3. What is Serverless?
3
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.
It refers to the idea that consumers of serverless computing no longer need to spend time and
resources on server provisioning, maintenance, updates, scaling, and capacity
planning. Instead, all of these tasks and capabilities are handled by a serverless platform and are completely
abstracted away from the developers
- Cloud Native Computing Foundation
https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview
5. Use cases
Use Cases
5
Small, focused, asynchronous, concurrent, easy to parallelize into independent units
of work
Infrequent or has sporadic demand, with large, unpredictable variance in scaling
requirements
Stateless, ephemeral, without a major need for instantaneous cold start time
Highly dynamic in terms of changing business requirements that drive a need for
accelerated developer velocity
7. Why Serverless?
10
Active users curve for a mobile
conference app has no demand
before and after the conference,
and huge intraweek swings in
demand
9. Use cases
12DOC ID / September 13, 2018 / 息 2018 IBM Corporation
Serverless Backends
Mobile Backend
Data Processing
Cognitive Data Processing
IoT Ready
Event Stream Processing
Conversational Scenarios Scheduled Tasks
10. Server Landscape (Cloud Native Computing Foundation)
14DOC ID / Month XX, 2018 / 息 2018 IBM Corporation
11. Server Landscape feature matrix
15
Amazon Lambda
Node.js, Python, Java, C# and Go
IBM Cloud Functions
Node.js 8, Node.js 6, Python 3.6.4, Python 3.6.1, PHP 7.1, PHP 7.2, and Swift 4, Swift 3.1.1, Ruby 2.5
Other languages can be added via Docker container (for example Java)
Based on open source OpenWhisk serverless platform. Can create your own serverless platform based on
OpenWhisk
Microsoft Azure
C#, F#, Node.js (in GA)
Java, Python, PHP, TypeScript, Bash, PowerShell (experimental mode)
Google Cloud Function
Node.js, Python
Many many more
14. Apache OpenWhisk
Serverless is an architecture, a way of thinking that
abstracts away the underlying hardware and
infrastructure from the developer completely.
Entering the system: nginx
an HTTP and reverse proxy server.
Entering the system: Controller
serves as the interface for everything a user can do
Authentication and Authorization: CouchDB
check that the user exists in OpenWhisks database and that it has the
privilege to invoke the action myAction
Getting the action: CouchDB again
Load the action from the whisks database in CouchDB.
Whos there to invoke the action: Load Balancer
has a global view of the executors available in the system by checking
their health status continuously. Those executors are called Invokers.
The Load Balancer, knowing which Invokers are available, chooses one of
them to invoke the action requested.
Please form a line: Kafka
a high-throughput, distributed, publish-subscribe messaging system
Actually invoking the code already: Invoker
execute actions in an isolated and safe way using Docker.
Storing the results: CouchDB again
Store the returned result, logs written, start and end time of the action.
22. IBM Cloud Functions
30
Open source Hosted service
Serverless engine Apache OpenWhisk IBM Cloud Functions
API Gateway LoopBack IBM API Gateway
Databases
Apache CouchDB
MySQL
IBM Cloudant
IBM Compose
Message streams Apache Kafka IBM Message Hub
23. Things to consider
32
Functions are stateless. Need some sort of persistence between runs.
Are you able to test and develop locally ? Does provider have CLI ?
Can you easily version your functions ? Source control ?
Can you easily monitor your functions ?
Security and API gateway
Avoid long-running loops / mini-monoliths ?
Latency (cold, warm and hot loads)
How do you track dependencies ?