Successfully reported this slideshow.
Your SlideShare is downloading. ×

aws_com_day_2022_Geethika_v1.0.pptx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 15 Ad

More Related Content

Recently uploaded (20)

Advertisement

aws_com_day_2022_Geethika_v1.0.pptx

  1. 1. Serverless Architectures The Good, The Bad & The Ugly Geethika Guruge Lead Consultant @ CMD Solutions (New Zealand)
  2. 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
  3. 3. How did we get here
  4. 4. How did we get here
  5. 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. 6. What's Not So Good • Time Outs • Gets too complicated too soon • Dependency management • Not Everything is stateless
  7. 7. When Does It Get Really Ugly • Lambdalith (Lambda Monolith) • Lambda Orchestrator • Lambda Pinball • Invocation Loops • Lambda calling Lambda • Synchronous waiting
  8. 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
  9. 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. 10. Lambda Pinball 1. A customer places an order 2. place-order function publishes an order_placed event. 3. notify-restaurant function is triggered by the order_placed event. 4. notify-restaurant function sends a message to the restaurant via SNS. 5. notify-restaurant function publishes a restaurant_notified event. 6. The restaurant receives the new order notification in its mobile app. 7. The restaurant clicks Accept Order in the app, which calls the orders API. 8. accept-order function publishes an order_accepted event. 9. notify-user function is triggered by the order_accepted event. 10. notify-user function sends an order confirmation email to the customer. 11. notify-user function publishes a user_notified event. 12. The customer sees the order confirmation and is eagerly waiting for the food to arrive. 13. The restaurant delivers the food to the customer. 14. The restaurant clicks the Complete Order in the app to confirm order has been delivered. This calls the orders API. 15. complete-order function publishes an order_completed event. Useful Hint • Use Step Functions to orchestrate the workflow
  11. 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. 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
  13. 13. Synchronous waiting • Wait times are compounded Useful Hints OR
  14. 14. Learnings & Food for Thought • Serverless is NOT a silver bullet • Treat Observability as a first class citizen • Serverless is NOT just Lambda
  15. 15. Thank You

×