The term “Serverless Architecture” doesn’t mean that we don’t have servers to run our applications. Rather, we are depending on third-party applications or services running on servers that the third-parties are running in their huge data centers (the Cloud). We don’t need to manage or support the infrastructure. Several Cloud Providers are already providing serverless technologies to implement solutions in a serverless way.
If we want to Implement any application as serverless, we would probably be implementing them as API’s. (In Azure we will probably be using Logic Apps or Functions to create the API’s and App Services or Blobs to hold the front-end HTML pages). These API’s can be invoked by your front end or any other applications which want to use them.
PRO’s of Serverless
In a normal development scenario, you will have your virtual machines and you have to apply cumulative updates and patches so that they are up to date. With Serverless, there are no resources to manage.
Our applications will scale automatically and we don’t need to worry about the backend platforms or any infrastructure related to it.
More Emphasis on Logic
Using serverless concepts, developers will have a lot of time focusing on Business Logic unlike in a normal development where you might have lot of time going to setting up and maintaining infrastructure.
For instance, with a server-based approach, you have to think about the setup, access to your servers and then tweak your code accordingly. Now with serverless you don’t need to wait for infrastructure as this will be provided by your cloud provider as a service.
A huge advantage of serverless is the ability to automatically scale the servers proportionate to the traffic in your system.
For instance, your application today might have little traffic, but as time goes by you see traffic increasing requiring more resources. In those cases, serverless will automatically scale the resources to handle the traffic so that we don’t need to explicitly do anything.
With serverless, we pay for what we use.
In a traditional server-based scenario, we procure the servers and pay them irrespective of whether were using them or not. But with serverless it’s about how you are using it. As an example, when in development there is typically limited traffic and hence with serverless you do not need to pay for the traditional costs of fixed infrastructure.
In scenarios where you are developing a Proof of Concept (POC), your requirements will be to build a workable solution in no time. In other words, you only want to write code. Serverless is a good way to gain the speed required. If the POC is a success you continue the development with the same code base.
Since we are not managing any of the backend servers, we can easily deploy our code. There is no need to worry about server configurations and we can upload our code in the CICD Fashion.
CON’s of Serverless
As serverless depends on Cloud Providers - you depend on their uptime. So, it’s important to know about their SLA’s. They might have outages that can bring down your services.
With serverless, you don’t manage servers. That’s great but you might have less control on your API’s. You might know nothing about the OS on which its running etc.
Since serverless is pay for what you use, sometimes when your application is handling a lot of traffic, you might see spike in your billing.
For instance, in your development environment, you might have scheduled triggering or too many loops in your code. You might have left it like that as it’s in a kind of early stage and it has been running for quite some time. That may cause a heavy spike in billing. So, it’s also important in cloud to treat every environment like Production😊.
Since serverless is a rather new concept you might see gaps in tools for diagnostics, monitoring, logs etc.
However, we see a lot of companies working hard to create good solutions for real time monitoring.
What about serverless In Azure?
Since I worked with Azure I will discuss some of the Azure tools that are already in place.
Azure Logic Apps
Logic Apps are based on workflows. They don’t need any code. There are over 200 connectors like Outlook, Twitter and Facebook. You can basically use the connectors and code will be built in the serverless backend for you.
As Azure Functions Logic Apps can be event driven. It can be triggered by an email, http request, or time.
Azure API Management
API Management allows you to make your API’s more secure and manageable. You can build a wrapper on your API. It can help to provide caching, rate control, proxy, routing etc.
Although there are a few disadvantages of serverless, it won’t stop us from using it as they are manageable and, in a few years, we might see them getting solved. So serverless will be concept for the future.
Topics from this blog: Blog