Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Running a serverless ticketing platform for less than $2 a month

87 views

Published on

Talk by Srushith R, Head of Engineering at CodeOps Technologies on the topic "Running a serverless ticketing platform for less than $2 a month" at AWS Community Day, Bangalore 2018

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Running a serverless ticketing platform for less than $2 a month

  1. 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda Land: Running a Serverless Ticketing Platform for Less Than $2 a Month SRUSHITH R | 06 Oct, 2018 @SrushithR
  2. 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. “Serverless architectures refer to applications that significantly depend on third-party services (knows as Backend as a Service or "BaaS") or on custom code that's run in ephemeral containers (Function as a Service or “FaaS”)” - Martin Fowler https://martinfowler.com/articles/serverless.html
  3. 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Birth of Serverless
  4. 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Event sources Trigger other services Lambda function s Working with Lambdas
  5. 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How a Ticketing Platform Works
  6. 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ticket Purchase Flow Successful payment Generate ticket Send invoice Store participant details
  7. 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Synchronous Behind the Scene
  8. 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Generating a Ticket
  9. 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Generating Invoice – 3rd party API or PDF Generation Python Module 3rd party API E.g., invoice-generator Python module E.g., Reportlab or
  10. 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lessons Learned • 3rd party web APIs are not always reliable • Larger dependencies increase lambda warm up time • Need notifications for executions that fail due to various reasons
  11. 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Sending Invoice
  12. 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Sending Invoice – Gmail or SES or SNS Gmail Amazon SES or Amazon SNS or
  13. 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lessons Learned • Emailing looks straight-forward but it is not • Using SES has practical problems (E.g., no way to access the sent emails) • Factors to consider: cost, spamming and shared vs dedicated IP address
  14. 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Storing Participant Details
  15. 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Storing Details – DynamoDB or RDS or S3 Amazon DynamoDB Amazon RDS Amazon S3 or or
  16. 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lessons Learned Reduce d costs Sub- second response Better performance Factors to consider:
  17. 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. State Management
  18. 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. State Management – Step Function or Lambda Calling Another Lambda or AWS Step Functions AWS lambda calling another lambda
  19. 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lessons Learned • Asynchronous nature of Step functions is at times troublesome • Improved resiliency • Step functions make parallel executions, branching etc. easier • Zero coding!
  20. 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda
  21. 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Factors to Consider Time out Choice of programming language Load testing RAM configuratio n
  22. 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda Best Practices Alarms CloudWatc h logs Restrictive permissions while using IAM Environment variables
  23. 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  24. 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Icon Credits • Icon made by Freepik from www.flaticon.com • Icon made by Prosymbols from www.flaticon.com • Icon made by Geotath from www.flaticon.com • Icon made by Icon Pond from www.flaticon.com • Icon made by Smashicons from www.flaticon.com • Icon made by Smartline from www.flaticon.com • Icon made by mynamepong from www.flaticon.com • Icon made by Vectors Market from www.flaticon.com • Icon made by DinosoftLabs from www.flaticon.com • Icon made by Kiranshastry from www.flaticon.com • Icon made by Pixel Buddha from www.flaticon.com • Icon made by dimitry-miroliubov from www.flaticon.com

×