Hacker News new | ask | show | jobs
by srer 1488 days ago
I work in a company that's all in with serverless on AWS, but unlike you I can't give a glowing recommendation.

The answer should always be "it depends".

IMHO the more distributed a system the more difficult it is to correctly build. Serverless architectures encourage distribution by building your service from different AWS components, commonly say, Lambdas, S3, DDB, SQS, etc, you end up building a distributed system from AWS provided distributed systems.

System performance is commonly a function of data locality, and serverless typically spreads things out. The Lambda's have no persistent state of their own, though DDB is fastish, it's still multiple network hops away. Speaking of performance, you are also always trying to work within the 15 minute / 10 GB lambda hard limits, which has made my current role the one with the most performance management work yet!

Lastly, you require a rather high proficiency in AWS, both in general (IAM polices, roles, cloud formation, cloudwatch, et al), and in specific services - and each service is it's own thing with it's own performance traits and consistency guarantees and semantics. It takes a lot to pick it all up.

Meanwhile, single servers, being whether you rent an EC2 virtual instance, an OVH rented physical instance, or purchase one, have gotten extraordinarily powerful. And postgres has proven to be very useful.

I'm not suggesting people ignore AWS all together, but perhaps using less services could serve a lot of people rather well, 1 EC2 using Postgres RDS and EBS, can do an awful lot. I notice the M6a instances apparently max out at 192 VCPU, 768GB RAM, 50Gbps networking and 40Gbps of EBS connectivity.

Most people know how to run 1 host, everyone has 1 host they use as their work desktop, they have routers and home servers, and they get great data locality and a much easier to reason about system.

Some might allege that such a host will have less uptime compared to what someone might build with a serverless architecture. However, I believe most outages are a result of human error, be it in configuration or code, and by simplifying the system to a host, a DB and a SAN volume, one might be able to make it much more straightforward, which also helps recover from outages much quicker. (Serverless observability is no where near as good as what one gets with a process running on a Linux server you can SSH into.)

Some might say you will hit hard scaling limits, since such a design scales up rather than out. This is true, but AWS is a minefield of quotas and hard limits, and you have to design carefully around them. A Linux host will also have such limits, but AWS Serverless will be a superset, since at the end of the day AWS Serverless is running your process in a Linux firecracker VM anyway.

I don't mean to be an advocate for any part of the spectrum, just that I don't think there's any free lunch here by picking serverless. Much like picking a programming language, I think it might come down largely to what your existing skills are and your personality.

2 comments

I can only speak from my own experience, but if you're anywhere close to the limits that Lambda imposes, then you should probably have already converted those functions over to Fargate or your own ECS or EKS clusters a long time ago. Many people abuse Lambda as a way to quickly launch an instance that's supposed to last for a relatively long time instead of one whose lifespan should be measured in terms of milliseconds or maybe just a few seconds.

Lambda gives you way more rope than you need to hang yourself many times over.

Don't get me wrong, it's a great tool when it fits your use case, but there are a lot of people who got started with it without really understanding their serverless use case, and because it worked so well they just never bothered to do their due diligence to find out if it really was the right solution. And even if they did do their due diligence at the time, they just cast that decision in stone and never came back to it.

It is possible to build and run a Tier 1 class service and take dependencies on serverless technologies plus DynamoDB and other Tier 0 or Tier 1 services. More than a few services at AWS are built that way. But you have to be careful when incorporating Lambda into that kind of equation.

I agree with a lot of what you said. Though you may want to look into AWS EFS a sit has opened up a whole bunch of use cases that were previously very difficult with AWS. You can also use Lambda with VPC Endpoints to make the network distance to DynamoDB more efficient.

But yeah, if latency between servers is a concern of your's than Lambda is not the best. But for a different reason than you described, I think it is the lack of ability to have a long running network connection that is the hurdle there since handshakes take time.

Didn't mean to imply it is a free lunch either. But I do think it should be most people's default. The goal should not be to be free it should be to provide high availability and reasonable performance for minimal cost. And in my experience Serverless does that very well.