ARCHITECTURES
(WITH INFRASTRUCTURE)
Niko Köbler Soware-Architect, Developer & Trainer | |
SERVERLESS
AWS
niko@n-k.de www.n-k.de @dasniko
SERVERLESS ARCHITECTURES (WITH AWS INFRASTRUCTURE) Niko Kbler - - PowerPoint PPT Presentation
SERVERLESS ARCHITECTURES (WITH AWS INFRASTRUCTURE) Niko Kbler Soware-Architect, Developer & Trainer niko@n-k.de www.n-k.de @dasniko | | @dasniko DISCLAIMER This is NO silver bullet, no standard, but opinionated! SERVERLESS
Niko Köbler Soware-Architect, Developer & Trainer | |
niko@n-k.de www.n-k.de @dasniko
@dasniko
This is silver bullet, no standard, but opinionated! NO
This is what actually mean... serverless
Serverless is about the
Build and run applications servers. management without thinking about
Physical Servers in datacenters Virtual Machines in datacenters Virtual Machines in Cloud Containers on Virtual Machines Serverless as the unit of compute
Functions are the unit of deployment and scaling. No machines, VMs, or containers visible in the programming model. Permanent storage lives elsewhere. Scales per request; Users cannot over- or under-provision capacity. Never pay for idle (no cold servers/containers or their costs). Implicitly fault-tolerant because functions can run anywhere. BYOC - Bring Your Own Code. Metrics and logging are a universal right.
Source: various AWS presentations
Unit of deployment and scale!
is as
Event Driven JVM-based languages (Java 8), JavaScript (Node.js), Python, C#, (more to come) Versions, Encrypted Environment Variables, Step Functions Pay as you use - in 100ms blocks (e.g. 100ms w/ 128MB memory = USD 0.000000208)
exports.handler = (event, context) => { console.log('Received event:', JSON.stringify(event)); }
public class ImageProcessor implements RequestHandler<S3Event, Void> { @Override public Void handleRequest(S3Event s3Event, Context context) { // get the S3 event data from the event request S3EventNotification.S3EventNotificationRecord record = s3Event.getRecords().get(0); // your code goes here... // return an object with specified type (see class generics) return null; } }
S3 Cloud Watch Config AWS IoT Cognito SES API Gateway
(no complete list)
DynamoDB Cloud Formation Kinesis Code Commit SNS Echo / Alexa Cron
"Reverse Proxy" hides possible multiple service calls (aka "service composition", ESB?) distributes requests to proper service instances "Mock" services Caching, Throttling, DDoS attack protection, etc.
"Reverse Proxy" hides possible multiple service calls (aka "service composition", ESB?) distributes requests to proper service instances "Mock" services Caching, Throttling, DDoS attack protection, etc.
AWS Cognito / STS Custom Authorizer (Lambda Function, returning IAM policies)
Fully Managed NoSQL Data Store Schemaless Data Model Seamless Scalabiltiy, "no limits" Pay by Read-/Write-Capacity-Units
Example
API Gateway with , Push and SNS SQS
Functions are easy to test, stateless and little to no dependencies
Environment, Infrastructure
no remote debugging
JavaScript
JavaScript, C#, Python, PHP
COMPETITOR
Bluemix Cloud & OnPremise Open Source / Apache License v2.0 JavaScript (Node.js), Python and... Swi! Docker Support Function-Chaining
$ git clone https://github.com/openwhisk/openwhisk.git $ cd openwhisk/tools/vagrant $ vagrant up
Create the action in OpenWhisk Run the action Result
function main(params) { return {payload: 'Hello, ' + params.name}; } $ wsk action create hello hello.js $ wsk action invoke hello --blocking --result --param name Niko { "payload": "Hello, Niko" }
Overview: Documentation, Logging & Monitoring, Metrics ! (typical things for distributed environments) Cloud Provider Binding / Dependency: APIs, Portability, Costs, SLAs
Give a try! Manages all the Cloud-Resources and Deployment.
serverless.com
# Install serverless globally $ npm install serverless -g # Create an AWS Lamdba function in Node.js $ serverless create --template aws-nodejs # Deploy to live AWS account $ serverless deploy # Function deployed! $ http://api.amazon.com/users/update
No need to run/manage Application Servers Fast results, minimal effort, minimal TTM(!) Low costs, minimal financial risk Automatic Scalabiltiy and Availability "out-of-the-box"
Slides: Niko Köbler Soware-Architect, Developer & Trainer | |
http://bit.ly/serverless-slides niko@n-k.de www.n-k.de @dasniko
AWS Lambda: Amazon API Gateway: Google Cloud Functions: Microso Azure Functions: IBM OpenWhisk: IBM OpenWhisk SourceCode: Serverless Framework: https://aws.amazon.com/lambda https://aws.amazon.com/api- gateway https://cloud.google.com/functions https://azure.microso.com/services/functions https://developer.ibm.com/openwhisk https://github.com/openwhisk/openwhisk http://serverless.com