Slide 1

Slide 1 text

© 2021, Amazon Web Services, Inc. or its Affiliates. What Can You Do with Serverless Danilo Poccia Chief Evangelist (EMEA) @danilop in 2021

Slide 2

Slide 2 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Photo by Jeremy Bishop on Unsplash

Slide 3

Slide 3 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. We have an idea for a new web/mobile app! How can we build it quickly and put it in the hands of customers?

Slide 4

Slide 4 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. I want to build a mobile app that helps my customers store and analyze videos taken with their smartphone. You can use a serverless architecture to focus on the features you want to build. It’ll be much easier to scale up if needed. You’ll also be driven to think about security as you build it. Serverless Com puting

Slide 5

Slide 5 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Serverless function API Call File uploaded Database updated Your code Your business logic With its own permissions Something happens Event Serverless function Serverless function Serverless function Serverless Com puting Invoke

Slide 6

Slide 6 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Analysis Function Videos Results Get Results Function HTTP API Upload Get Serverless Com puting Event Write Read Event

Slide 7

Slide 7 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Many functions used by my app return very quickly, often in less than 20ms. Billing & Cost O ptim ization Billing granularity for Lambda functions has been reduced from 100ms down to 1ms with no minimum duration. This lowers the price for most Lambda functions, more so for short duration functions.

Slide 8

Slide 8 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. REPORT RequestId: 35a7e0cb-4902-490d-b8d3-eb315dded660 Duration: 27.40 ms Billed Duration: 100 ms Memory Size: 1024 MB Max Memory Used: 472 MB Before With 1ms billing granularity REPORT RequestId: a24d03b5-429d-4ca3-a490-878a52a0182f Duration: 27.55 ms Billed Duration: 28 ms Memory Size: 1024 MB Max Memory Used: 472 MB 1m s Billing Granularity

Slide 9

Slide 9 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Lambda functions now can have up to 10 GB of memory and 6 vCPUs. This is more than a 3x increase compared to previous limits. I want to be able to process high resolution videos. Large Functions

Slide 10

Slide 10 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Large Functions https://aws.amazon.com/blogs/aws/new-for-aws-lambda-functions-with-up-to-10-gb-of-memory-and-6-vcpus/

Slide 11

Slide 11 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. https://twitter.com/mooyoul/status/1334205430839472129 FFm peg First Case Study

Slide 12

Slide 12 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. M L Inference w ith PyTorch https://aws.amazon.com/blogs/aws/new-for-aws-lambda-functions-with-up-to-10-gb-of-memory-and-6-vcpus/ Same Costs 5x Faster +20% Costs 7x Faster

Slide 13

Slide 13 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. FFm peg Second Case Study https://www.sentiatechblog.com/aws-re-invent-2020-day-3-optimizing-lambda-cost-with-multi-threading Costs Duration

Slide 14

Slide 14 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. I want to process videos faster. It’ll give a better customer experience, and with a serverless architecture will also be cheaper! AVX2 support AWS Lambda now supports Advanced Vector Extensions 2 (AVX2), an extension to the x86 instruction set architecture that enables running a set of highly parallelizable operations simultaneously.

Slide 15

Slide 15 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Source: https://unsplash.com/photos/IMXhx6qhvf0. Photo credit: Daniel Seßler. Bicubic filter Bilinear filter Lanczos filter Im age Resizing U sing AVX2 https://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/

Slide 16

Slide 16 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Im age Resizing U sing AVX2 Filter Without AVX2 With AVX2 Performance improvement Bilinear 105 ms 71 ms 32% Bicubic 122 ms 73 ms 40% Lanczos 136 ms 77 ms 43% https://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/

Slide 17

Slide 17 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. The Lambda functions analyzing videos need many large dependencies. For example, I want to use a custom machine learning model to extract more information. Packaging & Deploym ent AWS Lambda now supports container images as a packaging format with an image size up to 10 GB. This also helps if you invested in container tooling for your development workflows.

Slide 18

Slide 18 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. FROM public.ecr.aws/lambda/nodejs:latest COPY app.js package*.json ./ RUN npm install CMD [ "app.lambdaHandler" ] Dockerfile Container Im age Support https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/ You can use base container images prepared by AWS and shared via Docker Hub and Amazon Elastic Container Registry (ECR) Public. Command can be overwritten by providing a different command in the template directly.

Slide 19

Slide 19 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. With serverless I can use small functions that react to events. But now my main function is becoming too big, mixing different capabilities such as video resizing and using a custom machine learning model. O rchestration & Choreography You can decompose a large function in small tasks that you can execute (and retry) independently from each other. For example, AWS Step Functions now supports Synchronous Express Workflows.

Slide 20

Slide 20 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Synchronous Express W orkflow s https://aws.amazon.com/blogs/compute/new-synchronous-express-workflows-for-aws-step-functions/

Slide 21

Slide 21 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Step Functions W orkflow Studio https://aws.amazon.com/blogs/aws/new-aws-step-functions-workflow-studio-a-low-code-visual-tool-for-building-state-machines

Slide 22

Slide 22 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. https://aws.amazon.com/blogs/compute/modeling-workflow-input-output-path-processing-with-data-flow-simulator Step Functions Data Flow Sim ulator

Slide 23

Slide 23 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Message Queues Amazon SQS Pub/Sub Messaging Amazon SNS https://aws.amazon.com/blogs/aws/introducing-amazon-sns-fifo-first-in-first-out-pub-sub-messaging/ O ther Com m on Integrations Patterns

Slide 24

Slide 24 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Amazon SNS FIFO Topic https://aws.amazon.com/blogs/aws/introducing-amazon-sns-fifo-first-in-first-out-pub-sub-messaging/ First-In-First-O ut (FIFO ) + Amazon SQS FIFO Queue

Slide 25

Slide 25 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Serverless Event Bus

Slide 26

Slide 26 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Lambda functions can be invoked synchronously or asynchronously. How can I monitor the async execution of Lambda functions? How can I get a response, or an error, from async invocations? O rchestration & Choreography You can use Lambda Destinations to automatically send the response or the error to Lambda functions, SQS queues, SNS topics, or an EventBridge event bus.

Slide 27

Slide 27 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. AW S Lam bda Destinations Lambda Functions – Asynchronous Invocations

Slide 28

Slide 28 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. AW S Lam bda Destinations Lambda Destinations for Asynchronous Invocations

Slide 29

Slide 29 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. O rchestration & Choreography Orchestration Coreography Workflow Event-Driven Inside a (micro)service Between (micro)services AWS Step Functions Sync/Async Express Workflow Lambda Destinations to Lambda, SQS, or SNS AWS Step Functions Async Standard Workflow Lambda Destinations to Amazon EventBridge

Slide 30

Slide 30 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. I'd like to use my app with a new use case for a regulated industry, such as finance or healthcare. Security There are many security features and documentation that can help you with compliance. You can now also use Code Signing, a trust and integrity control for AWS Lambda.

Slide 31

Slide 31 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Security

Slide 32

Slide 32 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Security https://docs.aws.amazon.com/whitepapers/latest/security-overview-aws-lambda/welcome.html

Slide 33

Slide 33 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Firecracker microVMs

Slide 34

Slide 34 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Firecracker microVMs Firecracker is open-sourced under Apache version 2.0 https://github.com/firecracker-microvm/firecracker

Slide 35

Slide 35 text

© 2021, Amazon Web Services, Inc. or its Affiliates. The principle of least privilege (PoLP) Each function and service has its own permissions using AWS IAM Effect Principal Action Resource Condition Allow / Deny Who What Where Filter “Every module must be able to access only the information and the resources that are necessary for its legitimate purpose”

Slide 36

Slide 36 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. I want to use S3 as the source of truth while processing videos and extracting metadata. Isn’t S3 eventually consistent while updating objects? I have the same issue with my data lake where I store and analyze my logs and application data. Storage Amazon S3 now delivers strong read-after-write consistency automatically for all applications.

Slide 37

Slide 37 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Am azon S3 Read-After-W rite Consistency

Slide 38

Slide 38 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. I want to share the data in my S3 bucket with other applications that have different security models and may need more information that what is stored in the bucket. Storage You can use S3 Object Lambda to process your data with a Lambda function as it is being read with a standard S3 API (GetObject).

Slide 39

Slide 39 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Am azon S3 O bject Lam bda AWS Cloud S3 Bucket Supporting S3 Access Point S3 Object Lambda Access Point Redacting Lambda Function E-commerce Application Analytics Application Original Object Redacted Object Marketing Application S3 Object Lambda Access Point Enriching Lambda Function Enriched Object Customer Loyalty Database

Slide 40

Slide 40 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. I want to use Amazon DynamoDB for its low latency and on-demand scalability, but I am not familiar with NoSQL and its syntax. Database You now can use a SQL-compatible query language to query, insert, update, and delete table data in DynamoDB. Also, the NoSQL Workbench can help you design your data model and build your operations.

Slide 41

Slide 41 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. N oSQ L W orkbench

Slide 42

Slide 42 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. N oSQ L W orkbench

Slide 43

Slide 43 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Photo by Maarten van den Heuvel on Unsplash Case Studies

Slide 44

Slide 44 text

© 2021, Amazon Web Services, Inc. or its Affiliates.

Slide 45

Slide 45 text

© 2021, Amazon Web Services, Inc. or its Affiliates. The “monolith” at the start of this journey Corporate data center Server contents Server contents Tax Products CRM Fulfillment Rewards Server contents

Slide 46

Slide 46 text

© 2021, Amazon Web Services, Inc. or its Affiliates. The “monolith” at the start of this journey VPC Node.js + React Elastic Beanstalk container Corporate data center Server contents Server contents Tax Products CRM Fulfillment Rewards Server contents

Slide 47

Slide 47 text

© 2021, Amazon Web Services, Inc. or its Affiliates. The “monolith” at the start of this journey VPC Node.js + React Elastic Beanstalk container Server contents Server contents Tax Products CRM Fulfillment Rewards VPC Gateway Corporate data center Server contents

Slide 48

Slide 48 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Then, during Black Friday 2017 … VPC Node.js + React Elastic Beanstalk container Server contents Server contents Tax Products CRM Fulfillment Rewards VPC Gateway 503 Service Unavailable Corporate data center Server contents

Slide 49

Slide 49 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Consolation in chaos …

Slide 50

Slide 50 text

© 2021, Amazon Web Services, Inc. or its Affiliates. September 2018 – Decoupling the backend VPC Node.js + React Elastic Beanstalk container Server contents Server contents Tax Products CRM Fulfillment Rewards AWS Cloud SaaS VPC Gateway Server contents Corporate data center

Slide 51

Slide 51 text

© 2021, Amazon Web Services, Inc. or its Affiliates. And the serverless journey begins!

Slide 52

Slide 52 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Black Friday 2018

Slide 53

Slide 53 text

© 2021, Amazon Web Services, Inc. or its Affiliates. July 10, 2019 shop.LEGO.com was switched to serverless on AWS

Slide 54

Slide 54 text

© 2021, Amazon Web Services, Inc. or its Affiliates. https://speakerdeck.com/danilop/how-lego-dot-com-accelerates-innovation-with-serverless https://www.youtube.com/watch?v=HcbnrJdNBRI Slides Video https://speakerdeck.com/danilop/the-serverless-journey-of-shop-dot-lego-dot-com https://www.youtube.com/watch?v=20KBtJOxUpw Slides Video AW S re:Invent 2019 & 2020

Slide 55

Slide 55 text

© 2021, Amazon Web Services, Inc. or its Affiliates.

Slide 56

Slide 56 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Sky Italia – Real-Time Sports Updates

Slide 57

Slide 57 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Sky Italia – Real-Time Sports Updates

Slide 58

Slide 58 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Sky Italia – Benefits of AWS ü Delivers real-time sports data updates ü Reduced costs by 30% ü Accelerated data propagation by 15x ü Achieved elasticity during times of peak and off-peak traffic ü Reduced time to market when developing new components ü Improved search engine optimization

Slide 59

Slide 59 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. How can I start being more “serverless”? Getting Started Have a look at these tools! AWS Amplify – AWS CDK – AWS SAM Serverless Framework Hashicorp Terraform

Slide 60

Slide 60 text

© 2021, Amazon Web Services, Inc. or its Affiliates. © 2021, Amazon Web Services, Inc. or its Affiliates. Photo by veeterzy on Unsplash

Slide 61

Slide 61 text

© 2021, Amazon Web Services, Inc. or its Affiliates. Thank you! Please give me your feeback J Danilo Poccia Chief Evangelist (EMEA) @danilop