TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: When does serverless become more expensive than microservices?

5 pointsby RapperWhoMadeItover 3 years ago
If it makes sense to deploy an application both as serverless as well as microservices, when will a serverless architecture start being more expensive economically, or in general having tradeoffs in comparison to microservices. Again, the question relates to cases in which both architectures would make sense for a particular application.<p>Other than maybe vendor lock-in, and cold starts, what other drawbacks does serverless have in comparison to microservices?

5 comments

berkeshireover 3 years ago
Comparing AWS EC2 pricing [1] and AWS Lambda [2].<p>Assumption: Let&#x27;s say you run an application &#x2F; function with 5 qps traffic, needing 256 MB RAM max, 50ms execution time.<p>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 &#x2F; hour x 750 hours a month = $8.7 &#x2F; month.<p>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 &#x2F; month, after accounting for 1M free requests.<p>The math goes in EC2&#x27;s favor once you cross 20 qps.<p>Can a t2.micro run such a load - oh yeah!<p>[1]: AWS EC2 On-demand pricing: <a href="https:&#x2F;&#x2F;aws.amazon.com&#x2F;ec2&#x2F;pricing&#x2F;on-demand&#x2F;" rel="nofollow">https:&#x2F;&#x2F;aws.amazon.com&#x2F;ec2&#x2F;pricing&#x2F;on-demand&#x2F;</a> [2]: AWS Lambda pricing: <a href="https:&#x2F;&#x2F;dashbird.io&#x2F;lambda-cost-calculator&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dashbird.io&#x2F;lambda-cost-calculator&#x2F;</a>
评论 #28651407 未加载
f0e4c2f7over 3 years ago
As use goes up serverless gets more expensive.<p>If you have 20 connections per month, you have to pay for the VM or container running all month even though it&#x27;s getting no traffic 99% the time.<p>If you have many millions of connections a month and the service is always on and responding, non-serverless will be much cheaper.<p>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.<p>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.
评论 #28641071 未加载
sailorganymedeover 3 years ago
Depends on the rate of requests. If you’re frequently getting hit, just do the math and see when to switch over.<p>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.
tcbascheover 3 years ago
I’m a little confused by the question. When you say “microservices” do you mean individual servers with something running in them? Because serverless just means using some proprietary cloud tech to run code whereas a microservice refers to the responsibilities and role of that aforementioned code. The two aren’t really comparable in any sense.
评论 #28639989 未加载
pramodbiligiriover 3 years ago
The programming model and the operational tasks are also quite different across serverless and microservices.<p>Microservices are by now an old and well known way to develop software (and even there transactions and orchestration aren&#x27;t easy).<p>Serverless could force you to break down application logic very differently and slow your coding. Which serverless platform and language are you considering? What&#x27;s the tooling like? What the Developer Experience like?<p>Operational workload should be less in theory with serverless. But that only holds if your software scales smoothly. Or else you&#x27;ll have more complexity to deal with than microservices.