Server or Serverless - How to decide- AWS
Tags: aws, serverless, lambda, apigateway
Published: 2023-04-27 14:34:41

Hello all,

Hope all are well. When I started working on the cloud I came to know about serverless, it was new to me and I was very excited about this topic.
 
Later I tried AWS serverless services like Lambda, Api Gateway, etc and I liked them very much.
 
But whenever I want to deploy something or develop something, the first thing that comes to my mind is, Do I need a server, or have to go with serverless? How to decide?

Before getting into the topic let's get familiar with what is server and what is serverless.

**Server**: An actual device that takes requests and responds back. We need to take care of this server like configuring, running and maintenance, etc

**Serverless**: Serverless means, here also servers exist, but cloud vendors like AWS will take care of scaling up and scaling down servers based on load. We don't need to worry about maintaining servers, we just have to concentrate on the thing we are developing. Cloud vendors will take care of infrastructure for you. 

Now we know what is a server and what is meant by serverless. Let's see how to decide whether to go for taking a server or using a serverless service.

There are many factors that come into my mind before decision-making. But the first thing that hits my mind is cost. Which is cost-effective? Taking server and using serverless?

To decide first I'll analyze my application and the kind of traffic I will get to my application.

Like how many read-and-write operations my application needs and how frequent it is. Then what will be the load on the application, whether it is consistent or will vary randomly?
Let's go one by one

- Check your application, analyze how it's working, and what resources it needs from the cloud.

- Then check how much traffic will it receive and whether it will be consistent or vary randomly.

- Then check the cost of the both server and serverless service. Compare the price and keep the data

- Then we need to take customer satisfaction also into consideration before deciding it.
 

- As you decided taking a server will be cost-effective but scaling up and scaling down based on traffic will take time, new servers will take time to come online and start serving customers. So users might face a delay in response and there may be downtime if the server is unable to process the request.

- If the server is okay with some downtime or delay we can go with the server as it is cost-effective. But if the customer is not OK with the delay in responses or downtime even though serverless is costly when compared to taking server we have to go with serverless as customer satisfaction is the ultimate priority for us. 

This is small thinking I make before making the decision of taking a server or serverless. 

It is small but most of the time it helps me. There are some other factors also we need to consider. But these are the main things I will consider. You may have your own factors before decision-making. 

Please comment on the factors that you consider before decision-making so that the readers and I will also know about more factors and we can all make smart decisions.
 
Thanks. If you think this article needs improvement, Please feel free to comment or contact me. I'm always open to suggestions.