Which generic AWS Compute Platform should I use?

  1. Lambda
  2. Fargate (Either ECS or EKS)
  3. EC2

High Level Concepts

  1. Get rid of all of the undifferentiated heavy lifting that you can
  2. Try to maximize the benefits of cloud computing, specifically economies of scale. Be aware of when you’re trading hard dollar costs for your own companies engineering time
  3. Don’t force a square peg into a round hole — use things that make sense

Do you have a specific need?

Can you run in Lambda?

  1. You’re comfortable in one of the supported runtimes — keep in mind these are Amazon Linux based, so you’ll want to check if all of your dependencies work on that platform
  2. You fit well inside of the lambda timeouts — yes, AWS supports Lambdas running up to 15 minutes. But if you’re pushing that number I’d suggest either picking another platform, or rethinking how you’re operating on your workload
  3. You want to have a lot of integrations with other AWS services (SQS, SNS, Kinesis, etc)
  1. You don’t think the pricing model is a good fit for you
  2. You need something that isn’t in the lambda run time, and is hard to package with your code (yes, you can run your own containers in lambda if you want to. I haven’t tried this)
  3. Your workload may not finish in the 15 minute timeout

Can you run in Fargate?

  1. Can your app run inside of a container — may can, some can’t.
  2. Do you fit into one of the spec configurations for Fargate — you can only have specific CPU/Memory configurations, and the largest is 4 GB
  3. Are you comfortable with the pricing

If not, welcome to EC2!

  1. Manage your apps with default AMIs and lots of scripts triggered by EC2 User Data
  2. Use Systems Manager, either by creating custom documents or using the build in ones
  3. Do you love Chef/Puppet/Amazon Chef? Try out Opsworks!
  4. Love containers and think you can run them cheaper than AWS? Try running your own ECS or EKS cluster!
  5. Are you an SSH fan? You can always setup a bastion host and ssh onto boxes to do stuff manually
  6. Like the idea of golden images? Build them yourself or try out Packer.io
  7. Do you fit into one of elastic beanstalks templates? Try one of those or build your own!
  8. Do you love jinja templates and want some control over cloudformation? Try out Proton!

General thoughts

  1. Are you picking something absolutely untenable? If not, don’t worry too much
  2. Is your favorite solution going to last long enough for you to get used to it, and get value from learning it? If it will, don’t worry too much
  3. Do some quick napkin math on the pricing (remembering you have flexibility like Savings Plans if you need to slim your costs in exchange for the option of walking away)? If you are, don’t worry too much
  4. If you do a PoC in a playground does it go more or less smooth with a few hiccups? If it does, don’t worry too much



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Brian Olson

Brian Olson

Engineer, formerly at Amazon, currently at Google. All opinions are my own. Consider supporting here: https://devblabs.medium.com/membership