rights reserved. About Me George Mao • Currently: AWS Serverless Specialist • Experience: • Software Engineer • Open Source Contributor [email protected] @georgemao (Twitter) @georgemao (Slack #awsdevelopers) Serverless Specialist George Mao
rights reserved. Development transformation: Early 2000s monolithic application + teams 2001 Lesson learned: decompose for agility 2002 microservices + 2 pizza teams
rights reserved. Why did AWS build the Serverless platform? No infrastructure provisioning, no management Automatic scaling Pay for value Highly available and secure
rights reserved. MICROSERVICE API API MICROSERVICE MICROSERVICE EVENT API MICROSERVICE EVENT API MICROSERVICE APPLICATION Mobile client Client IoT PERSISTENCE PERSISTENCE
rights reserved. Let’s focus on compute for now Serverless event-driven code execution Short-lived All language runtimes Data source integrations AWS Lambda
rights reserved. Serverless applications SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state EVENT SOURCE FUNCTION Node.js Python Java C#/Powershell Go Ruby
rights reserved. Using AWS Lambda Bring your own code • Node.js, Java, Python, C#, Go, Ruby • Bring your own libraries (even native ones) Simple resource model • Select power rating from 128 MB to 3 GB • CPU and network allocated proportionately Flexible use • Synchronous or asynchronous • Integrated with other AWS services Flexible authorization • Securely grant access to resources and VPCs • Fine-grained control for invoking your functions
rights reserved. Handler() function Function to be executed upon invocation Event object Data sent during Lambda Function Invocation Context object Methods available to interact with runtime information (request ID, log group, etc.) public String handleRequest(Event checkout, Context context) { processCheckout(checkout); return checkout.getName() + " has checked out!"; } Anatomy of a Lambda function
rights reserved. Manage APIs with Amazon API Gateway Mobile apps Websites Services Internet Amazon CloudFront Amazon CloudWatch monitoring API Gateway cache Any other AWS service All publicly accessible endpoints AWS Lambda functions Endpoints in your VPC Regional API Endpoints AWS Lambda functions Endpoints on Amazon EC2 Your VPC AWS
rights reserved. New: Serverless WebSockets with API Gateway Real-time two-way communications Managed persistence Event-based triggers Mobile apps Chat Dashboards IoT devices Amazon API Gateway WebSockets API Stateful connection Stateless connection Lambda Functions Public Endpoints on Amazon EC2 Amazon Kinesis Any other AWS service All publicly accessible endpoints
rights reserved. New: App Load Balancer Integration with Lambda Enables easier transition from existing compute stacks to Lambda Mix and match compute options to build your backends Robust load balancer controls (health checks, programmable rules engine ,traffic shaping)
rights reserved. New: Lambda Layers Lets functions easily share code: Upload layer once, reference within any function Promote separation of responsibilities, lets developers iterate faster on writing business logic Built in support for secure sharing by ecosystem Custom Runtimes
rights reserved. AWS AppSync: Realtime and offline with GraphQL Real-time WebSockets Fine-grained access control Offline programming model with sync Multiple data sources HTTP Data Source
rights reserved. Alexa tell me … Cards Speech Recognition Machine Learning Natural Language Understanding Text to speech Request Response Your Service Audio