5 ms·
An example of where serverless is lovely for us: We run on AWS. We log lots of stuff to CloudWatch. CloudWatch allows you to scan for regexps (more or less) an
by kstrauser 7y ago
An example of where serverless is lovely for us:
We run on AWS. We log lots of stuff to CloudWatch. CloudWatch allows you to scan for regexps (more or less) and send matching lines to a destination of your choosing. There are about 5-10 such matching events per day that we care about, and when they happen, we want an alert in a Slack channel (or email or text or PagerDuty or...).
Option A:
Stand up a server. Deploy a web service on it that accepts POSTs from CloudWatch and acts on them. Update the box as OS vulnerabilities come along. Pay 24/7 for a server that accepts 10 incoming requests per day.
Option B:
Write a plain Python function that takes the contents of a POST that's already been processed and has no other idea that it's living behind a web server. Drop it in Lambda. Pay for 1000ms of processing time per day.
I wouldn't want to run our entire stack on Lambda and friends, but for certain specific situations it's brilliant and I wouldn't want to give it up.
- mytailorisrich 7y agoIf you have spare capacity on a server you can probably squeeze in such functionality at no extra cost.
- lallysingh 7y agoIt's almost never about server capacity. It's usually about who's maintaining them, who controls the updates and versions of software on there, and which dept the server's billed to. All stuff that's reasonable for things of a certain size, but unreasonable for things too small or big to fit the process will.
- mytailorisrich 7y agoAh so it's serverless as a tool to work around corporate red tape, then ;)
- smacktoward 7y agoI would love to see a study of how much IT spending in general is just for tools to work around corporate bureaucracy. I suspect the figure would be staggering.
- deleted 7y ago[deleted]
- jimbokun 7y agoA market that will never die!
- kstrauser 7y agoBut that makes operational expenses go up. For instance, now you have to tweak the Nginx config to support the service that normally lives on that machine and the new system. And you still have to write and maintain the web service driving it (which may not be hard, like a Flask app with a single route, but still more than zero). And you still have to maintain the server itself, which should involve regular OS updates and any work you have to do to automate deployment of the web service, unless you really like doing all that stuff by hand. Or you can upload a single function definition to Lambda and let it do everything else. Again, I wouldn't use Lambda for everything, but I'll gladly let it handle the stuff I won't want to bother with.
- EpicEng 7y ago>But that makes operational expenses go up On the other hand, you're probably all set up to do that already. It's no big deal. Introducing a new tech requires training, new deployment procedures, new documentation, etc., and now you probably have a one off component out there. There's a line somewhere, but if I were just adding a webhook for log events I'd throw it on a server I already have.
- richmarr 7y ago> ...at no extra cost Complexity and dependency are costs too, and I would argue often more significant costs than the $30/month to run a server.
- kragen 7y agoYou're using Lambda because you haven't figured out how to enable cgi-bin in Nginx?
- kstrauser 7y agoYep, you figured me out. Drat!
- stevofolife 7y agoHow can cgi-bin in Nginx help in his case?
- kstrauser 7y agoNarrator: It can’t. Well, it can, but that’s the trivial part of all this. Tweaking a web server config is like 1% of the problem.
- kragen 7y agoOption A above requires standing up a new server. Option B involves just writing a short piece of code that handles a form POST and uploading it to a server (in that case, Amazon's). Option C, "If you have spare capacity on a server you can probably squeeze in such functionality at no extra cost," has the following disadvantages, according to him: "Now you have to tweak the Nginx config to support the service that normally lives on that machine and the new system. And you still have to write and maintain the web service driving it (which may not be hard, like a Flask app with a single route, but still more than zero)." But a CGI program, assuming you have cgi-bin already configured, gives you the benefits of option B without the drawbacks of option C: you don't need a Flask app or a route or a configuration tweak. You just write a short piece of code that handles a form POST and upload it to a server. The difference is that it's your server, not Amazon's, and you have to put this at the top of your code: #!/usr/bin/python import cgi qs = cgi.parse() Then you can version-control it in Git so that when you need to figure out what broke last week you don't depend on AWS deployment logs. Like, literally, the drawbacks of "serverless" that are being cited in this discussion (startup time and performance cost) are the reasons we moved away from CGI in the late 1990s, and literally every single advantage being cited for "serverless" in this discussion is also an advantage of CGI. "Serverless" also has disadvantages of vendor lock-in, lack of programming-language choice, and difficulty of monitoring and debugging that don't exist with CGI, but those aren't coming up much in this discussion. The only real advantage seems to be if you can get by with literally zero servers of your own, thus saving the US$5 a month you would spend on a low-end VPS to run your potentially dozens of CGI scripts under Nginx, maybe inside Docker. In that case maybe you should look into shared web hosting. Or possibly get a job, if that's a possibility. I'm not saying "serverless" isn't a good idea or that it isn't an improvement on CGI. The CGI interface is kind of sketchy and it's produced a lot of bugs in the past. It would be easy to do better, especially with a native-language binding. But the reasons we abandoned CGI are also reasons to abandon "serverless", and the actual advantages of "serverless" (if they exist) are not coming up in this discussion.