2026-09-11 15:52
Status:
Tags: IBM IBM Full Stack Software Developer Professional Certificate IBM Application Development using Microservices and Serverless Servers Serverless System Infrastructure Frameworks Back End
ADMS - Module 3 - Serverless Overview
==Serverless Overview
-
Introduction to Serverless Computing:
- Serverless Computing basically, the idea or concept of building and running applications that do not require server management (as according to the Cloud Native Computing Foundation / (CNCF))
- Basically though, its the idea of infrastructure as a service, in the sense that the cloud provider is the one that manages the actual server, and the server infrastructure, and then the customer pays for it and is able to just use the resources and set them up however they want
- Think of Serverless computing as a combination of FaaS (Function as a service) & BaaS (Backend as a service)
- FaaS platforms are used to run functions, things like Lambda, computational functions, and all other such things that would require compute power
- The BaaS is then obviously the backend, and has things like databases, object storage, the actual logging, the OSS, and all of the things you would want a backend to have
- There has been this sort of trend of evolving towards more and more fast deployments with shorter lifespans, leading to better adaptment and productivity
- It started out with physical machines, which cost a ton and were planned out, but lasted for several years, after long deployments
- You then eventually got to virtualization and cloud computing, you would have a VM up in minutes and it could live for days or weeks running a process
- Eventually, you then got containers running smaller images, which were deployed basically in seconds, and lived for minutes or hours based on their given task
- Now the hour is shifting even further with Serverless, where you basically have something you can deploy in milliseconds and it lastly for only a few seconds with very specialized and needed things
- Serverless architecture is basically something like IaaS, and it in essence abstracts out the infrastructure from the software environment
- It basically means your code runs in a cloud flatform, where the provider manages the hardware, the actual software setup, the security, and the performance (like PaaS sorta)
- A user is only billed for their usage of resources, and this allows for developers to only need to focus on applications and code in the form of running functions
- Basically, you upload your code as event driven functions or a loosely coupled backend that proceeds to run and scale up only when it is used, and then basically immediately scale back down to zero whenever it is not in use
- This basically makes this a hostless, elastic form of deployment because it means you have only these event driven functions that serve as your application whenever they are needed
- Allowing for these functions to billed annually, and be highly available
- In essence the way that it works, is the developer would first write a function that the cloud provider supports, in python or whatever the fuck
- Then, the cloud provider would run it on their platform, and whenever an event happens, like a user click for example, it then spins up some small kubernetes container or docker container or something to give the user what they want
- After doing so, it automatically shuts it down
- The focus on functions allows for better user experience because developers can focus more in on the things that make their code better, instead of having to worry about something like a platform or infrastructure
- The cloud provider is then responsible for all of the rest of the shit, like server management, auto scaling, security, performance, logging, high availability, and more
-
Serverless Pros and Cons:
- Traditional servers basically needed to be physical, which costs a lot of money, power, and planning to set up what you need for the service you provide
- Equally speaking, it means that you need to take a lot of time to set up and deploy the hardware you just bought as well
- In essence serverless computing is the opposite of that, in the sense that it allows for the infrastructure and backend and data management to be handed off to the cloud provider, which is just someone else in a data center
- Developers can then basically focus just on actually writing the code, and not shipping or deploying any of it, letting them set up applications in milliseconds
- This too had issues though, you’re kind of locked in to the cloud vendor that you choose, and also therefore need to rely on a bunch of other third party dependencies and networking logistics
- Benefits of Serverless
- You basically have reduced costs because you do not need to set up the hardware or hardware logisitics to deploy your application
- This means that the cloud provider is also then responsible for the creation of fault tolerancy and your back ups, including your security
- therefore, with devs having a lot less infrastructure to focus on, they are able to create more productively, making better code and focusing on user experience
- Given that the serverless architecture is event driven, this allows for your code to only run when triggered, so for something like an auth system, that only spins up whenever it is needed, not at all times like it would have been traditionally
- This means there is a fast runtime, as functions run in basically milliseconds instead of entire containers
- Some cloud providers also include a built-in IDE for easier uploads to the cloud
- Most providers also generally make you pay as you go, costing you per the amount of resources that you use
- Most providers also then support any type of popular programming language for you to use on their servers
- There’s also a tone of Third-Party auth and database support services for the serverless architecture
- Given the faster environment, and the need for innovation, it leads to a more competitive edge in the market
- Constraints
- While good for things like authentication, which do not often get hit, it is generally not as saving of resources for processes that need to constantly run
- The fact that the cloud provider manages SO MUCH of the infrastructure and application means you might get vendor-locked
- The functions need to “cold start” every single time they are hit, instead of already being run
- Latency unsuitable for time-critical applications like medical apps or something like that
- It exposes the attack surface for malicious cyber criminals who can now interact with your code, not just ports
- Having no actual structure makes it hard to monitor and debug your code
- Since you do not own the server, you cannot customize certain parts of your server in order to actually optimize around your code or service
- Lastly, there is also the issue that you have no state persistence, so any actual stateful implementation cannot be used in a serverless architecture
-
Introduction to the FaaS Model:
- FaaS (Function as a Service) is basically a cloud-computing way of running functions that have event triggers without the need for any of the regular application frameworks you would imagine like node or whatever
- Its a subset of serverless computing and in essence basically lets you create entire applications out of straight functions which can be written in any programming language
- it is stateless inherently, but can maintain state through an outside cache like a database and what not
- Because the code is written purely in functions, it means that the code executes as fast as a regular function does, and is instantly scalable because multiple functions can run in parallel
- It divides out your server into functions, which allows developers to focus more on the code quality, and leads to faster time-to-market for a product
- Equally, you pay for what you use, as soon as a function is needed, it starts up, does what it does, and then starts back down, and you are basically only billed for the amount of time that the function ran
- The functions are small and stateless, meaning that they can scale up or down automatically as required
- Due to this being a cloud service, it means that there is high availability for your code to run on a lot of different data center locations
- Okay so boom, basically the stack for your serverless application consists of THREE things an API gateway, FaaS, and BaaS
- Basically, you have your Function as a service which is your application code, and these are the functions that basically take in a request from your API gateway and then forwards them to whatever back end service is needed
- The back end service then basically does what it does, sends out the file, updates a DB, whatever, and then sends that response back on over to the FaaS, which would return the response to the API gateway, which then sends back said response to the client
- These responses are all handled through the API gateway, which is what then basically processes these live events through things like the docker hub or github webhooks, allowing for a new instance of a function to be instantly spun up inside of the FaaS
- The best practice for this usage is to make your given functions do really only one thing without calling many other functions, as the more time your function takes to complete, the more that you have to pay, and the more you loose out on the independence of each function
- This is also why you should limit out needing to reply on third party code applications as well
- Good FaaS providers include
Amazon - AWS Lambda, Google Cloud Functioons, Microsoft - Azure Functions, IBM Cloud Functions, Red Hat - OpenShift Cloud Functions, and I am sure there are many more out there - If you want to self host you can use personal frameworks like
Fission, Fn Project, Knative, & OpenFaaS
-
The Serverless Framework:
- Serverless Framework is a free open-source web framework written using
Node.jsand it was originally designed and created for the management and support of the Amazon AWS Lambda function service, but seems to have branched out since then - It is a CLI tool that offers out of the box best practices whenever it comes to the configuration and using of FaaS, letting you basically just write good architectures code that does not need to have any underlying infrastructure
- Functions are basically just straight up code that is uploaded over to the cloud, and is an independent unit of execution similar to how a microservice might be
- They are generally used to accomplish a single specific task, something like saving a single user to the database for example
- Events are the things that would actually trigger out a given function inside of your application structure, and these would be things like HTTP requests, file uploads, button clicks, all of those kinds of things basically
- Resources are the infrastructure components that are used by the functions in your application, and this can be something like the database service that a given cloud provider would give you in the FaaS service deal
- Service are the framework’s unit of organization, something like a project file, but you can have multiple of them, they basically the structure that defines a service in your code, you can have one
serverless.yamlwhich would find your functions events, and resources - You basically use this to sort of define your container like you would for docker or say a kubernetes deployment, and this would therefore then allow for you to have your FaaS to work as you set up and what not
- Serverless Framework is a free open-source web framework written using
-
Popular Serverless Platforms:
- AWS Lambda is an event-drive computing service from amazon that lets you run application code without provisioning any server components
- It responds to requests at any scale, and offers 200 services
- You are only charged for running a function or for data transfer between services
- It can be very versatile, for things like file processing, web applications, IoT, and mobile backends
- Google Cloud Functions a simplified developer experience that is very intuitive, you just write the code and then they are the ones to handle all of the other infrastructure information
- It scales up automatically both up and down instantaneously depending on traffic
- Provides google Firebase for real time sync updates with a change in data
- Handles async workloads like ETL (Lightweight extra transform) without the need for setting up extra servers
- Microsoft Azure Functions a serverless solutions that allows you to write less code, maintain less infrastructure, and lower costs
- It has all of the given languages you would expect like C, C++, C#, Java, all of the good stuff
- It promotes great DevOps capabilities for an easy implementation of a CI/CD pipeline
- You only pay for your functions when they are running, but they also have options for more flexible payment methods too
- Use Cases: Post-Processing, collect and process IoT data, execute code at your specified time or interval of time
- IBM Cloud Functions promotes easy integration with other services by allowing you to trigger your actions through events, or directly via rest APIs
- It provides cost-effective computing, and you only pay for what you use, down to one tenth of a second
- it provides cognitive data processing, and can do things like detect people or objects appearing in video or photos
- It is available within of multiple high availability regions, and has really great disaster recovery
==Summary
- Serverless is the concept of building and running applications that do not require server management
- Serverless uses BaaS services and FaaS platforms
- Cloud providers take care of infrastructure management and maintenance tasks
- The arrival of serverless computing means development teams can focus on writing high-quality code
- Serverless offers several benefits, such as built-in high availability and fault tolerance, faster function run times, and pay-per-request billing
- Serverless computing has several constraints, including unacceptable latency for time-critical apps, complex monitoring and debugging, and no state persistence
- FaaS is a type of cloud-computing service that allows you to execute code in response to events without a complex infrastructure
- FaaS is a subset of serverless computing that creates applications in the form of multiple functions; and can be deployed on cloud, hybrid, or on-premises
- A serverless stack comprises of FaaS, BaaS, and an API Gateway
- The Serverless Framework is a free and open-source web framework written using Node.js
- The use cases for serverless web applications are Web Application, Event streaming, Post-processing, and Polyglot systems
- AWS Lambda provides you with an event-driven and pay-as-you-go serverless platform
- Google Cloud Functions provides you with a simplified developer experience, along with Firebase for real-time data sync
- Microsoft Azure promotes cloud and edge computing
- IBM Cloud Functions gives you high availability and cost-effective computing
- Knative promotes platform-agnostic alternate
==Glossary
| Term | Definition |
|---|---|
| API Gateway | API management tool that sits between a client and a collection of backend services |
| BaaS | Backend-as-a-Service |
| CNCF | Cloud Native Computing Foundation |
| cURL | A command line tool and library for transferring data with URLs |
| DELETE | Request to delete a record |
| FaaS | Function-as-a-Service |
| GET | Request to retrieve a record |
| IDE | Integrated Development Environment |
| OpenAPI | specification Defines a standard, language-agnostic interface to RESTful APIs |
| pip | Python package manager |
| POST | Request to create a record |
| Postman | An API platform for building and using APIs |
| PUT | Request to update a record |
| REST | Representational State Transfer |
| Serverless computing | Abstracts both infrastructure and software environments. An architectural style where code runs using a cloud platform |
| Swagger | Allows you to describe the structure of your APIs so that machines can read them |
| VM | Virtual machine |







