Ask HN: What are some practical uses for serverless?
Long time Rails/Django/Express user here. I've been reading about serverless for about 3 years now and have setup minor apps for fun.
Forgive my lack of imagination, but I'm failing to come up with anything serverless can do better than wiring up a queueing system can do.
Let's take rails + sidekiq for example. Out of the box, I get stats, retries/error handling, a web UI, weights, great debugging remote and local, and enormous community support + years of SO questions to google. Setting up sidekiq + rails is basically a 10 minute operation.
I'm struggling to understand a good use case for serverless. What am I missing?
16 comments
[ 2.2 ms ] story [ 48.5 ms ] threadStanding up a toy sidekiq + rails environment for experiments and for tiny projects is a 10 minute operation. Standing one up for large projects, taking care of deployment without breaks, restarting sidekiq without losing jobs, scaling the environment in reaction to traffic, etc. is a lot more work.
Also standing up sidekiq requires managing your backend storage. If you have time and skills for that, great. Otherwise, a managed service may be better.
On top of that, you need to actually deal with system maintenance for all of those components normally. Any managed solution (whether that's serverless, or effectively-close-to-serverless like heroku) may be a good idea.
Other than setup time, are there any other really great reasons to use serverless?
Or, why is serverless so much more popular than heroku (currently)? With heroku, you have a lot more control.
Not just setup time. Ongoing management time as well.
especially for workflows, lambdas and step functions are very interesting.
A very simple example would be receiving emails to a helpdesk address, extracting pertinent information, looking up the user's priority and their system's details, reformatting the information and posting to a helpdesk system's queue.
You have to remember that the term "serverless" is a misnomer, you are using the provider's servers and infrastructure on a pay-as-you-go basis -- with a significant markup. Of course, that markup is the value of you not having to configure, administer, allocate servers, processes, etc on your own.
Serverless, like most IT, is well suited to some use-cases and not to others. It takes skill and experience to design the optimal solution for any given requirement.
Check out Zappa. If your mind isn't blown after you start to grok what it can do, comment here and we can go through it together. It's very cool.
This way, the deployment issue of an application and its maintenance kind of goes away. It's also free, meaning I don't have to spend any more money or pack the code in another server.
The million at once thing happens more often then you think, take the case where a website gets a new logo. Now you have to redo the watermark on all the images. Or maybe you want to convert your jpg to webp.
You can also use lambdas to process your images on-the-fly as clients request them. We use both pre-process and on-the-fly depending on if we need hashes ahead of time.
That means you won’t have to preallocate (and pay for) resources that will go unused during non-peak load. It enables automatic scaling.
There are plenty of “serverless” offerings for computation, but very few for databases. Without the later, I don’t think it has much value.