Other than maybe vendor lock-in, and cold starts, what other drawbacks does serverless have in comparison to microservices?
Assumption: Let's say you run an application / function with 5 qps traffic, needing 256 MB RAM max, 50ms execution time.
EC2: t2.micro instance - 1 instance available as always free, hence using as a baseline. This comes with 1 vCPU and 1GiB RAM - cost $0.0116 / hour x 750 hours a month = $8.7 / month.
Lambda: For 5 qps traffic, it would amount to 13,392,000 requests in a month. With a 256MB instance, and 50ms of execution time, that comes to $2.48 / month, after accounting for 1M free requests.
The math goes in EC2's favor once you cross 20 qps.
Can a t2.micro run such a load - oh yeah!
[1]: AWS EC2 On-demand pricing: https://aws.amazon.com/ec2/pricing/on-demand/ [2]: AWS Lambda pricing: https://dashbird.io/lambda-cost-calculator/
If you have 20 connections per month, you have to pay for the VM or container running all month even though it's getting no traffic 99% the time.
If you have many millions of connections a month and the service is always on and responding, non-serverless will be much cheaper.
You could draw a curve of where those two points intersect for each cloud platform. I wonder if anyone has done that. Would be a nice visual.
Another drawback of serverless is that it is new so the tooling around it is not as mature as VMs or containers. Stuff like debugging can be pretty rough.
One disadvantage I’ve encountered is actually from a support perspective depending on your stack: if your team uses Spring for example, then you’ll know the set up having something Lambda VS EC2s is really different and there’s extra training. People generally don’t like doing stuff they’re not comfy with.
Microservices are by now an old and well known way to develop software (and even there transactions and orchestration aren't easy).
Serverless could force you to break down application logic very differently and slow your coding. Which serverless platform and language are you considering? What's the tooling like? What the Developer Experience like?
Operational workload should be less in theory with serverless. But that only holds if your software scales smoothly. Or else you'll have more complexity to deal with than microservices.