customers: 70% of AWS, 60% of Google, and 49% of Azure use one or more serverless solutions. • Growth Rate is stepping up YoY • Infrastructure-as-Code is widely adopted by companies of any size. Source: Datadog State of serverless 2023 Source: Datadog state of Serverless 2023
most adopted, followed by Python. • Java is still significant for enterprise workloads or when a complete rewrite is impossible. • .NET is on the rise as developers start to embrace AWS. • Go and Rust are stable and growing as soon as their developer base increases. Source: Datadog state of Serverless 2023
no way to build a Node Lambda running in less than 200ms.” • “Serverless means AWS Lambda functions.” • “Serverless creates vendor lock-in.” • “Just bring your workload to serverless; it will be faster and cheaper.” • “AWS Lambda cold starts cannot be improved.” • “AWS Lambda supports only old runtime releases.”
code into one single bundle • Prefer tsx over ts-node • Prefer ESM module type • npm i -D esbuild to compile without Docker • Set esbuild optimizations Lambda under the hood https://www.cloudday.it/e/sessione/3270/Lambda- under-the-hood Fast Lambda Github Repo https://github.com/aletheia/fast-lambda
productivity while embedding best practices. • Available in Python and Typescript. • Supported in CDK and SAM. • It can be used as middy middleware, Typescript decorator, or manually configuring dependency. Lambda Powertools (Typescript) https://docs.powertools.aws.dev/lambda/typescript/ latest/ Lambda Powertools (Python) https://docs.powertools.aws.dev/lambda/python/ latest/
the top of the middleware chain, followed by the Logger and any other middleware. • Instantiate logger and tracer outside lambda handler to improve lambda cold start. • Use makeHandlerIdempotent with a persistence store (such as DDB) to ensure idempotency. Powertools for AWS Lambda (MiddyJS) https://middy.js.org/docs/integrations/lambda- powertools
• Private API and Regional API to be available within a VPC and deployed to a specific AWS Region. • Swagger Schema validation. Integrations • Private integration: integrate with a resource not accessible to the public internet through VPC Link • AWS Service Integration
• JWT is a RFC 7519 standard (https://jwt.io/). • Amazon Cognito as JWT issuer (UserPool as IdP, IdentityPools handlers external IdPs) • Use aws-jwt-verify to verify JWTs signed by Amazon Cognito and any OIDC- compatible IDP • Supported either by CDK or SAM AWS JWT Verify https://github.com/awslabs/aws-jwt-verify JWT AUD Explaination https://stackoverflow.com/a/41237822
scale to manage complex applications because roles tend to pile. • Decoupling access control from business logic is a best practice. • Amazon Verified Permissions (AVP) is a serverless managed solution to implement Attribute Based Access Control (ABAC). • Cedar is the policy definition language. • Fine-grained and attribute-based policies • Create and manage stores, schemas, and permissions with avp-cli. AVP CLI https://www.npmjs.com/package/avp-cli Authorization and Amazon Verified Permissions: A New Way to Manage Permissions https://dev.to/aws-builders/authorization-and-cedar-a- new-way-to-manage-permissions-part-i-1nid
from Lambda functions. • Prefer more straightforward functions with an external orchestrating state machine. • AWS Step Function is a managed serverless state machine. • Can be defined using either domain ASL or CDK constructs.
services with AWS SDK integration. • Standard or Express workflows. • Visual builder with Workflow Studio to craft SF visually. • It can be used from Python / Jupyter Notebooks with AWS Step Functions Data Science SDK. The AWS Step Functions Workshop https://catalog.workshops.aws/stepfunctions/en-US
and update with GraphQL mutations. • Pack multiple responses into one single client-tailored payload. • Resolvers to HTTP, AWS Lambda, Amazon Aurora, Amazon DynamoDB, and Amazon OpenSearch Service. • JS resolvers to resources (with limitations). • Producers publish data to AppSync. • Clients subscribe to channels to receive updates.
• Events can be validated against JSON schema. • Message filtering using rules provides routing. • Supports multi-account routing. • Every AWS service has an EventBridge bus (default). • Custom EventBridge buses can be created. • Integrates with 20+ AWS services. Visuals courtesy of David Boyne (@boyney123)
the need-to-know specialist knowledge of connecting these services. • A Pipe consists of two main parts, the Source and the Target. • Supports event filtering and enriching before sending to the target destination. Visuals courtesy of David Boyne (@boyney123)
• Routes events to external APIs using HTTP • Use input transforms to transform events before sending to API • Define a “connection”, an object specifying authorization type and parameters to authorize with external API. • Invocation rates can be configured to buffer messages and implement fan-out patterns Visuals courtesy of David Boyne (@boyney123)
cache (providing single- digit millisecond response). • ElastiCache (with Redis) but it is not truly serverless. • Momento Cache is a fast and easy- to-use cache with SDK. Momento Cache Chart credits to Momento (gomomento.com)
code. • Infrastructure is inferred from API calls and information flow configuration. • Framework maintains feature parity with cloud vendors. this code translates into
calls. • Ampt SDK exposes abstractions for storage, tasks, APIs, parameters, and web sockets. • Supports frameworks such as Express, NextJS, Nuxt, NestJS, React, Angular, Astro, SvelteKit, etc. • Offer support to frontend deployment with no configuration.
• events are used to trigger and communicate between services. • eventual consistency. • thin or fat events? • CQRS with Event Sourcing and EDA patterns. Martin Fowler on EDA https://www.youtube.com/watch? v=STKCRSUsyP0&t=1s Introduction to Event-Driven Archtiectures https://serverlessland.com/event-driven-architecture Visuals courtesy of David Boyne (@boyney123)