All my posts on Serverless
Tips for writing Lambda functions
- Running and debugging AWS Lambda functions locally with the Serverless framework and VS Code
- Why you should use temporary CloudFormatoin stacks when you do serverless
- How to handle serverful resources when using ephemeral environments
- This is why you should keep stateful and stateless resources together
- Hit the 6MB Lambda payload limit? Here’s what you can do.
- Write recursive AWS Lambda functions the right way
- Use
context.getRemainingTimeInMillis()
to adjust client-side request timeout based on actual invocation time left - Should you have few monolithic functions or many single-purposed functions?
- How best to manage shared code and shared infrastructure
- The best ways to save money on Lambda
- Monorepo vs one repo per service
- How to share code in a monorepo
- Amplify: how to share code without Lambda Layers or private NPM
- Lambda deployment frameworks compared
- When to use Lambda Layers
- Lambda layers: not a package manager, but a deployment optimization
- How to log timed out Lambda invocations
- How to detect and stop accidental infinite recursions
- Canary deployment for AWS Lambda
- Canary deployment with LaunchDarkly and AWS Lambda
- How to include SNS and Kinesis in your e2e tests
- Should you pack the AWS SDK in your deployment artefact?
- Are Lambda-to-Lambda calls really that bad?
- SNS to Lambda or SNS to SQS to Lambda, what are the trade-offs?
- What’s the most serverless way to wait for a slow HTTP response?
Do you wanna level up your serverless game? Then check out my hands-on workshop “Production-Ready Serverless”
Big picture questions
- Are we getting infrastructure all wrong in the Serverless era?
- Is serverless overpriced? What can we learn from the PrimeVideo team?
- Debating the Benefits of AWS Spending Restrictions
- You are wrong about serverless and vendor lock-in
- You are thinking about serverless costs all wrong
- Serverless vs Containers
- Why your business needs Serverless
- “Even simple serverless applications have complex architecture diagrams”, so what?
- Save money on Serverless: common costly mistakes and how to avoid them
- How to perform database migration for a live service with no downtime
Testing
- My testing strategy for serverless applications
- A practical guide to testing AWS Step Functions
- Testing Step Functions: how to skip time when testing Timeout and Wait states
- Does Step Function’s new TestState API make end-to-end tests obsolete?
- No, you don’t need to test every line of your CDK application
If you want to learn more about testing serverless architectures, including how to test API Gateway, AppSync, Step Functions and Event-Driven Architectures, then you should check out my new course “Testing Serverless Architectures”.
Serverless Observability
- You need to use structured logging with AWS Lambda
- You should sample debug logs in production
- Centralised logging for AWS Lambda
- Centralised logging for AWS Lambda, REVISED (2018)
- Tips and tricks for logging and monitoring AWS Lambda functions
- Capture and forward correlation IDs through different event sources
- You should use the SSM Parameter Store over Lambda env variables
- Mind the 75GB limit AWS Lambda deployment packages
- The good and bad of X-Ray and Lambda
- Serverless observability: Lumigo or AWS X-Ray
- Serverless observability brings new challenges to current practices
- Serverless observability, what can we use out of the box?
- How to auto-create CloudWatch alarms for API Gateway, using Lambda
- How to monitor Lambda with CloudWatch Metrics
- Getting the most out of CloudWatch Logs
- Introducing an easier way to record custom metrics from Lambda
- How to debug Lambda performance issues
- Debugging AWS Lambda timeouts
- What alerts should you have for Serverless applications?
- How to debug slow Lambda response time
- Serverless Observability: it’s easier than you think
- Shine some light on your SNS to SQS to Lambda stack
- Lambda Logs API: a new way to process Lambda logs in real-time
- AWS Lambda Telemetry API: a new way to process Lambda telemetry data in real-time
Patterns
- How to create Private DynamoDB tables accessible only within a VPC
- How to set DeletionPolicy to Retain for production only
- Static IP for Lambda: ingress, egress and bypassing the dreaded NAT Gateway
- Applying the pub-sub and push-pull messaging patterns with AWS Lambda
- How to use the Decoupled Invocation pattern with AWS Lambda
- Create IP-protected endpoints with API Gateway and Lambda
- DynamoDB TTL as an ad-hoc scheduling mechanism
- Using CloudWatch and Lambda to implement ad-hoc scheduling
- Scheduling ad-hoc tasks with Step Functions
- A simple event-sourcing example with snapshots using Lambda and DynamoDB
- What’s the best event source for doing pub-sub with Lambda
- AWS Lambda — use the invocation context to better handle slow HTTP responses
- How to Securely let Frontend Apps to Directly Access AWS services
AppSync
- How to model one-to-many relationships with AppSync and DynamoDB
- How I built a social network in 4 weeks with GraphQL and serverless
- Five reasons you should consider AppSync over API Gateway
- AppSync: skipping nullable nested resolvers by returning early
- AppSync: how to error on DynamoDB conditional check failures
- AppSync: how to compare strings lexicographically in VTL
- AppSync: how to inject table names into DynamoDB batch & transact operations
- How I scaled an AppSync project to 200+ resolvers
- How to secure multi-tenant applications with AppSync and Cognito
- How to model hierarchical access with AppSync
- How to set up custom domain names for AppSync
- How to sample AppSync resolver logs
- How to monitor and debug AppSync APIs
- How to handle client errors gracefully with AppSync and Lambda
- Group-based auth with AppSync custom authoriser
If you want to learn AppSync by getting your hands dirty and building a full-stack Twitter clone, then check out my course “The AppSync Masterclass”.
API Gateway
- Checklist for going live with API Gateway and Lambda
- The why, when and how of API Gateway service proxies
- Using Protocol Buffers with API Gateway and AWS Lambda
- How to choose the right API Gateway auth method
- How to auto-create CloudWatch alarms for API Gateway, using Lambda
- The API Gateway security flaw you need to pay attention to
Step Functions
- Does Step Function’s new TestState API make end-to-end tests obsolete?
- Combine Standard and Express workflows for fun & profit
- Choreography vs Orchestration in the land of serverless
- A practical guide to testing AWS Step Functions
- Testing Step Functions: how to skip time when testing Timeout and Wait states
- Step Functions: apply try-catch to a block of states
- Step Functions: how to implement semaphores for state machines
- How the Saga pattern manages failures with AWS Lambda and Step Functions
- How to do blue-green deployment for Step Functions
EventBridge
- The biggest problem with EventBridge Scheduler and how to fix it
- 5 reasons why you should EventBridge instead of SNS
Performance & Cold Start
- 3 ways to manage concurrency in serverless applications
- Just how expensive is the full AWS SDK?
- Improve latency by enabling HTTP keep-alive
- How long does AWS Lambda keep your idle functions around before a cold start?
- How does language, memory and package size affect cold starts of AWS Lambda?
- Comparing AWS Lambda performance when using Node.js, Java, C# or Python
- All you need to know about caching for serverless applications
- How to: optimize Lambda memory size during CI/CD pipeline
- This is all you need to know about Lambda cold starts
- AWS Lambda — use the invocation context to better handle slow HTTP responses
- I’m afraid you’re thinking about AWS Lambda cold starts all wrong
- AWS Lambda cold starts are about to get faster
Security
- The Old Faithful: Why SSM Parameter Store still reigns over Secrets Manager
- Passwordless Authentication made easy with Cognito: a step-by-step guide
- Implementing Magic Links with Amazon Cognito: A Step-by-Step Guide
- Yes, S3 now encrypts objects by default, but your job is not done yet
- How to set up geofencing and IP allow-list for Cognito User Pool
- How to choose the right API Gateway auth method
- Many-faced threats to Serverless security
- AWS Lambda and Secret management
- To VPC or not to VPC? Pros and cons in AWS Lambda
- The API Gateway security flaw you need to pay attention to
- How building a custom IAM system has made me appreciate AWS IAM even more
- The case for and against Amazon Cognito
Kinesis
- A self-healing Kinesis function that adapts its throughput based on performance
- The one mistake everyone makes when using Kinesis with Lambda
- 3 Pro Tips for Developers using AWS Lambda with Kinesis Streams
- Auto-scaling Kinesis streams with AWS Lambda
- AWS Lambda — how to use SNS to retry failed Kinesis events
- Lambda and Kinesis — beware of hot streams
- How to connect SNS to Kinesis for cross-account delivery via API Gateway
- The best reason to use DynamoDB Streams is…
Serverless framework
- Serverless v4 will start charging users, but that’s a good thing
- Top 10 Serverless best practices
- Introducing… CloudFormation extrinsic functions
- CloudFormation protip: use !Sub instead of !Join
- How to include Serverless Repository apps in serverless.yml
- Making Terraform and the Serverless framework work together
- How to make serverless framework boilerplates customizable
- Where Serverless plugin stops and platform starts
CDK
Chaos Engineering
- How can we apply principles of chaos engineering to AWS Lambda?
- Applying the principles of chaos engineering to AWS Lambda with latency injection
Serverless Application Repositories
- A serverless application to clean up old deployment packages
- Serverless apps to automate the chores around CloudWatch Logs
- Serverless apps to speed up all your Lambda functions
Yubl’s road to Serverless
- part 1 : overview
- part 2 : testing & continuous delivery strategies
- part 3 : ops
- part 4 : building a scalable push notification system
- part 5 : building a better recommendation system
Misc
- How I built an affiliate tracking system in a weekend with serverless
- What is AWS Lambda’s new Streaming Response
- Lessons learnt from running serverless in production for 5 years
- How to load test a real-time multiplayer mobile game with AWS Lambda and Akka
- AWS Lambda — build yourself a URL shortener in 2 hours
- Comparing Nuclio and AWS Lambda
- AWS SAM + Cloudformation macros, a patch made in heaven
- Using the power of CloudFormation custom resources for great good
- Provisioned Concurrency — the end of cold starts
- 24 open source tools for the serverless developer: part 1
- 24 open source tools for the serverless developer: part 2
- HTTP API goes GA!
- Unlocking new Serverless use cases with EFS and Lambda
- Lambda extensions: what they are and why they matter
- Lambda extensions just got even better
- AWS Lambda: Function URL is live!
- 7 tools to help you become a better serverless developer
- Welcome to 10GB of tmp storage with Lambda
- Graviton-based Lambda functions, what it means for you
- Package your Lambda function as a container image
- How to work around CloudFormation circular dependencies
- How to manage Route53 hosted zones in a multi-account environment
- How I built an affiliate tracking system in a weekend with serverless
- How I implemented web analytics reporting with Timestream
Hi, my name is Yan Cui. I’m an AWS Serverless Hero and independent consultant.
Are you struggling with serverless or need guidance on best practices? Do you want someone to review your architecture and help you avoid costly mistakes down the line? Don’t worry, I’m here to help. Let’s talk!