Serverless computing: economic and architectural impact
blog.acolyer.org
blog.acolyer.org
To be honest, I think AWS Lambda (and Azure Functions / etc.) nailed the compute and economic model, but only got halfway there WRT abstraction layer and ideal development for serverless functions themselves. There's an opportunity here to introduce millions of new software engineers to a programming model where they no longer have to think about how their web services run and can treat remote function calls like first-class citizens of their development environment.
In fact, this is what we've built and we're continuing to iterate upon at StdLib [1]. One of the most common pieces of feedback we receive from our customers is; "this is everything serverless should be." We have an open source Gateway specification called FaaSlang [2] that makes local development a breeze and perfectly in sync with production functions, as well as providing automatic error (type, parameter) checking at the request level, before function execution. We've only been able to get here by "throwing the baby out with the bathwater" and reimagining backend web development with serverless functions from the ground up.
Disclaimer: I'm the founder of the company and pretty gosh darn excited about the future of this space. Check us out if you get the chance, you won't be disappointed. :)
>For example, a 200ms service task that needs to run every five minutes would need a dedicated service instance (or two!) in a traditional model
This feels like such a straw man. Under what traditional model would you spawn off an entire server instance for such a minor function? You'd slap it in as a service on an existing host. Hosts which for a long time now have been virtualized on consolidated hardware, not bare metal.
Serverless can bring big benefits for certain workloads, but hyping it up by misrepresenting the alternatives seems a dishonest attempt to justify investment in the big architectural changes you have to make to get there.
I think that's the point - would you rather run your own VPS and manage the logs/errors from a cron job? Or simply write code that conforms to their contract and not worry about logs, errors, and whether it can scale or will fail to restart itself.
The crux so to speak. I wonder if this type of planning makes sense though? Can't I argue that good design, which imo has been around for ages and collected well in canonical books, aid in improving time to market for new features?
For me, charging for actual usage instead of reserved capacity actually aids in implementing those good design guidelines that were collected in books, such as low coupling and high cohesion of code, and this is what we wrote about in the paper as well. charging for reserved capacity creates financial incentives to bundle tasks and features into applications, creating runtime coupling (eg sharing the same /tmp dir, reusing security roles etc), even though they are designed to be isolated. charging for actual usage removes that incentive, so stuff that was designed to be isolated stays isolated when deployed.
Separation of concerns is easy to do without lambda or microservices. If you want separation of concerns write good code. Don't move your environment to a locked in circus.
Serverless enables the extreme (many tiny services with minimal upfront cost) but doesn't require it.
For health, there's certainly more noise now: we can look at overall invocation error rates (a metric lambda gives us), but they're across several endpoints within the lambda function. This is still an open question for us, but solvable.
This sounds better, and perhaps I could be on board with this. I went a different route, which is kubernetes for my Django + Celery. Over 75% of my load is "stable", so kubernetes + celery ends up cheaper than lambda for me. I can basically throw my web servers in my kubernetes cluster "for free".. but if I had just a webapp, I would feel better about my entire Django in one Lambda, or at least 1 entire "app" of my Django in one Lambda. My biggest gripe is warmup speed, 3 seconds for a cold request is pretty bad compared to the 100ms I have now in kubernetes.
We use Lambda primarily to improve developer efficiency and to allow dev teams to own their own operations end-to-end, with cost efficiency only a secondary goal. It's been great for that as it's a small enough thing to integrate with that any given developer can learn the entire operations stack (for their team's services) well enough to work on it themselves.
3 seconds on cold request sounds unusual, it should be around a second or less - have you measured it? If you use VPC you'll unfortunately be in the realm of 20-30 seconds cold start, which is why we've avoided it for Lambda (and used stores like DynamoDB rather than RDS which work with IAM as an alternative to security groups). No Elasticache without VPC is going to be a big problem soon though...
Having said that tooling is key and I find it somewhat lacking to turn on a switch and run my code as a lambda to say compare costs and such.
The serverless functions take up to 1s to boot. It is not fair to compare that to a VM that is on all the time. We should compare it to a container that is booted on demand. Right now only Heroku does that. At GitLab we're considering adding idling by sponging requests https://gitlab.com/gitlab-org/gitlab-ee/issues/3712
>You can’t run a fully simulated Lambda environment on your local machine.
... is now partially solved via SAM Local: http://docs.aws.amazon.com/lambda/latest/dg/test-sam-local.h...