Slide 1

Slide 1 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless at re:Invent 2019 Marek Kuczynski Serverless Specialist Solutions Architect for EMEA Amazon Web Services @marekq

Slide 2

Slide 2 text

Serverless at re:Invent

Slide 3

Slide 3 text

Serverless architectures SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state EVENT SOURCE FUNCTION Node.js Python Java C# Go Ruby PowerShell Bring your own runtime

Slide 4

Slide 4 text

(A)synchronous invocations and stream processing Synchronous (push) Asynchronous (event) Stream (poll-based) Amazon DynamoDB Amazon SNS /order Amazon S3 reqs Amazon Kinesis Data Streams changes AWS Lambda service function Amazon API Gateway Lambda function Lambda function

Slide 5

Slide 5 text

Where we added new functionality • Performance improvements and reducing latency You can serve your requests faster, cheaper and with lower latencies • Reducing the cost of your workload You can choose alternatives for serving API’s and orchestrating functions • Easier processing of messages between functions You have to maintain less code and “glue” logic between your functions • Richer capabilities to monitor, debug and trace your workload You can debug problems faster and optimize for performance more effectively

Slide 6

Slide 6 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 7

Slide 7 text

Provisioned Concurrency for AWS Lambda INTRODUCING Provisioned Concurrency keeps functions initialized and hyper-ready to respond in double-digit milliseconds. Customers fully control when or how long to enable Provisioned Concurrency. Taking advantage of Provisioned Concurrency requires no changes to your code.. Ideal for latency-sensitive applications

Slide 8

Slide 8 text

Bootstrap the runtime Start your code Lambda: The execution lifecycle Cold start Warm start Download your code Start new container Time

Slide 9

Slide 9 text

• Greater control over the start up time of your Lambda functions. • Functions stay initialized and hyper- ready to respond in double-digit milliseconds. • No code changes necessary • Ideal for interactive applications such as web or mobile backends AWS Lambda Provisioned Concurrency • Customers are building: • Applications that have strict latency SLAs • Applications that support high-velocity traffic bursts

Slide 10

Slide 10 text

Provisioning concurrency • Provisioning scheduled in advance • Schedule in advance to allow for scale-up • Provision in increments of 5 minutes • Invocations above the provisioned concurrency are handled by on-demand Lambda 0 500 1000 1500 2000 2500 0 500 1000 1500 2000 2500 8:00 8:10 8:20 8:30 8:40 8:50 9:00 9:10 9:20 9:30 9:40 9:50 10:00 10:10 10:20 10:30 10:40 10:50 11:00 11:10 11:20 11:30 11:40 11:50 12:00 Traffic (TPS) Provisioned concurrency

Slide 11

Slide 11 text

Concurrency and latency 0 500 1000 1500 2000 2500 0 500 1000 1500 2000 2500 8:00 8:10 8:20 8:30 8:40 8:50 9:00 9:10 9:20 9:30 9:40 9:50 10:00 10:10 10:20 10:30 10:40 10:50 11:00 11:10 11:20 11:30 11:40 11:50 12:00 Traffic (TPS) Provisioned concurrency 0 500 1000 1500 2000 2500 8:00 8:10 8:20 8:30 8:40 8:50 9:00 9:10 9:20 9:30 9:40 9:50 10:00 10:10 10:20 10:30 10:40 10:50 11:00 11:10 11:20 11:30 11:40 11:50 12:00 p100 latency p100 latency P100 latency spike for a regular cold start when we exceeded the provisioned concurrency This behavior is configurable using Per Function Concurrency throttling

Slide 12

Slide 12 text

Applications that: • Serve content such as ads during a live stream • Mobile applications such as games • Marketing blitzes or flash sales Lambda will: • Provisioning scheduled in advance • Schedule in advance to allow for scale-up • Provision in increments of 5 minutes • Invocations above the provisioned concurrency are handled by on-demand Lambda Use Cases: High-velocity traffic bursts

Slide 13

Slide 13 text

Lambda runtime updates • Node.js 12 • Updated V8 engine • Public/Private class fields • Java 11 • HTTP client (standard) • The var keyword • Python 3.8 • Assignment expressions • Positional-only arguments * Python 2.7 has critical patch support from AWS until end of 2020. We encourage to move to Python 3.x as soon as possible; https://aws.amazon.com/blogs/compute/continued-support-for-python-2-7- on-aws-lambda/

Slide 14

Slide 14 text

Cold start times of Lambda decreased Source; https://levelup.gitconnected.com/aws-lambda-cold-start-language-comparisons-2019-edition

Slide 15

Slide 15 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 16

Slide 16 text

HTTP APIs for Amazon API Gateway PREVIEW Achieve up to 70% cost reduction and 50% latency reduction compared to REST APIs. HTTP APIs are also easier to configure than REST APIs, allowing you to focus more time on building applications. Reduce application costs by up to 70%

Slide 17

Slide 17 text

HTTP APIs for Amazon API Gateway • JWT Authorizers - supports native OpenID Connect (OIDC) authorization. You can configure API Gateway to parse incoming JWT tokens, and allow or deny requests based on the OAuth scopes in the token. • Default Stages and Routes - make it easier to work with APIs. When you assign a default stage, you are able to serve your API from the base URL. This means you no longer need an explicit stage in your API. https://{api_id}.execute-api.{region}.amazonaws.com/ • Fully customizable CORS experience.

Slide 18

Slide 18 text

Choosing Between HTTP APIs and REST APIs Authorizers HTTP API REST API AWS Lambda ✓ IAM ✓ Amazon Cognito ✓ * ✓ Native OpenID Connect / OAuth 2.0 ✓ Integration HTTP API REST API HTTP proxy ✓ ✓ Lambda proxy ✓ ✓ HTTP ✓ AWS services ✓ Private integration ✓ Mock ✓ * You can use Amazon Cognito as a JWT issuer.

Slide 19

Slide 19 text

Choosing Between HTTP APIs and REST APIs (cont'd) API Management HTTP API REST API Usage plans ✓ API keys ✓ Security HTTP API REST API Client certificates ✓ AWS WAF ✓ Resource policies ✓ API Type HTTP API REST API Regional ✓ ✓ Edge-optimized ✓ Private ✓

Slide 20

Slide 20 text

Choosing Between HTTP APIs and REST APIs (cont'd) Development HTTP API REST API Cache ✓ Request transformation ✓ Request / response validation ✓ Test invocation ✓ CORS configuration ✓ Automatic deployments ✓ Default stage ✓ Default route ✓ AWS Service Integrations HTTP API REST API AWS X-Ray ✓

Slide 21

Slide 21 text

AWS Step Functions Express Workflows INTRODUCING Orchestrate AWS compute, database, and messaging services at rates up to 100,000 events per second, suitable for high-volume event processing workloads such as IoT data ingestion, microservices orchestration, and streaming data processing and transformation. Faster: greater than 100K state transitions per second

Slide 22

Slide 22 text

Which one is right for my customer’s use case? Standard Workflows • IT automation • report generation • order processing • payment and billing processing • machine learning model training • ELT and big data orchestration (AWS Glue, Amazon EMR) • media processing (video, images, audio) Express Workflows • event driven microservices orchestration • high volume data processing • IoT data ingestion • order / cart validation • payment reconciliation

Slide 23

Slide 23 text

Which one is right for my customer’s use case? (cont'd) • Sometimes the answer will be both • Express Workflows can be nested within a Standard Workflow, enabling customers to use Express Workflows for short periods of task execution and a Standard Workflow for long periods of task execution or waiting Start End Validate Image Rekognition Thumbnail Add tags Store Metadata Approval notification Approval received

Slide 24

Slide 24 text

Standard vs. Express Workflows Standard Express Console Step Functions Step Functions State Machine Definition Amazon States Language Amazon States Language Documentation Step Functions Step Functions

Slide 25

Slide 25 text

Standard vs. Express Workflows (cont'd) Standard Express Maximum duration 365 days 5 minutes Start execution refill rate 300 per second 6,000 per second State transition refill rate 1300 per second None Execution semantics Exactly-once workflows step execution At-least-once workflow step execution

Slide 26

Slide 26 text

Standard vs. Express Workflows (cont'd) Standard Express Executions Executions are persisted and have ARNs Executions are not persisted except as log data Execution history Stored in Step Function, with tooling for visual debugging in the console Sent to CloudWatch Logs State transition default limits 1300 per second There is no limit Service Integrations Supports all service integrations and activities. Supports all service integrations. Does not support activities. Patterns Supports all patterns Does not support Job-run (.sync) or Callback (.wait For Callback).

Slide 27

Slide 27 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 28

Slide 28 text

Lambda Async DLQ Configuration

Slide 29

Slide 29 text

Dead-letter Queues for Amazon SNS INTRODUCING

Slide 30

Slide 30 text

SQS FIFO support for Lambda

Slide 31

Slide 31 text

AWS Lambda Destinations Designate an asynchronous target for Lambda function invocation results. You can set one destination for a success, and another for a failure. This unlocks really useful patterns for distributed event-based applications and can reduce code to send function results to a destination manually.

Slide 32

Slide 32 text

Amazon EventBridge Event source SaaS event bus Custom event bus Default event bus Rules AWS Lambda Amazon Kinesis AWS Step Functions Additional targets

Slide 33

Slide 33 text

Amazon EventBridge Schema Registry PREVIEW Store event structure - or schema - in a shared central location, so it’s faster and easier to find the events you need. Generate code bindings right in your IDE to represent an event as an object in code.

Slide 34

Slide 34 text

Amazon EventBridge Schemas (Preview) • Write event-driven code with the same ease as defining APIs • Central schema registry • Discover new schemas automatically once published to your event bus. • Search for schemas directly from VS Code and IntelliJ. • Strongly typed bindings allow you to treat events as objects. Library: v1.0.6 Code of components is the truth Wireframes are not redlines unless specifically stated feedback: [email protected] Search all schemas 5 versions AWS-EC2-EBSVolumeNotification AWS event schema Last updated 13:15 PST Jun 23, 2019 [#] versions [Schema name - link to the latest version] [Schema registry] Last updated 00:00 [time zone] [date] [#] versions [Schema name - link to the latest version] [Schema registry] Last updated 00:00 [time zone] [date] [#] versions [Schema name - link to the latest version] [Schema registry] Last updated 00:00 [time zone] [date] [#] versions [Schema name - link to the latest version] [Schema registry] Last updated 00:00 [time zone] [date] [#] versions [Schema name - link to the latest version] [Schema registry] Last updated 00:00 [time zone] [date] [#] versions [Schema name - link to the latest version] [Schema registry] Last updated 00:00 [time zone] [date] 45 versions AWS-CodeBuild-BuildStateChange Discovered schema Last updated 13:15 PST Jun 23, 2019 version 1 Am-on-call-update-notification Custom schema Last updated 13:15 PST Jun 23, 2019 1 2 All schemas AWS event schema registry Info Discovered schema registry Info my-org-custom-schema- registry Schemas Event discoery Event discoery EventBridge EventBridge Schemas [A schema is … Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur. A schema registry is… Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat.] Create custom schema Create custom registry Select all schemas or a registry Documentation Event buses Events Rules Partner event sources Schemas Schema discovery Dashboard EventBridge Feedback Feedback English English © 2008 - 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2008 - 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved. Privacy Policy Privacy Policy Terms of Use Terms of Use Schemas Library: v1.0.6 Code of components is the truth Wireframes are not redlines unless specifically stated feedback: [email protected] [schema-name… … … ……] Edit description Delete schema (all versions) Schema details Lorem ipsum dolor sit amdhet sed, consectetur adipiscing elit. Mauris a nisl cursus, imperdiet. Description [schema-name… … … … … … .. .] Schema name 3 Number of Versions [Event type … … … …] Event type arn:schemas:48569308563781:schema/events/ticketstatuschangecall Schema ARN 10:27 PST, Sep 27, 2019 Last modified on [custom registry] Schema registry Created on 10:27 PST, Sep 27, 2019 "properties": { "source": { "$id": "#/properties/source", "type": "array", "title": "The Source Schema", "items": { "$id": "#/properties/source/items", "type": "string", "title": "The Items Schema", "default": "", "examples": [ "aws.events”z24], "pattern": "^(.*)$" } }, "detail-type": {…}, "detail": {…}, } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Action Delete schema version 3 Download schema (version 3) Save as new version Download code binding Version 3 Manage tags Tags (2) Value Key [value] [key-value] [value] [key-value] [Schema name] [Schema registry] [Schema registry] Schemas Schemas Event discovery Event discovery EventBridge EventBridge version 3 Documentation Event buses Events Rules Partner event sources Schemas Schema discovery Dashboard EventBridge Schemas Feedback Feedback English English © 2008 - 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2008 - 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved. Privacy Policy Privacy Policy Terms of Use Terms of Use Schemas All schemas (69) aws.events schema registry (33) Discovered schema registry(24) aws.s3 (3) Recently used schemas (9) Schema template My custom schema registry-1 (12) aws.s3.aws_api_call_via_cl aws.s3.ec2_instance-launc aws.s3.ec2_instance-termi aws.sns (22) aws.ec2 (8)

Slide 35

Slide 35 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 36

Slide 36 text

DynamoDB Contributor Insights

Slide 37

Slide 37 text

End to end visibility of latency and requests

Slide 38

Slide 38 text

CloudWatch Embedded Metrics Format • Embed custom metrics alongside detailed log event data, and CloudWatch will automatically extract the custom metrics so you can visualize and alarm on them, for real-time incident detection • Open-source client libraries available for Node.js and Python

Slide 39

Slide 39 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 40

Slide 40 text

A simpler deployment experience with AWS SAM CLI INTRODUCING

Slide 41

Slide 41 text

Amazon RDS Proxy PREVIEW Fully managed, highly available database proxy feature for Amazon RDS. Pools and shares DB connections to make applications more scalable, more resilient to database failures, and more secure. Pool and share app scaling availability DB failover times data security access controls Fully managed compatible

Slide 42

Slide 42 text

Amazon RDS Proxy – How it Works

Slide 43

Slide 43 text

Amazon Managed Apache Cassandra Service (preview)

Slide 44

Slide 44 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 45

Slide 45 text

Helpful links to learn more about serverless AWS Compute blog https://aws.amazon.com/blogs/compute/ AWS Mobile blog https://aws.amazon.com/blogs/mobile/ More information about serverless features released at re:Invent https://aws.amazon.com/blogs/compute/icymi-serverless-reinvent- recap-2019/

Slide 46

Slide 46 text

Other re:Cap events https://aws-reinvent-recap-community-world-tour-nl.splashthat.com/

Slide 47

Slide 47 text

ServerlessDays conference on 8th May 2020

Slide 48

Slide 48 text

Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Marek Kuczynski @marekq