SlideShare uma empresa Scribd logo
1 de 46
Boston.rb
April 11, 2017
____________________________________________________
© 2017 ezCater, Inc. 1
Welcome to ezCater!
++
+
Welcome to ezCater!
++
+
engineering.ezcater.com
Who am I?
http://twitter.com/jdwyahJeff Dwyer
Who am I?
Who am I?
Who am I?
Who am I?
TONIGHT
• Why do I think RateLimits are amazing?
• The RateLim.it Architecture
• DIY Heroku with Amazon ECS & Terraform
• Big Data for Cheap: AWS Athena
RateLimits!
RateLimits!
RateLim.it Architecture
RateLim.it Architecture
RateLim.it Architecture
RateLim.it Architecture
RateLim.it Architecture
RateLim.it Architecture
Amazon EC2 Container Service (ECS)
Amazon EC2 Container Service (ECS)
RateLim.it Architecture
RateLim.it Architecture
RateLim.it Architecture
RateLim.it Architecture
RateLimits!
DIY Heroku with Amazon ECS & Terraform
So how do I actually deploy?
1) Build a Docker Image and push it to your docker repository
1) docker tag whatsize_ecr:36ba45
2) Create a new ECS “Task” that points to 36ba45
3) Tell the ECS Service to start running 36ba45 instead.
4) Sit back and watch the Magic!
Why ECS?
• Frankly it’s easier than the alternatives
• Runs anything that you can Docker
• Blue/Green Deployments out of the box
• Decent UI
• Deep understanding of autoscaling
• Very cost efficient. Bin Packing.
How do I start ECS?
API Usage Logging
API Usage Logging
API Usage Logging
AWS Athena
Wrap?
– ECS is awesome!! You may really like it.
– https://github.com/jdwyah/rails-docker-ecs-datadog-traceview-terraform
– Need RateLimits or featureflags? Try https://www.ratelim.it
• Ruby Library https://github.com/jdwyah/ratelimit-ruby
• Java library https://github.com/jdwyah/ratelimit-java
– Subscribe to http://engineering.ezcater.com
– https://twitter.com/jdwyah
– Questions?

Mais conteúdo relacionado

Mais procurados

The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...
The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...
The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...TotalCloud Inc.
 
Working with Azure Cosmos DB in Azure Functions
Working with Azure Cosmos DB in Azure FunctionsWorking with Azure Cosmos DB in Azure Functions
Working with Azure Cosmos DB in Azure FunctionsWill Velida
 
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and ReactSend Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and ReactTaras Lyapun
 
Moving your share point development to azure
Moving your share point development to azureMoving your share point development to azure
Moving your share point development to azureMalin De Silva
 
Free Your On-Premises Data
Free Your On-Premises DataFree Your On-Premises Data
Free Your On-Premises DataSam Basu
 
Lap around ASP.NET 5 - Dayton UG
Lap around ASP.NET 5 - Dayton UGLap around ASP.NET 5 - Dayton UG
Lap around ASP.NET 5 - Dayton UGSam Basu
 

Mais procurados (8)

Keyracer
KeyracerKeyracer
Keyracer
 
Amplify console
Amplify consoleAmplify console
Amplify console
 
The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...
The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...
The ultimate dilemma of choosing container environment on AWS: ECS, EKS or Fa...
 
Working with Azure Cosmos DB in Azure Functions
Working with Azure Cosmos DB in Azure FunctionsWorking with Azure Cosmos DB in Azure Functions
Working with Azure Cosmos DB in Azure Functions
 
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and ReactSend Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
 
Moving your share point development to azure
Moving your share point development to azureMoving your share point development to azure
Moving your share point development to azure
 
Free Your On-Premises Data
Free Your On-Premises DataFree Your On-Premises Data
Free Your On-Premises Data
 
Lap around ASP.NET 5 - Dayton UG
Lap around ASP.NET 5 - Dayton UGLap around ASP.NET 5 - Dayton UG
Lap around ASP.NET 5 - Dayton UG
 

Semelhante a DIY Heroku using Amazon ECS and Terraform

Managing Container Images with Amazon ECR - AWS Online Tech Talks
Managing Container Images with Amazon ECR - AWS Online Tech TalksManaging Container Images with Amazon ECR - AWS Online Tech Talks
Managing Container Images with Amazon ECR - AWS Online Tech TalksAmazon Web Services
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersAmazon Web Services
 
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018Amazon Web Services
 
ARC201_Scaling Up to Your First 10 Million Users
ARC201_Scaling Up to Your First 10 Million UsersARC201_Scaling Up to Your First 10 Million Users
ARC201_Scaling Up to Your First 10 Million UsersAmazon Web Services
 
Design, Build, and Modernize Your Web Applications with AWS
 Design, Build, and Modernize Your Web Applications with AWS Design, Build, and Modernize Your Web Applications with AWS
Design, Build, and Modernize Your Web Applications with AWSDonnie Prakoso
 
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017Amazon Web Services
 
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...Amazon Web Services
 
Live Content: Finding new ways to publish
Live Content: Finding new ways to publishLive Content: Finding new ways to publish
Live Content: Finding new ways to publishckimrie
 
Innovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudInnovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudAdrian Hornsby
 
Kubernetes for Docker Users
Kubernetes for Docker UsersKubernetes for Docker Users
Kubernetes for Docker UsersWilliam Jimenez
 
21st Century Analytics with Zopa
21st Century Analytics with Zopa21st Century Analytics with Zopa
21st Century Analytics with ZopaAmazon Web Services
 
Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...
Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...
Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...Amazon Web Services
 
Zestimate Lambda Architecture
Zestimate Lambda ArchitectureZestimate Lambda Architecture
Zestimate Lambda ArchitectureSteven Hoelscher
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSAmazon Web Services
 
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Amazon Web Services
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community EngineCommunity Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community enginemathraq
 

Semelhante a DIY Heroku using Amazon ECS and Terraform (20)

ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
 
Managing Container Images with Amazon ECR - AWS Online Tech Talks
Managing Container Images with Amazon ECR - AWS Online Tech TalksManaging Container Images with Amazon ECR - AWS Online Tech Talks
Managing Container Images with Amazon ECR - AWS Online Tech Talks
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
 
ARC201_Scaling Up to Your First 10 Million Users
ARC201_Scaling Up to Your First 10 Million UsersARC201_Scaling Up to Your First 10 Million Users
ARC201_Scaling Up to Your First 10 Million Users
 
Design, Build, and Modernize Your Web Applications with AWS
 Design, Build, and Modernize Your Web Applications with AWS Design, Build, and Modernize Your Web Applications with AWS
Design, Build, and Modernize Your Web Applications with AWS
 
AWS Cloud Technology And Future of Faster Modern Architecture
AWS Cloud Technology And Future of Faster Modern ArchitectureAWS Cloud Technology And Future of Faster Modern Architecture
AWS Cloud Technology And Future of Faster Modern Architecture
 
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
 
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
 
Live Content: Finding new ways to publish
Live Content: Finding new ways to publishLive Content: Finding new ways to publish
Live Content: Finding new ways to publish
 
Innovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudInnovations fueled by IoT and the Cloud
Innovations fueled by IoT and the Cloud
 
Kubernetes for Docker Users
Kubernetes for Docker UsersKubernetes for Docker Users
Kubernetes for Docker Users
 
21st Century Analytics with Zopa
21st Century Analytics with Zopa21st Century Analytics with Zopa
21st Century Analytics with Zopa
 
Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...
Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...
Designing Well-Architected Microsoft Workloads in AWS (WIN333) - AWS re:Inven...
 
Zestimate Lambda Architecture
Zestimate Lambda ArchitectureZestimate Lambda Architecture
Zestimate Lambda Architecture
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKS
 
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
 
STG401_This Is My Architecture
STG401_This Is My ArchitectureSTG401_This Is My Architecture
STG401_This Is My Architecture
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

DIY Heroku using Amazon ECS and Terraform

Notas do Editor

  1. Welcome to ezCater. Since we’re giving you pizza I get to pitch you on workign here! Do you like: Tacos, Ruby, Graphs that go up and to the right & 100% Nice People?
  2. Then you’ll love working at ezCater! Check us out https://www.ezcater.com/company/careers/ Seriously though, great things are happening here and we are growing > 2x year over year. It’s fun.
  3. Check out our new engineering blog https://engineering.ezcater.com/ab-testing-at-ezcater-part-2-tracking-experiments-the-exposure-event
  4. So who am I? Jeff Dwyer http://twitter.com/jdwyah Http://blog.jdwyah.com I’ve worked at PatientsLikeMe, HubSpot and now ezCater
  5. But like lots of you I have side projects too! Like http://forcerank.it The best way to prioritize your trello backlog as a team!
  6. Like http://whatsize.is The best way to know that 24 Months in Carters is 2T June & January, but 90mm in Hannah Anderson and 12-18 months in H&M
  7. Like http://ratelim.it The best way to get a distributed rate limiter in the cloud.
  8. So like most of you, I rely heavily on Heroku for all these side project. All fun and games, because it’s free, and the only cost is that all your app ideas take a full minute or so to boot on the first request.
  9. Tonight’s agenda
  10. When I worked at HubSpot I had access to a really powerful distributed rate limiter that could handle millions and millions of individual limits, and would persist the limits / token buckets forever. This was AMAZING because it meant I could use these limits to save tons of money on our UsageTracking bill, but also I could use it for Idempotency enforcement by having “infinite” limits. I used this to great effect to save money in lots of fun places. It’s an amazing hammer.
  11. So I left HubSpot and of course didn’t have access to my favorite tool. I needed to build a new one for myself. So what is rate limiting? Here’s the basic API I wanted to support.
  12. Most people think of Redis or Memcached for rate limits and those are very good for many limits, but the “eternal” rate limits I want to support are not well suited to Redis. Dynamo is a better solution for long term storage.
  13. But Redis is still great and sometimes rate limits are going to get pounded, so we should front Dynamo with Redis
  14. Fronting Dynamo with Redis means you still need to write to the backing store. The solid way to do this is a Queue and Writer. (You’ll notice we’re up to 2 services now)
  15. Of course I want http://ratelim.it to be a little SaaS. I’m not crazy so I’m not going to write a CRUD app in Java, so we have a Ruby on Rails app too.
  16. One thing that is a trick with Dynamo is that it doesn’t autoscale. But you’re going to have bursty traffic, so you’ll need to have something autoscale for you.
  17. They best option is a long running python project that polls your dynamo tables and scales them when they get close. (So now we’ve got 4 services)
  18. So how in the heck am I going to run all these things? My heroku bill is going to start to be problematic and these services are things that I really want to be “cheap to run & scale” since we’re planning to charge 5 millionths of a penny. There’s not room for much overhead. Amazon ECS says it will do all this….
  19. And their video is cute…
  20. So here’s the basic architecture of the AWS services I want.
  21. I deem this “do-able” even with my not-so-great understanding of AWS.
  22. Oops, forgot Application Load Balancers.
  23. Oops and IAM Roles, RolePolicies, AutoScalingGroups. SecurityGroups, VPCs, LaunchConfigurations, aws_acm_certificate, ECR repositories…
  24. Here’s ¼ of the end result of how many resources I’ve got.
  25. Let’s pause here and say that before this endeavor I had just about no idea what all this AWS infrastructure really was.
  26. I just wanted to declare what resources I wanted and then let something figure it out. Isn’t there anything that does that? Luckily there is! https://www.terraform.io
  27. So, what does Terraform look like? Well it’s pretty amazingly just-what-you-hoped-it-would-look-like. Here are the ECS Services and Tasks
  28. You can see that each task defines how much memory and cpu it needs
  29. You can see that we’re able to avoid checking secrets into terraform by using template files.
  30. For a Rails app, you probably have at least 2 tasks. The task for the server which will be run in a service. And then a separate task that runs db:migrate. That you can just run ad-hoc.
  31. Here’s building a docker image
  32. And pushing docker image to ECR
  33. Here’s terraform plan, which tells you what it is going to do.
  34. Then terraform apply which actually tells ECS to swap which task the service is running.
  35. Within ECS you can see that it starts the new task, hits the health check. Once that’s good it registers it in the ALB. And starts draining connections to the old task. Then removes the old task and reaches steady state.
  36. ECS is really easy to set up to pipe logs to cloudwatch
  37. Running a https://www.datadoghq.com agent in ECS is totally doable and means you get great dashboards about what is happening in your cluster right out of the box.
  38. So why consider ECS to run your Docker images?
  39. http://blog.jdwyah.com/2016/02/ruby-on-rails-on-docker-on-amazon-ecs-w.html and https://github.com/jdwyah/rails-docker-ecs-datadog-traceview-terraform have links to some basic terraform files that will point you in the right direction.
  40. The last hurdle for RateLim.it was figuring out how to actually log & process everyone’s API usage efficiently. Remember we have to serve the request in less than .000005 dollars for there’s not a lot of room.
  41. Amazon API Gateway was just going to be too expensive at these margins.
  42. Instead Kinesis Firehose pointed to S3 and queried with https://aws.amazon.com/athena/ has proved to be a really delightful option. If you have a lot of data in S3 that you need to query with irregular ad-hoc queries you’ve got to check out Athena.
  43. Here’s what Athena looks like.
  44. Wrap up!