Udemy

What Is Serverless Development?

A free video tutorial from Academind by Maximilian Schwarzmüller
Online Education
Rating: 4.6 out of 5Instructor rating
45 courses
2,632,676 students
What is Serverless Development?

Lecture description

This course is about serverless computing. But what does that actually mean? This lecture takes a closer look.

Learn more from the full course

AWS Serverless APIs & Apps - A Complete Introduction

Get into serverless computing with API Gateway, AWS Lambda and other Amazon Web Services! Zero server config APIs & SPAs

07:40:19 of on-demand video • Updated May 2023

Build, secure and run APIs without managing any servers using AWS API Gateway and Lambda
Host SPAs without managing any servers
Add user authentication to serverless applications
Run code on-demand in the cloud
English
We learned what AWS is, let's now have a look at what serverless computing actually is. For that, let's consider a typical example, we are a user and we're using a web or a mobile app. Now for most of these apps, we also need a back-end, a restful API which these applications can access to exchange data, on that back-end, we would then run our business logic and potentially reach out to databases and do things like that. Now of course for web apps, you could also argue there is the traditional set up of having a server which renders HTML pages for each request we send there. However that is not the approach where serverless development shines, serverless development is best if you have a decoupled front-end and back-end where the back-end is such an API and the front-end is an application either running on a mobile device or a web app running mostly in the browser driven by Javascript, a single page application mostly. So that is our set up, now how does the code on the server run? Well we write our own code to listen to incoming requests on certain API endpoints, so on URLs we provide for our servers to send requests to and our code may be written in PHP, Node, Ruby and of course runs on a server managed by us and that of course also includes servers which we do provision using AWS EC2, so where we run our own virtual machine. We have a server there but of course as our application grows and scales up, we need more and more servers to handle the incoming traffic. Now that can also be handled either on our own on premise data center or using a cloud provider like AWS but this approach has a couple of issues, for example one issue is we have to reinvent the wheel when it comes to creating this API. I said we create the API with PHP, Node, whatever it is and therefore we have to write the logic to handle incoming requests, we have to define the incoming API endpoints in code, we have to do a lot of things which are just about the infrastructure you could say and not our business logic. Additionally, we have to think about how many servers we need and our servers are also online if we don't require them, so we have the danger of over or under-provisioning them, meaning that we either have too many, so we pay too much or we have not enough servers for traffic spikes. And finally, we have to keep the servers updated, we have to keep the operating system updated, have to keep the software updated and whilst doing so, we have to make sure that we don't break anything. These are typical challenges you have when hosting a bigger website and these are challenges you can fix when hosting an API using serverless computing. Let's have a look at how that then works. There, we don't manage all these servers, still servers will be involved but we don't manage them at all. Instead we use a special AWS service, it's called lambda and I'll come back to this later in the course, which allows us to host our code which is only executed on demand when it needs to run. That means we don't have to take care about how many servers we need, we don't have to pay any idle time instead we post our code there and that's it. We then connect it and we have a service for creating that API too which allows us to easily create it without having to write all that logic and then we only pay if requests are coming in. We don't pay anything if they're not coming in and we don't have to worry about updating any software at all. We may use NodeJS, Java, Python or C# when using that lambda service I was referring to and this gives us the power to create completely serverless APIs. We can also host our web in a serverless manner if we're interested in that and we will actually do that in this course too. And with that whole set up, we improved a lot because compared to the traditional set up where we did have to worry about the provisioning of servers, so which servers should we bring up, how much capacity do we need and where we have the danger of paying too much or having server issues and where we had to make sure that we keep our operating system updated, compared to this, serverless offers significant advantages. With the traditional approach, we have to manage lots of overhead when building API plus SPA set ups or applications. They do offer a great support for fullstack apps though where we render HTML on each incoming request, so where we don't have that separation, where we are not building an API. Now serverless applications on the other hand take away this issue of provisioning things, we have on-demand code, we don't pay anything we don't need and we also don't have to manage any infrastructure, that's all done by AWS, it's secure, it's up-to-date and it's not our problem. Therefore this is awesome when we're buildings SPAs and/or APIs and want to run them in a serverless approach. There is only limited support for fullstack apps though, to be precise, really just for Node Express apps at the moment and that is kind of tricky to set up. So this is serverless computing and what you use it for and which issues it fixes. In this course, we're going to learn about all these involved services and how to build serverless apps with that and I'd say why don't we get started with that and build our first serverless API in the next lecture.