I bet you have heard that serverless is the most exciting part of backend developments. You also must have heard how you do not need to manage any servers and how everything gets deployed on the edge and everything just works magically! But on the other hand, use sees using the server is disliked and frowned upon. But is this really the case? Here we will understand the fundamental difference between them and how they function as well.
Table of Contents
We are computing, this is passing the program from the computer where you get an output. What we want is to rent out this computer because ideally, we can not run it 24/7. These servers on the computer are much better than your local systems and are essential. Hence what we want to do is compute in three ways. These ways include owning a server or using a cloud service provider. This cloud server provides many options like a managed server, serverless and serverfull. We will be focusing on serverless and server full topics for today.
Server full Backend
When you create the cc2 instance you get an IP address. AWS has racks of servers and maybe one of these servers is an independent server that runs some sort of virtualized hardware. For simplicity let’s say this is the server that is assigned to you. Hence this is a machine or an actual real computer allotted to you. You got an entry point to this using the IP address.
If the server goes down or crashes you will have to reboot it yourself as it non-managed server full instance. Hence you have to do every task from creating to deploying this API. Hence using SSH you can get access to AWS and then you can run whatever command you want. These are just like your computer but they are sitting on the cloud
On the other hand, for serverless, all you need to do is upload the code which you want to execute on a predefined endpoint. This endpoint will never have an IP address hence they will provide a hostname, You can use custom domains as well. At the end of the day, you will get an abstraction solution. It is not an ideal solution as in the above case. This serverless architecture is a lambda architecture. When you deploy it you get a URL and not an IP address because they do not bind your code to a specific server.
In reality, want happens is that even you are allotted a hostname then sometimes is request different IP addresses or containers in the AWS rack. There could be internal load balancers and internally AWS can propeller configure and redirected these requests on any compute instance. This architecture is lossy as you lose access to tour Linux images. This is a lazy solution and hence not ideal but it is fast. All you need to do is provide the source code and it will get executed in no time giving you the output as fast as possible.
In serverless, the infrastructure is already ready so does that mean it is faster? Well, in reality, serverless is actually slower than server full architecture. As for serverless, you are provisioning the infrastructure on demand. This will take a toll somewhere. But for server full backend you need to actually build the load balancer which is tedious. This is where serverless is more useful.
Many people believe serverless is cheaper but in reality, it is not so. If you require a 24/7 running application then server full backend is favored. Running lambdas 24/7 is actually more expensive ad AWS is doing a lot of work for you. You will be using more resources and hence the price will be more
So what you should you choose, Serverless or Server full backend? There is no right or wrong! According to your requirement, you have to choose. Serverless seems beneficial as in reality no one runs a server 24/7. Hope all your queries were answered. To check out more technical stuff ensure to check out Codedamn!
Learn programming on codedamn
Codedamn is an interactive coding platform with tons of sweet programming courses that can help you land your first coding job. Here's how:
- Step 1 - Create a free account
- Step 2 - Browse the structured roadmaps (learning paths), or see all courses.
- Step 3 - Practice coding for free on codedamn playgrounds.
- Step 4 - Upgrade to a Pro membership account to unlock all courses and platforms.
Programming is one of the most in-demand jobs today. Learning to program can change your future. All the best!
Sharing is caring
Did you like what Vishnupriya wrote? Thank them for their work by sharing it on social media.