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.

Serverless — it all started in Vegas

36 views

Published on

This talk is about our journey to Serverless at Trustpilot.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Serverless — it all started in Vegas

  1. 1. Serverless — it all started in Vegas Martin Buberl VP Engineering | AWS Community Hero Trustpilot
  2. 2. Martin Buberl • VP Engineering at Trustpilot • AWS Community Hero • AWS User Group Leader Copenhagen, Denmark martinbuberl.com @martinbuberl
  3. 3. • Open review platform • Startup / Raised $140M • 694 Trusties in 7 offices 130 in Product Development trustpilot.com 54M reviews 2.7B impressions / m 3,500 API transactions / s 560TB data Copenhagen Vilnius
  4. 4. Agenda • Back then ... and now • What are all those Lambda functions doing? • Some ideas to take away and start building • Fast track to Serverless – how we did it • Some ideas to take away to adopt Serverless • Looking back – any advice?
  5. 5. Las Vegas, December 2016
  6. 6. Tatonka Challenge
  7. 7. Serverless “FaaS” started to make sense λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λλ λ λ λ λ λ λ λ λ
  8. 8. Serverless “FaaS” wasn’t a total stranger back then • Couldn’t use AWS Lambda before February 2016 Requirement to run them in VPCs • Already had about 40 AWS Lambda functions in Production Mostly tooling, data pipelines and some experiments
  9. 9. “Let’s actively drive Serverless adoption.”
  10. 10. Cloud Compute with AWS 0 100 200 300 400 500 600 700 December-16 June-17 December-17 June-18 Virtual Servers, Containers and Serverless Compute Total # of Services in Production
  11. 11. Cloud Compute with AWS 0 100 200 300 400 500 600 700 December-16 June-17 December-17 June-18 Virtual Servers, Containers and Serverless Compute Amazon EC2 Amazon ECS AWS Lambda
  12. 12. Cloud Compute with AWS 0 50 100 150 200 250 300 350 December-16 June-17 December-17 June-18 Virtual Servers, Containers and Serverless Compute Amazon EC2 Amazon ECS AWS Lambda
  13. 13. Cloud Compute with AWS December 2016 180 Virtual Servers 80 Containers 40 Lambda functions November 2018 95 Virtual Servers 283 Containers 252 Lambda functions -53% +354% +630%
  14. 14. +630%
  15. 15. Trustpilot’s high-level architecture • Cloud native • Event-driven microservices • REST APIs
  16. 16. Trustpilot’s high-level architecture Web Clients & Applications Data API Management & Orchestration Pub/Sub Messaging System Compute 3rd Party Applications Amazon API Gateway REST APIs trustpilot.com Amazon SNS Amazon SQS Cloud Compute RDS NoSQL Amazon S3 Amazon CloudFront CDN b2b.trustpilot.com Amazon CloudFront CDN widgets.trustpilot.com Amazon CloudFront CDN
  17. 17. Trustpilot’s high-level architecture Web Clients & Applications Data API Management & Orchestration Pub/Sub Messaging System Compute 3rd Party Applications Amazon API Gateway REST APIs trustpilot.com Amazon SNS Amazon SQS Cloud Compute RDS NoSQL Amazon S3 Amazon CloudFront CDN b2b.trustpilot.com Amazon CloudFront CDN widgets.trustpilot.com Amazon CloudFront CDN
  18. 18. Trustpilot’s high-level architecture Web Clients & Applications Data API Management & Orchestration Pub/Sub Messaging System Compute 3rd Party Applications Amazon API Gateway REST APIs trustpilot.com Amazon SNS Amazon SQS Cloud Compute RDS NoSQL Amazon S3 Amazon CloudFront CDN b2b.trustpilot.com Amazon CloudFront CDN widgets.trustpilot.com Amazon CloudFront CDN
  19. 19. Publish/Subscribe messaging pattern Publisher Subscriber Publisher Subscriber Subscriber Topic
  20. 20. “Traditional” auto scaling on queues Queue Auto Scaling group Auto Scaling group Containers Instances Queue Message Message Amazon SQSAmazon SNS Topic Publisher Publisher
  21. 21. Instant Scaling Serverless “instant” scaling on topics Message Message Amazon SNS Topic Publisher Publisher Lambda Function Lambda Function
  22. 22. Instant Scaling Serverless “instant” scaling on queues Queue Queue Message Message Amazon SQSAmazon SNS Topic Publisher Publisher Lambda Function Lambda Function
  23. 23. What are all those Lambda functions doing? Most of our Lambda functions in Production ... • integrate with API Gateway • subscribe to topics from our pub/sub messaging system Perfect for decoupled, event-driven microservices Our next step is to ... • bring back queues for “auto-healing”
  24. 24. Git webhook to Slack pub/sub AWS Cloud Webhook Publish Subscribe Incoming Webhook(s) developer.github.com/webhooks HTTP POST api.slack.com/incoming-webhooks
  25. 25. AWS Lambda for git security audit • Ever accidently committed a secret to source control? e.g. connection strings, tokens, API keys and secrets, private certificate keys • Have a Lambda check for secrets and post to #secrets
  26. 26. AWS Lambda for git security audit - Version 2 • Send a message directly to the pull request in GitHub
  27. 27. AWS Lambda for git privacy audit • Ever accidently committed PII to source control? e.g. email addresses, usernames, social security numbers • Have a Lambda check for PII and post to #privacy • GDPR anybody?
  28. 28. AWS Lambda for naming discussions • There are only two hard problems in computer science: cache invalidation, naming things and off-by-one errors • Have a Lambda post new repositories to #naming-things
  29. 29. AWS Lambda for Trello integration • Have a Lambda automatically attach a PR to a Trello card
  30. 30. Git webhook to SNS pub/sub Subscribing AWS Lambda functions for ... • git security audit • git privacy audit • naming discussions • Trello integration
  31. 31. Engineering Principle
  32. 32. Engineering Principle
  33. 33. Golden Circle WHY Start With Why by Simon Sinek
  34. 34. Engineering Principle github.com/trustpilot/principles
  35. 35. Why should I care? Because we ... • have a vision and want to be part of the movement • acknowledge it’s not always right but start there • want to modernize our cloud compute stack • see operational benefits • anticipate cost savings
  36. 36. Engineering Principle Virtual servers are considered legacy and should be avoided.
  37. 37. Virtual Servers are considered legacy If that’s the case ... • Amazon EC2s are legacy which means also ... • .NET Framework is legacy as it’s not supported with Docker containers
  38. 38. +
  39. 39. Hackathons • Hackathons are great for Serverless not just FaaS, all fully managed cloud services • Serverless lets us ship prototypes that scale which we still probably shouldn’t ship
  40. 40. Labs
  41. 41. Trustmap Node.js Application 24h Cache
  42. 42. Event “anomaly” detection S3 Event Trigger NotificationEvent Logs Analyze Event
  43. 43. GTFO initiative
  44. 44. GTFO EC2 • Inventory of Amazon EC2s per team • Weekly check-ins with Tech Leads • Dedicated Slack channel #gtfo-ec2
  45. 45. #gtfo-ec2
  46. 46. #gtfo-ec2
  47. 47. The Cake Alert
  48. 48. AWS IoT to Slack Incoming Webhook tech.trustpilot.com/the-cake-alert-28652f13607d
  49. 49. How did we fast track Serverless? • Serverless First Engineering Principle • Hackathons and Labs • GTFO EC2
  50. 50. Are Lambda functions really cheaper?
  51. 51. !==
  52. 52. Lambda functions • Gut feel is – for us™ – they are 10x cheaper
  53. 53. Lambda functions • Gut feel is – for us™ – they are 10x cheaper • Less Ops heavy • Faster development for services at scale
  54. 54. Lambda functions • Gut feel is – for us™ – they are 10x cheaper • Less Ops heavy • Faster development for services at scale • Decrease of observability and traceability We’re investing in this area
  55. 55. Thank you! Martin Buberl @martinbuberl

×