Serverless promises to make cloud development faster, cheaper, and more reliable; however, a badly designed serverless application can mean exactly the opposite of this. Learn about the good, the bad and the ugly of serverless use cases and patterns to ensure your serverless applications are built to last.
2. Agenda
• How did we get here
• What's so good about this
• What's not so good about serverless
• When does it get really ugly
• Learnings and food for thought
5. What's so good about this
• On Demand Infrastructure
• You Pay for What What You Use
• No Undifferentiated Heavy Lifting
• The Developer Experience
6. What's Not So Good
• Time Outs
• Gets too complicated too soon
• Dependency management
• Not Everything is stateless
7. When Does It Get Really Ugly
• Lambdalith (Lambda Monolith)
• Lambda Orchestrator
• Lambda Pinball
• Invocation Loops
• Lambda calling Lambda
• Synchronous waiting
8. Lambdalith (Lambda Monolith)
What's so bad?
• Package size
• Harder to enforce least privilege
• Harder to upgrade
• Harder to maintain
• Harder to reuse code
• Harder to test
Useful Hints
9. Lambda Orchestrator
A Typical Order Workflow
1. Customer places an order
2. System notifies the restaurant
3. Restaurant accepts the order
4. System notifies the customer
5. Food is delivered to the customer
10. Lambda Pinball
1. A customer places an order
2. place-order function calls the notify-
restaurant function .
3. notify-restaurant function sends a message to the
restaurant.
4. The restaurant Accept Order, which calls
the orders API.
5. accept-order function is called, and it triggers
notify-user function
6. notify-user function sends an order confirmation
to the customer.
7. Once the food is delivered, the restaurant
completes the order. This calls the orders API.
8. complete-order function is called
Useful Hint
• Use Step Functions to orchestrate
the workflow
11. Invocation Loops
• Lambda will automatically
scale
• S3 will continue to write
• You will receive a
$BILL_SHOCK$
Useful Hints
• The service or resource that invokes a Lambda function should be different to
the service or resource that the function outputs to.
• Use a positive trigger – use metadata to trigger the lambda only on the first
S3 Put Object
• Use reserved concurrency for lambda
• Use Alarms (CloudWatch)
12. Lambda calling Lambda
• Cost – you pay for the duration
• Error handling – Complex
• Tight coupling
• Scaling – Concurrency for all
lambdas must be equal
Useful Hints
• Use SQS – Create order publishes to a queue and Process
payment consumes from the queue
• Use Step Functions to orchestrate the workflow
14. Learnings & Food for Thought
• Serverless is NOT a silver bullet
• Treat Observability as a first class citizen
• Serverless is NOT just Lambda
15. AWS Programming & Tooling Meetups
Kick off 16th February 2023
3rd Week of every month there after
AWS Credit Vouchers $$$ and more….
Things you can expect
Debugging in the cloud: When things stop working, what tools can I use to find the root cause?
“Should I stay or should I go 🎶”: The untold list of things to consider before choosing between single region vs
Multi-region
Tell me why you can't run on spot instances? Common misconceptions about the model, practical solutions and
why you might be missing out great savings!
How to protect your secrets in AWS Lambda? and what are the tradeoffs
How to test your serverless application
Build your own ngrok in AWS