5. - Inefficient
- Costly
- Difficult operations
- Control over data
- Costly with higher demands
- Dynamic scalability not seamless
- Easier creation of dedicated
hosts
- Vendor and technology lock-in
- Difficult migration of projects
that are not cloud-ready well-
written
- Flexible and scalable
Dedicated server IaaS PaaS
Server(full?) - transition to cloud
6. Serverless computing is a cloud
computing execution model in which the
cloud provider dynamically manages the
allocation of machine resources.
Pricing is based on the actual amount of
resources consumed by an application,
rather than on pre-purchased units of
capacity.
9. Suitable for…
• Event-driven applications
• Messages from IoT devices
• Pay-per-click services
• Stateless applications
• Applications APIs
• Mobile backend as a service (MBaaS)
• Scheduled events
• Parsing data at certain time of the day
10. Not suitable for…
• Long running operations
• Need to be broken down
• Stateful applications
• State must be stored separately
13. Pitfall 1: Vendor control and lock-in
• Limits on execution time
• Monitoring, health checks defined by providers
)(xf< 2 min
14. Pitfall 2: Thin backend, thick clients
• Lots of logic needs to be handled by client
• For multiple clients, it could mean a lot of repetition
)(xf
15. Pitfall 3: Startup latency (in JVM)
• If there are longer times between executions or the calls are
infrequent
)(xf
16. Pitfall 4: Look ma’, no operations!
)(xf
…also, no server optimizations
19. Stateless, single purpose, event driven
Good in combination with other vendor-specific PaaS resources
Pay only for total execution time of function
Service providers supporting cloud functions:
Google Cloud Functions, AWS Lambda, Azure functions, IBM OpenWhisk,…
Tooling is not great
Develop either in browser or prepare for a lot of boilerplate
Honorary mention: Serverless Framework, Spring Cloud Functions
)(xf
Topic transitions…
New technologies aren’t really new
New (old) technologies are being utilized for new, modern purposes
Cloud is a first-class citizen when it comes to developing new software
Many possibilities on how to utilize this computing power, not everything is suitable
Let’s look at some real life scenarios…
Typical web application (client/server) setup:
Client sends HTTP request to REST API
Application receives request through a server socket
Application processes the request and sends HTTP response with body (data)
In-house server hosting
Only feasible for big companies, e.g. U.S. Steel
IaaS
You can use service providers
Or you can develop your own infrastructure
PaaS
Also CaaS (containers) and SaaS
Connection of Serverless and FaaS – Serverless is utilizing FaaS model
Event-sourcing – AWS Lambda can be used to process events, like processing Kinesis stream (lambda polls the stream)
Showcase:
AWS Console
Create Lambda function
You can test the function directly
Upload new version or save it directly in browser
API Gateway, IAM Roles
Kinesis stream receives data, the lambda processes the stream logging errors, DynamoDB is used to store the errors.
You develop your application not using specific features, but abstractions (e.g. Event sourcing, Function composition, CQRS)
User state (session) management
Shared data
Also valid for interpreted languages, application is passivated after certain time of inactivity, it may be up in few milliseconds, but you have to bear it in mind.
It is a black box, to which you don’t have any access
https://serverless.com/
Watch out for pricing used in combination with other services. You may pay a lot for the least denominator.
Take into account: API Gateway, IAM access, S3 Bucket, DynamoDB, etc.
Spring Cloud Functoins - Dave Syer @ OpenSlava 2017