wolf4earth

wolf4earth

What's your perspective on and experience with serverless backends?

Serverless has been quite a prevalent topic in our industry in the past few years, and while there are a lot of sceptics, I think it’s safe to say that serverless is here to stay.

What I would like to know:

  • do you have any experience with serverless?
  • if yes: what did you use it for? Which tech did you use? How did it work out for you?
  • if no: why not? Do you still plan on trying it, or are you staying away on principle?
  • is there anything you’re excited for in this space?

EDIT: Just to clarify, when I write “serverless” I’m talking about things such as cloud functions (AWS Lambda) and the architecture and paradigms coming along with those. An interesting book on the topic is Serverless Architectures on AWS by Manning.

Most Liked

wolf4earth

wolf4earth

I’ve updated the topic to clarify that I meant to discuss serverless in the scope of cloud functions and the architectures which are born out of that.


Cold start is indeed an interesting topic, @dimitarvp, but I think the discussion requires a bit more nuance than “faster cold start is better” and “native binaries start faster”.

You might for example be surprised to hear, that NodeJS seems to have better cold start characteristics than go - and that on all major cloud providers (AWS, GCP, Azure). In general the cold start characteristics of NodeJS rank among the fastest in languages commonly used in cloud functions.

And as mentioned before, faster cold start isn’t necessarily better. If your cloud function is consuming messages from a queue to send out emails, or write into a DB or an S3 bucket, or call a remote API, then cold start characteristics become pretty much irrelevant. Of course, when you actually want to run your API through the usage of cloud functions, then yes, cold start becomes important.

I’m not trying to say “use JS for all the things!” - I’m not that fond of JS myself. Instead I think that serverless - and cloud functions - is an interesting new pattern where seemingly important topics (startup times etc.) suddenly become a lot less important, depending on how you design your application.

If you ask me, I think the serverless paradigm has a bright future wherever you might want to “glue” out-of-band things together or where you have to handle ludicrous traffic spikes. A great example is Square Enix which used AWS Lambda to offload image processing for screenshots taken in Dragon Quest X, which experiences 20-30 times the usual traffic a few times per year.

TL;DR or in a nutshell I think that cloud functions, and by extension serverless, can allow us to build applications, or parts of a larger application, with characteristics usually reserved to much more complex deployments.

Will it replace “old” deployment strategies? Hell no! But will it become an interesting new tool in the deployment toolbox? I think yes.

Resources

dimitarvp

dimitarvp

I feel @AstonJ is spot on in his analysis.

To answer @wolf4earth, I don’t have a personal experience and I am cautiously optimistic. It can be seen as a fad especially when you see youngsters immediately jumping to use it… with Node.JS CLI apps. :man_facepalming:

Cold starts can be a serious problem. So languages that compile to native binaries – and don’t carry a huge runtime with them that needs a bootstrap on every app start – have an advantage. Off the top of my head, people had positive experience with “cloud functions” in C, C++, D, Rust, Zig, Golang, Nim, OCaml, Haskell, likely others as well. Not so great luck with dynamic languages, Erlang/Elixir included – JS and Ruby weren’t in great shape either, Python and PHP are also rather slow to start.

I’m open to the idea but I’d think that you have to reshape your app and services – likely even your business – to make serverless [cloud functions] work well for you.

One area I am hugely skeptical is that the big vendors will do their absolute very best to lock you in their garden. So the idea is good but I feel is being weaponized for business interests.

That, plus many people really love their JS and don’t want to learn languages like C/C++, Rust or OCaml, which have one of the very best startup times: <4ms for a hello world program. So in the end I posit that the idea might die simply because the JS runtime (Node.JS) can’t be made to start so fast.

wolf4earth

wolf4earth

I’m sorry to be this blunt: but have you actually read the article?

It mentions this, yes, but only to differentiate it from a warm start where reuse happens. The measurements are explicitly about cold start.

Here is the full context:

When Does Cold Start Happen?

The very first cold start happens when the first request comes in after deployment.

After that request is processed, the instance stays alive to be reused for subsequent requests.

And then further down (before the actual measurements):

How Slow Are Cold Starts?

The following chart shows the comparison of typical cold start durations for common languages across three cloud providers


Again: have you read the article?

Go is actually one of the languages measured. Go is actually measured in both articles, and in both articles it’s measured cold start times are slightly worse compared to JS.

I’m not trying to shill for JS here. I was quite surprised when I first learned about the low cold start times of JS. But the facts don’t seem to support the general statement that “languages that compile to native binaries have a faster cold start”, at least not in the case of JS.

I think it actually shows how much crazy optimization work must have been done on the JS V8 engine and on the cloud provider’s side to enable these times.

Doesn’t mean that I would opt for using JS for cloud functions but it’s impressive nonetheless.

Popular Backend topics Top

New
New
CommunityNews
The Magic of Python Context Managers. Recipes for using and creating awesome Python context managers, that will make your code more read...
New
finner
Just wondering how many devs out there are using Spring Reactive, specifically WebFlux?
New
First poster: bot
What's so exciting about Postgres? with Craig Kerstiens (The Changelog #417). PostgreSQL aficionado Craig Kerstiens joins Jerod to talk ...
New
First poster: bot
Multicore OCaml: October 2020. Welcome to the October 2020 multicore OCaml report, compiled by @shakthimaan, @kayceesrk and of course my...
New
Jsdr3398
I’ve recently become interested in Elixir and all it’s neat perks. And since I’m currently working on a messaging platform; elixir seems ...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
Cellane
Phoenix 1.6.0 got released last week, with built-in authentication and mailer generators, a whole new HEEx (HTML-aware Embedded Elixir) e...
New
lucasvegi
Hello guys! Perhaps some of you have already seen this invitation on other channels in the Elixir community or even responded to our surv...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New