I'm trying to figure out the best option for hosting and running three applications—a Node.js backend, a Python backend, and a Next.js project. The company I work for wants a solution that remains minimal yet efficient. I've primarily worked with EC2 before, and it has been suitable for smaller, hobby projects. However, this time, I'm looking at a project that will see a bit more usage.
The documentation indicates that the billing is per hour, but I'm curious if there are any limits on API calls or compute hour usage, specifically with a t2.nano configuration. The main mobile app is expected to serve about 150 users for 12 hours daily, making around 40 backend calls each (roughly 6000 calls a day). The Next.js dashboard should see around 50 users for the same duration, with about 250 API calls, totaling around 12,500 daily calls.
Will this load be manageable on EC2 with those basic settings? And if so, what kind of costs would I be looking at? Additionally, how does ECS on Fargate compare to EC2 in this scenario, considering Fargate's higher costs?
8 Answers
If you're using EC2 directly or through ECS with the same instance type, the pricing remains consistent. Just keep in mind that ECS might also incur load balancer fees. If you choose Fargate, expect higher costs—almost double the price of EC2. But don’t forget, EC2 can handle very large projects, so it should be fine for your needs!
Remember, ECS is a framework for container orchestration, not compute itself. For your containerized workloads, you can either use EC2 instances or Fargate. The beauty of Fargate is that you only pay for exactly what you utilize, which can end up being cheaper than managing multiple EC2 instances and their overhead. So, consider that option if you want to keep costs optimized!
Also, looking into AWS Lambda could be beneficial—it might align perfectly with your traffic patterns and could be the most cost-effective fit for your application with this usage scenario!
A simple note: EC2 acts as a virtual machine. You manage all traffic and services, and it can handle a mix of workloads—API calls, emails, etc. ECS just uses containers instead of VMs. For your scale, you could technically run your workloads on very minimal setups, so don’t stress too much about initial choice as long as you understand your usage patterns!
Definitely use the AWS calculator to estimate your costs more accurately. And running performance/load tests is crucial to ensuring your setup can handle your expected traffic before going live!
If you're estimating load, it might be best to build both setups (EC2 and ECS) with mock databases and perform load testing to see how costs stack up under stress. That's the best way to get accurate readings on performance and expense.
You have a few solid options for a setup like yours: 1) If you're looking for simplicity, just spin up a few apps easily. 2) Using ECS on EC2 will be the most cost-effective in the long run, but it requires some maintenance. 3) ECS on Fargate is more practical and a bit pricier, great if you don't want to stress about infrastructure management.
Given your small initial setup, Fargate might be worth the extra cash. It saves you valuable time on setup, especially if you lack DevOps experience. You could see an increase in costs of about $50 a month, but think about the time you'll save focusing on your core business!
If you're on Linux, consider switching to the t4g instance type (ARM-based Graviton), which can save more on costs, regardless of whether you choose EC2 or ECS. I personally lean towards ECS over EC2 because deploying containers is way easier than updating EC2 instances!

Good point! Handling setup and potential scaling later is key. Plus, Fargate's ease of use can't be overlooked.