25
Getting started with AWS Lambda & the Serverless Cloud Ian Massingham Chief Evangelist (EMEA), AWS [email protected] @IanMmmm

DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Embed Size (px)

Citation preview

Page 1: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Getting started with AWS Lambda & the Serverless Cloud

Ian Massingham Chief Evangelist (EMEA), AWS [email protected] @IanMmmm

Page 2: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

AWS Compute offerings

AWSLambdaServerlesscomputeplatformforstatelesscodeexecution

inresponsetoevents

AmazonECSContainermanagement

serviceforrunningDockeronamanagedclusterofEC2

AmazonEC2Virtualserversin

theCloud

Page 3: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Continuousscaling

Noserverstomanage

Neverpayforidle–nocoldservers

Benefits of AWS Lambda

Page 4: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Pay-per request

• Buy compute time in 100 ms increments

• Low request charge • No hourly, daily, or

monthly minimums • No per-device fees

Never pay for idle!

Free Tier

1 million requests and 400,000 GBs of compute every month, for every customer

Page 5: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Using AWS Lambda

Bring your own code • Node.js, Java, Python, C# • Bring your own libraries

(even native ones)

Simple resource model

• Select power rating from 128 MB to 1.5 GB

• CPU & network allocated proportionately

• Metrics provide actual usage

Flexible authorization • Securely grant access to

resources, including VPCs

• Fine-grained control over who can call your functions

Flexible use • Call or send events • Integrated with other AWS

services • Build whole serverless

ecosystems

Page 6: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Using AWS LambdaProgramming model • AWS SDK built in • Lambda is the front end • Use processes, threads, /

tmp, sockets normally

Stateless • Persist data using Amazon

S3, ElastiCache, RDS or non-relational databases

• No affinity to infrastructure (can’t “log in to the box”)

Authoring functions • Author directly using the

console WYSIWYG editor • Package code as a .zip and

upload to Lambda or S3 • Plugins for Eclipse and

Visual Studio • Command line tools

Monitoring and logging • Built-in metrics for requests,

errors, latency, and throttles • Built-in logs in Amazon

CloudWatch Logs

Page 7: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Key usage scenarios

Data Triggers Customise behaviour on data updates in S3,

SNS & more

Control systems Customize responses and

response workflows to state changes within AWS

Serverless backends Execute server side

backend logic in a cross platform fashion

Big data Realtime processing

of streaming data updates using Kinesis

Page 8: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

DEMO : AWS CodeStar + AWS Lambda for Serverless Web Apps

Page 9: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Features of AWS CodeStar

✓ Project Templates ✓ Team Access Management

with AWS IAM ✓ Managed Build Service with

AWS Code Build ✓ Unified Project Dashboard

using Amazon CloudWatch monitoring service

✓ Issue tracking and project management tool in

dashboard via integrated Atlassian JIRA Software

✓ AWS CodeCommit for Secure Hosted Git Repository

✓ Automated App Deployments with AWS CodeDeploy and AWS CloudFormation

✓ Integration of AWS CodePipeline for Automated Continuous Delivery Pipeline

Page 10: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Lambda + S3

Page 11: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Dynamic data ingestion using S3+Lambda

Amazon S3 AWS Lambda processes the

object

Amazon S3

New object uploaded

Amazon DynamoDB

Stores

processed

object to S3

Updates file metadata to DynamoDB

Page 12: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Customers running S3+Lambda pipelines

AWS Lambda

Indexing tables or

notifications

Apply custom logic to process content being uploaded into Amazon S3 • Watermarking / thumbnail creation • Transcoding • Indexing and de-duplication • Aggregation and filtering • Pre processing • Content validation • WAF updates

Amazon S3 Bucket Events

Processed files

Page 13: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Lambda + Kinesis

Page 14: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Real time stream processing with Kinesis+Lambda

Amazon Kinesis

AWS Lambda processes the

stream

Amazon CloudWatch Logs

Amazon SNS

Compress

data & dump

to CW-Logs

Filter data and alert SNS on match

New data available

Page 15: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Customers using real-time processing pipelines

AWS Lambda

Aggregate statistics

Real-time analytics

Kinesis Stream

Apply custom logic to process data being uploaded through Kinesis stream • Client activity tracking • Metrics generation • Data cleansing • Log filtering • Indexing and searching • Log routing • Live alarms and notifications

Page 16: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Lambda Powered APIs

Page 17: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

An API Call Flow

Internet

Mobile Apps

Websites

Services

AWS Lambda functions

AWS

API Gateway Cache

Endpoints on Amazon EC2

Any other publicly accessible endpointAmazon CloudWatch

Monitoring

Amazon CloudFront Amazon

API Gateway

Page 18: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Lambda + Cognito & Mobile Apps

Page 19: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Building Mobile Backends with Lambda

• Lambda as the backend logic for mobile applications.

• Easy Personalization – … for devices – … for end users

Page 20: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Other Use Cases

Page 21: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
Page 22: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Scheduled Event (CRON)

• Dev/QA Environments: Stop running instances at 19:00 h and Start it again at 8:00 between Monday to Friday.

• Log cleanup • Batching up statistics • Alarm clock • Infrastructure automation • Backup scheduler

Page 23: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Backup and Disaster Recovery

• Cross-region replication to multiple regions. • Off-site backups. • Validation of those backups is difficult to scale. • Set rules on Lambda that defines what needs to be backup and

checks • Validates and raise alarms in case of failure.

Page 24: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Thank You. Got questions?

Ian Massingham Chief Evangelist (EMEA), AWS [email protected] @IanMmmm

Page 25: DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud

Appendix