Prepare the Server for Black Friday Automatically With the Minimum Cost

Son Hoang Kim
Vibentec-IT
Published in
3 min readNov 24, 2022

Black Friday is coming, and the server of your shop needs to be upgraded but how strong should it be? If the server is not strong enough, it may annoy clients and they will leave your store. If it is too strong, you waste money on that. Don’t worry because serverless comes to recuse.

What is serverless

“serverless” means no server? No, it is completely wrong. Serverless is a cloud application development and execution model. It allows developers to build and execute code without managing servers or paying for idle cloud infrastructure.

Why can it help your store?

Let’s put ourselves in this situation and see how serverless handle it. The day before black Friday, your website has only 100 visitors per day. But on Black Friday, the number of visitors skyrockets to 1000 and then down to 10 on the next following days.

Prices

Traditional cloud: paying 1000-visitors-server to keep the server working fine for one day? What a paint! But worry not, serverless is here

Serverless computing is based on what is executed, i.e. time of execution(millisecond), and the number of requests. Therefore, it is generally very cost-effective. It means it only costs what is used, users don’t pay for the 1000-visitor server. They pay for the number of visitors or serving time. If more visitors to the website, you pay more. Fewer visitors, you pay less. That sound fair enough. Not to mention that, for the traditional cloud providers of backend services (server allocation), users pay for a certain of space or CPU. However, the server rarely needs all of the resources, as a result, users pay for unused space or idle CPU time every day. What a waste of money.

Simplified scalability

Do you want to scale your server? Well, the only thing that needs to do is to do nothing. Serverless runs based on the request to the server. So, it means users don’t need to upgrade the used space or CPU. Serverless handles every request as long as you pay for it. Today 100 visitors or 1000 visitors tomorrow is no problem. Serverless handles that fine.

Faster service

Unlike a traditional server, the application on serverless is not hosted on an origin server. Its code can be run from anywhere. This reduces latency because requests from the user no longer have to travel all the way to an origin server. As a business owner, I may don’t know where is my 1000 customers, but I know they are treated equally

Quick deployments and updates are possible

Good news for the development team. Using a serverless, there is no need to upload code to servers or do any backend configuration to release a working version of an application. Developers can upload a few lines of code and release a new product quickly. It is not necessary to make changes to the whole application; instead, developers can update the application one function at a time. This makes it a great advantage to update, patch, fix, or add new features to an application quickly.

Watch out

Serverless architectures are not built for long-running processes

Do you remember how serverless costs you? It costs based on the running time. Because serverless providers charge for the amount of time the code is running, it may cost more to run an application with long-running processes in a serverless infrastructure compared to a traditional one.

Testing and debugging become more challenging

Testing and debugging is quite difficult since the code can be run from anywhere. Serverless is not hosted on an origin server, so it is a paint to trace what causes errors for the application. But the good news, many providers have many useful tools to track the problem

Vendor dependency

You are not allowed to run versions of the software exactly that you want but you have to depend on the vendor. This may be a critical point in some cases. For example, if you need Nodejs 10. x but the vendor only supports 8. x, you better think about different providers.

Extra costs

Depending on the provider, it may have extra costs from another service: storage, bandwidth…. Although it is not much, if not optimized, the hidden costs will be even higher than the cost of serverless.

--

--