I was discussing a bit of a roadmap shift with my team today.
Right now, we have a platform ( flask API ) where users post content, we write to the DB, and then trigger an SNS workflow. The catch is the video/podcast processing. Currently, it’s all running in the same Flask code on ECS Fargate (0.5 vCPU / 1GB RAM).
It works fine for small things, but whenever a bigger video hits, the API lags or crashes. So I do quick fix like bumping the task limits, but that’s obviously not a long-term solution ( like how Instagram people use to add server manually on weekend )
The plan I am pitching to team is let’s decouple the video logic and move it to Lambda. The logic is simple. It keeps the main API light only CRUD, we get “scale-to-zero” while we’re in early stages, and we only pay when someone actually uploads.
One of my devs raised a great point: What if we hit scale? If we get uploads every second, is Lambda still the best?
My take was that it probably won’t be. At that point, we would be paying a “convenience tax” for serverless. If the demand is 24/7 and predictable, I would actually want to move it back to a dedicated Fargate or even ECS on EC2 to keep the margins healthy.
My thought model for the team was:
- Start with Lambda for agility and stability (don’t crash the API).
- Once the “idle time” disappears and we’re running 24/7, pivot back to provisioned capacity to save costs.
Curious to hear from others who have gone through this. Did you find a specific “tipping point” (requests per second or cost-wise) where you decided to move off Lambda back to Fargate/EC2 or vice versa?
Related discussions:
- SQS FIFO queue not getting messages from SNS topic | Terraform
- Does ECS Fargate add additional tasks to same “instance” like it does with EC2 type?
- Any experiences with milkstraw or third party tools to cut costs?
- SES production access rejected — despite following all the best practices — please help!
- EventBridge vs SNS?