What is Serverless?! (in 3 minutes)

Tech More
36 followers
1 Video View·Oct 22, 2022
Every time you hear about deploying an app or anything about servers, the comment section
will for sure talk about serverless at some point. What is serverless? Are you literally
gonna tell me that there's no servers whatsoever? How does this even work? Why should I use
serverless? Why does my app keep crashing? Why is my back hurt only at 27 years old?
Serverless is a cloud computing model where cloud providers allocate resources
on demand and take care of all the complicated stuff for you.
Let's first talk about the old way of deploying an application. Beforehand,
you would have to buy a physical machine, you would then have to install the operating system
on it, you would then have to download all the dependencies of your application, you would have
to scale it to match the correct traffic, you'll also need to install server-side software onto
your server, and all of these steps come with their own hurdles. Why can't this just be as
easy as running a localhost server? Well, this is where serverless comes in. You write your
backend code and deploy it to a provider of your choice, and then you let the cloud provider deal
with all that annoying stuff for you. Of course, with a cost. Arguably speaking though, this is
one of the shining features of serverless, is its costing structure. Services like AWS Lambda,
Azure Functions, Google Cloud Functions, charge a very low price for a high amount of execution
time. And when I say low, I mean like 20 cents for 1 million requests low. So when should you
serverless? If you have a backend infrastructure that has a couple of really critical endpoints,
it might make sense to convert those endpoints into serverless functions,
so you can rely on the scalable infrastructure of the cloud to handle it for you.
If you have a website that just needs a couple of backend functions, like maybe a donate page
on your website, then it might just make sense to use a serverless function to handle that rather
than building a whole backend from scratch. You're probably like, am I dreaming? What
could the drawbacks of serverless possibly be? Well, there's a couple. One is you might run into
some performance issues. For these cloud companies to make costs extremely low, whenever your function
isn't being used, they spin down your function. That means the next time your function is called,
it has to go through a cold start, which the user will have to wait on. There are ways around this,
like provisional concurrency or a bot to wake up your function once in a while,
but that's just the drawbacks of using serverless. If you want to do high-performance computing,
you're most likely going to hit the resource limit that these serverless functions invoke.
Another one is vendor lock-in. If you decide at some point to switch providers, you might run
into some issues with the migration between different clouds. Serverless frameworks try
and help this by providing a YAML file that can be configured to deploy from anywhere.
Serverless provides a way to push your code into the real world fast and reliably,
so I would highly recommend you give it a try. Just remember,
serverless doesn't mean that there's no servers. It just means that you don't manage the servers.
