Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AWS Lambda - Serverless Cloud

Yash Patel
January 12, 2018

AWS Lambda - Serverless Cloud

What is AWS Lambda? How Can Serverless cloud help your organization focus more on business with reducing the operational cost?

Yash Patel

January 12, 2018
Tweet

More Decks by Yash Patel

Other Decks in Technology

Transcript

  1. Agenda • What is AWS Lambda? • AWS Lambda -

    How It Works? • AWS Lambda - Benefits • AWS Lambda - Common Use Cases? • Q & A
  2. What is AWS Lambda? • Event-driven (Runs the code in

    response to event ) • Serverless compute service (Automatically manages the compute resources ) • Stateless (each request is independent and not related to earlier request)
  3. AWS Compute Offering Services EC2 ECS Lambda Elastic Cloud Compute

    (Virtual Machine) (Elastic Container service) I.e. Docker (Function)
  4. What other things that you have to do? 1. Provision

    a fleet of proxy machines to capture data uploads. 2. For each upload, enqueue a job to process it. 3. Provision a second fleet of machines to read and process jobs. 4. Pick a deployment solution. 5. Plan capacity 6. Accounting for fault tolerance, good long term utilization and burst capability. 7. Monitor 24x7x365 for capacity, health and security etc. 8. Keep OS and Language runtimes patched and up to date. 9. Migrate to new instance type over time
  5. • Operation and Management • Scaling • Provisioning and Utilization

    • Availability and fault tolerance • Security Owning Server means dealing with …
  6. With Serverless Compute • Run your code without managing servers

    • Your code will run only when needed (Event Driven)
  7. What are the primitives of an application? Functions Interactions Communicated

    via events The Magic Happens at the Intersection of Functions, Events and Data (Pretty much everything else is glue or UI)
  8. Image Thumbnail Creation using AWS Lambda Picture is taken Picture

    is uploaded to S3 bucket Lambda is Triggered Lambda runs image resizing function and generate different size (Web, Tablet and Mobile) thumbnails
  9. Application components of serverless apps Event Source Function Services (Anything)

    Change in data stage Requests to end point Change in resource state NodeJs Python Java C#
  10. AWS Lambda - Benefits 1 Bring your own code 2

    Cost effective and efficient 3 No infrastructure management Capacity, Scaling, DR, Monitoring, Logging, Security Focus on business logic Pay only for what you use ( subsecond metering, 100ms) Run code in standard language
  11. Using AWS Lambda • Bring your own code • Flexible

    use • Simple resource allocation ( from 128 MB up to 1.5gb) • Flexible Authorization • Built In Editor and Third party plugin (eclipse , Visual Studio) • Standard Programming Model ( process, thread, socket, AWS SDK) • Built In Monitoring and Logging • Stateless Nature
  12. AWS Lambda - Common Use Case • Live Dashboard •

    Content Management System • Mobile App Backend • Bots - Interactive Backend • WebHooks • ETL System • Autonomous IT • IOT App
  13. AWS Lambda - Best Practices • Create single purpose function

    (micro-service) • Limit your function size • Limit function execution duration ( no more than 300 seconds) • Dont assume function will reuse underlying compute infrastructure • Use built-in CloudWatch monitoring of your Lambda functions to view and optimize function. • 500 mb temp storage capacity limit • Delete old Lambda functions that you are not longer using.
  14. Takeaway • Many Applications go serverless • Lambda functions are

    opinionated (state, invoke, deployment) • The ecosystem continue to grow
  15. AWS Lambda runs code in response to events Lambda Functions

    - stateless, trigger-based code execution Triggered by events • Direct sync and async API calls • AWS service integration • Third party triggers • Many more …. Make it easy to • Perform data-driven auditing, analysis and notification • Build back-end services that perform at scale
  16. AWS Lambda - Common Use Case Analytics • Operation Management

    • Live Dashboard Zillow | MLBam | localytics Interactive back-end • Bots • WebHooks Slack | zappier | twilio Data Workflows • Content Management • ETL workflow Thomson reuters | FireEye Autonomous IT • Policy Engine • Infrastructure Management NetFlix
  17. Using AWS Lambda • Authoring Functions ◦ WYSIWYG editor or

    upload packaged zip ◦ Third party plugin (Eclipse, Visual Studio) • Standard Programing model ◦ Use process, threads and sockets normally ◦ AWS SDK built in ( NodeJs & Python) • Built-In Monitoring and logging ◦ Metrix for requests, errors and throttles ◦ Built-in logs to AWS CloudWatch Logs • Stateless ◦ Persist data using external storage ◦ No dependency or access to underlying infrastructure
  18. AWS Compute Offering Services EC2 ECS Lambda How to choose?

    configure machine, storage, networking and my OS run servers, configure applications, and control scaling run my code, When it’s needed
  19. Event sources that integrate with AWS Lambda • Data Storage

    ◦ Amazon S3 ◦ Amazon DynamoDB ◦ Amazon Kinesis ◦ Amazon Cognito • Endpoints ◦ Amazon Alexa ◦ Amazon API Gateway ◦ Amazon IoT • Repositories ◦ AWS CloudFormation ◦ AWS CloudTrail ◦ AWS CloudWatch • Event/Messaging Services ◦ Amazon SES ◦ Amazon SNS ◦ Cron Events ...and the list will continue to grow