Getting started with AWS Lambda & the Serverless Cloud Ian Massingham Chief Evangelist (EMEA), AWS ianm@amazon.com @IanMmmm
AWS Compute offerings AWS	Lambda Serverless	compute	platform for	stateless	code	execution in	response	to	events Amazon	ECS Container	management service	for	running	Docker on	a	managed	cluster	of	EC2 Amazon	EC2 Virtual	servers	in the	Cloud
Continuous scaling No	servers	to manage Never	pay	for	idle –	no	cold	servers Benefits of AWS Lambda
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
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
Using AWS Lambda Programming 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
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
Lambda + S3
Dynamic data ingestion using S3+Lambda Amazon S3 AWS Lambda processes the object Amazon S3 New object uploaded NoSQL DB Stores processed object to S3 Updates filemetadata toNoSQL DB
Demo: Amazon S3 + Lambda + MongoDB
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
Lambda + Kinesis
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 andalert SNS onmatch New data available
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
Lambda Powered APIs
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
Lambda + Cognito & Mobile Apps
Building Mobile Backends with Lambda • Lambda as the backend logic for mobile applications. • Easy Personalization – … for devices – … for end users
Other Use Cases
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
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.
Thank You. Got questions? Ian Massingham Chief Evangelist (EMEA), AWS ianm@amazon.com @IanMmmm
Appendix
Reference architecture: IoT back end using AWS Lambda and Amazon Kinesis https://s3.amazonaws.com/awslambda-reference-architectures/iot-backend/lambda-refarch-iotbackend.pdf https://github.com/awslabs/lambda-refarch-iotbackend
Reference architecture: Mobile back end using AWS Lambda and Amazon API Gateway https://s3.amazonaws.com/awslambda-reference-architectures/mobile-backend/lambda-refarch-mobilebackend.pdf https://github.com/awslabs/lambda-refarch-mobilebackend
Reference architecture: Web applications with AWS Lambda https://s3.amazonaws.com/awslambda-reference-architectures/web-app/lambda-refarch-webapp.pdf https://github.com/awslabs/lambda-refarch-webapp
Reference architecture: Real-time file processing using AWS Lambda https://s3.amazonaws.com/awslambda-reference-architectures/file-processing/lambda-refarch-fileprocessing.pdf https://github.com/awslabs/lambda-refarch-fileprocessing
Reference architecture: Real-time stream processing using AWS Lambda and Amazon Kinesis https://s3.amazonaws.com/awslambda-reference-architectures/stream-processing/lambda-refarch-streamprocessing.pdf https://github.com/awslabs/lambda-refarch-streamprocessing

Getting started with AWS Lambda and the Serverless Cloud

  • 1.
    Getting started withAWS Lambda & the Serverless Cloud Ian Massingham Chief Evangelist (EMEA), AWS ianm@amazon.com @IanMmmm
  • 2.
  • 3.
  • 4.
    Pay-per request • Buycompute 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
  • 5.
    Using AWS Lambda Bringyour 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
  • 6.
    Using AWS Lambda Programmingmodel • 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
  • 7.
    Key usage scenarios DataTriggers 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
  • 8.
  • 9.
    Dynamic data ingestionusing S3+Lambda Amazon S3 AWS Lambda processes the object Amazon S3 New object uploaded NoSQL DB Stores processed object to S3 Updates filemetadata toNoSQL DB
  • 10.
    Demo: Amazon S3 +Lambda + MongoDB
  • 11.
    Customers running S3+Lambdapipelines 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
  • 12.
  • 13.
    Real time streamprocessing with Kinesis+Lambda Amazon Kinesis AWS Lambda processes the stream Amazon CloudWatch Logs Amazon SNS Compress data & dump to CW -Logs Filter data andalert SNS onmatch New data available
  • 14.
    Customers using real-timeprocessing 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
  • 15.
  • 16.
    An API CallFlow 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
  • 17.
    Lambda + Cognito& Mobile Apps
  • 18.
    Building Mobile Backendswith Lambda • Lambda as the backend logic for mobile applications. • Easy Personalization – … for devices – … for end users
  • 19.
  • 21.
    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
  • 22.
    Backup and DisasterRecovery • 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.
  • 23.
    Thank You. Gotquestions? Ian Massingham Chief Evangelist (EMEA), AWS ianm@amazon.com @IanMmmm
  • 24.
  • 25.
    Reference architecture: IoTback end using AWS Lambda and Amazon Kinesis https://s3.amazonaws.com/awslambda-reference-architectures/iot-backend/lambda-refarch-iotbackend.pdf https://github.com/awslabs/lambda-refarch-iotbackend
  • 26.
    Reference architecture: Mobileback end using AWS Lambda and Amazon API Gateway https://s3.amazonaws.com/awslambda-reference-architectures/mobile-backend/lambda-refarch-mobilebackend.pdf https://github.com/awslabs/lambda-refarch-mobilebackend
  • 27.
    Reference architecture: Webapplications with AWS Lambda https://s3.amazonaws.com/awslambda-reference-architectures/web-app/lambda-refarch-webapp.pdf https://github.com/awslabs/lambda-refarch-webapp
  • 28.
    Reference architecture: Real-timefile processing using AWS Lambda https://s3.amazonaws.com/awslambda-reference-architectures/file-processing/lambda-refarch-fileprocessing.pdf https://github.com/awslabs/lambda-refarch-fileprocessing
  • 29.
    Reference architecture: Real-timestream processing using AWS Lambda and Amazon Kinesis https://s3.amazonaws.com/awslambda-reference-architectures/stream-processing/lambda-refarch-streamprocessing.pdf https://github.com/awslabs/lambda-refarch-streamprocessing