Hacker News new | ask | show | jobs
by notanotherycomb 2083 days ago
I'm ignorant

How does a build trigger the serverless function to notify all of you? I kind of assume serverless means it activates on a timer or when you visit a specific URL. So a build script executes it by visiting a URL when it's finished? And the script executes from any internet connected machine?

Why is it better than having a VPS? I currently use a VPS for a few one off scripts. Cron does the timer ones and the URL ones are entries in a nginx config file. Actually that's half true I actually config an app I wrote to do it cause I didn't want to bother finding out how to do shellexecute on nginx

3 comments

The serverless framework is an open source tool that you can use to "deploy" "serverless" assets. Basically it covers most of those scripts you usually have to write and gives you a declarative format with some great variable capabilities that help you managed config and declare your components clearly. Running the tool deploys to your cloud of choice and results in functions, APIs, workflows, databases, or whatever you declare now existing and ready for use.

That framework is separate from the class of services regarded as serverless. The star that kicked it off was AWS Lambda. Serverless colloquially means you are dealing with an abstract service contract rather than a server (e.g. the oldest is S3). This removes patching and other maintenance that usually does not directly support business value. More formally, serverless includes auto-scaling to zero, paying only for what you use, high availability, and other design patterns most outside the large tech houses cannot use at low to no cost.

Your VPS is always on and always paid for. It can crash or get in a bad state. It can go out of date and need patching. It is mutable and more vulnerable. It is limited in resources.

Nike reported AWS Lambda scaling in production at 20K RPS/S (0RPS@0s, 20K RPS@1s, 60K@2s, 120K@3s, ...).

serverless-artillery, with loosened account "safety" limits can scale from nothing to producing billions of requests per second on target systems.

Full disclosure: I contributed to the serverless framework and serverless-artillery. I'm a biased fanboy.

Thanks for this concise and pithy description. I keep hearing about serverless...services, but didn’t understand what they were all about.
It’s like your VPS except without having the manage OS and NGINX updates. And probably higher availability if you are concerned about that.
Serverless functions can be set on a timer exactly like cron jobs. But you can also set them to act on certain triggers, when a message comes into an SQS queue, when a notification goes to an SNS topic, etc.

You can do the same with a VPS, but I think VPS cost more because you pay for all the time you're not using them. With serverless functions you only pay for execution time. And with one-off, daily, hourly jobs you end up paying far less, unless your jobs are compute intensive (cron jobs tend to not be...?)

I have seen some VPS these days come in at like $2 a month though, so it's worth comparing the cost.