state of serverless

20
Serverless/Frugal Architecture By: Anurag Saran Sr Sol Architect.

Upload: anurag-saran

Post on 22-Jan-2018

147 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: State of serverless

Serverless/Frugal Architecture

By: Anurag Saran Sr Sol Architect.

Page 2: State of serverless

What is Serverless?

Provisioningand Utilization

Operations and Management

Scaling Availability and Fault Tolerance

Removes the need for….

What is Serverless

Page 3: State of serverless

Benefits of Serverless?

Provisioningand Utilization

Operations and Management

Scaling Availability and Fault Tolerance

Which leads to….

Low Cost Simple Low Latency Scalable Reliable

Benefits of Serverless

Page 4: State of serverless

ServerlessContinuous Scaling

● Automatically● Scale up and scale down

Don’t bother me with Details● Run when i need it● Pay what you use.

Fully Managed▪ No provisioning▪ Zero administration▪ High availability

Developer Productivity▪ Focus on the code that

matters▪ Innovate rapidly▪ Reduce time to market

Page 5: State of serverless

AWS Lambda● Lambda Allocates:

○ CPU Power○ Network Bandwidth○ Disk I/O

● You Allocate:○ Memory○ Execution timeout

● Stateless○ Store Persistent state to

another service.

Libraries● Node.JS● AWS SDK for JS Ver 2.2Python:● AS SDK for Python Version

1.2.1● Java:

○ No Additional Libraries available

● Manually Include Libraries.

Page 6: State of serverless

Programming Model● Code written must follow a common pattern.● Four concepts used regardless of the language.

● Handler:○ The function in the code called upon execution○ All event data passed in as the first parameter.○ Context passed in as the second parameter.○ Process event data.

● Context:○ Passed in as an object to the handler as the second

parameter.○ Enable code to interact with AWS Lambda.

● Interaction with AWLS Lambda○ Time Left before AWS lambda terminates our function.○ Get AWS request ID.

Page 7: State of serverless

Programming Model● Logging:

○ Log your execution○ Write to Amazon Cloudwatch.

● Metrics: ○ Invocation○ Errors ○ Duration

● Asynchronous Exception○ Does not return result to the caller.○ Logs error to cloud watch

● Synchronous Exception○ Returns result to the caller.

Page 8: State of serverless

Programming Model● Push

○ Event source invokes lambda function○ Used by S3, SNS, Cognito, Echo, and user apps.○ Event source mapping held in the event source not

lambda.

● Pull○ AWS lambda polls the event source○ Invokes lambda functions if there is a new event.○ USed by dynamoDB and Kinesis○ Event source mapping help in AWS Lamdba.

● Event: ○ Executes the function asysnchronously○ RequestResponse○ Executes the function sysnchronously.

Page 9: State of serverless

AWS Lamda Resource Limits

Page 10: State of serverless

AWS Lamda Functional Limits

● Cold Start Time● First request slower● Containers stay active for a period of time.● Try increasing the memory to increase CPU limits.

● CPU Allocation○ CPU power proportional to memory allocated○ 1024MB/128MB: 8 times the CPU share.

Page 11: State of serverless

Lambda announcements @ re:Invent

● Lambda supports C# ● Lambda comes to IoT devices and hubs ● Lambda is embedded in Snowball ● Lambda integrates with CloudFront ● Lambda supports tracing through X-Ray ● Step Functions bring orchestration to Lambda

The key takeaway is that Amazon wants enterprises to consume EC2 while it is pushing startups and developers towards Lambda.

Page 12: State of serverless

Market Landscape● Amazon Lambda

○ Pioneer of serverless, launched in Nov 2014○ Rapid growth, dedicated mini-con at Re:Invent 2016○ Step Functions is to Lambda what an Orchestrator is to

containers○ AWS is betting on Lambda than on containers.

● Multiple niche players○ iron.io, pubnub.com, etc

● IBM - OpenWhisk○ open source serverless platform, Developed by IBM, now

under incubation in Apache (w/Adobe)○ Also offered on IBM Bluemix as a fully managed service.○ The service is integrated with IBM Bluemix, the PaaS

environment powered by CloudFoundry

Page 13: State of serverless

Market Landscape

● Microsoft:○ Azure Web Jobs, the runtime environment for invoking code

snippets either on-demand or through a scheduled cron job. Microsoft is expected to build a robust serverless framework based on its next generation PaaS called Service Fabric.

● Spring○ Spring Cloud Function○ Expected Mid of 2017

Page 14: State of serverless

Market Landscape● Serverless Framework:

○ Started as JAWS○ Available as a node.js NPM module○ Provides multiple boilerplate templates that can jumpstart

AWS Lambda development.

● Google Cloud Functions:○ Apart for kubernetes○ Investing in Google Cloud Functions.○ Only a few services such as Google Cloud Storage, Google

Cloud Pub/Sub are integrated with Cloud Functions.

● Iron.Io○ IronQueue, IronWorker, and IronCache○ Project Kratos can run existing AWS Lambda functions

packaged as Docker containers

Page 15: State of serverless

Architecture - OpenWhisk

Page 16: State of serverless

Serverless On OpenStack

OpenWhisk● API Gateway● Swift and NodeJS ● BYO Docker images for lang you choice.

Missing :● Auth Plugin● Prebuilt deployment system to get openWhisk on

OpenStack.● Management of Openstack from openWhisk.

Page 17: State of serverless

OpenWhisk on IBM Bluemix

Page 18: State of serverless

Challenges● Cant lift and Shift● Testing Is a Pain● FAAS-Distributed Architecture● HA- Multi Region Architecture● Long Running Jobs● Opinionated programming model

○ Aligned with 12-factor approach to cloud-native applications

● Per-invocation latency & overhead● High-performance persistent state● Life cycle of composite serverless applications● Monitoring, error handling, testing, debugging● Less Observability/Instrumentation.

● FAAS-Event Based● Docker- Compute

Page 19: State of serverless

Community...

Openwisk● Openwisk announced in February 2016 - Apache

Project● GA on public cloud: Bluemix Openwisk

● Fission: https://github.com/fission/fission and● Funktion : https://funktion.fabric8.io/docs/#kubernetes-resources

Page 20: State of serverless

THANK-YOU

PAAS/FAAS: You think about scale. Can’t do at the level of individual request.

#lessops #NoOps #No internal Sys Admin

#Packing #Scalling # Deployments #responsibleDeveloper