Serverless Summary

Lambda - Exam Tips

  • Lambda scales out (not up) automatically
    • You can have many concurrent lambda functions running at once
  • Lambda functions are independent, 1 event = 1 function
  • Lambda is serverless
  • Know which services are serverless!
    • S3
    • DynamoDB
  • Lambda functions can trigger other lambda functions, 1 event can = x functions if functions trigger other functions
  • Architectures can get extremely complicated, AWS X-Ray allows you to debug what is happening
    • updates to DB, SNS notifications failing
  • Lambda can do things globally, you can use it to back up S3 buckets to other S3 buckets etc
  • Know the lambda triggers

API Gateway

  • Remember what API gateway is at a high level
    • restaurant
    • Customer submits request to Waiter, Waiter takes requests, sends to kitchen
  • API Gateway has caching capabilities to increase performance
    • McDonalds keeps big macs and burgers already made (cached)
    • If you order a salad or fish sandwich, they would actually have to make it (not cached)
  • API Gateway is low cost and scales automatically
  • You can throttle API Gateway to prevent attacks
  • You can log results to CloudWatch
  • If you are using JavaScript/AJAX that uses multiple domains with API Gateway, ensure that you have enabled CORS on API Gateway
  • CORS is enforced by the client

Version Control with Lambda

  • Can have multiple versions of lambda functions
  • latest version will use $latest
  • qualified version will use $latest, unqualified will not have it
  • versions are immutable (cannot be changed)
  • Can split traffic using aliases to different versions
    • Cannot split traffic with $latest, instead create an alias to latest

Step Functions

  • Great way to visualize your serverless application
  • Step functions automatically triggers and tracks each step
  • Step functions logs the state of each step so if something goes wrong you can track what went wrong and where

X-Ray Exam Tips

The X-Ray SDK Provides:

  • Interceptors to add to your code to trace incoming HTTP requests
  • Client handlers to instrument AWS SDK clients that your application uses to call other AWS services
  • An HTTP client to use to instrument calls to other internal and external HTTP web services

The X-Ray integrates with the following AWS services:

  • Elastic Load Balancing
  • AWS Lambda
  • Amazon API Gateway
  • Amazon Elastic Compute Cloud
  • AWS Elastic Beanstalk

The X-Ray integrates with the following languages:

  • Java
  • Go
  • Node.js
  • Python
  • Ruby
  • .Net