-->
Nowadays, whether it’s on the internet or intranet, 99.99% of services run on servers even with no load. The experience and stability improvements are negligible compared to the waste.
In our previous articles, “Native in Name, Exclusive in Nature: Say No to Stateful Services in the Cloud” and “Cloud is a New Computer”, we repeatedly mentioned that the advantage of the cloud lies in its elasticity, best demonstrated by serverless functions. Let’s discuss why using a serverless tech stack can greatly reduce waste and complexity.
Almost all businesses have peaks and troughs. The chart below shows the PV changes of an internet business in a day. The peak is almost 10 times the trough. Planning capacity based on the peak will waste a lot of resources.
Even zooming into a 30-minute segment, the workload isn’t stable.
As PV fluctuates wildly, how often are the resources planned for the peak actually used?
Here’s a direct cost comparison:
Using the AWS Mumbai Region prices:
Resource | Lambda | C5.4xlarge EC2 |
---|---|---|
CPU | 2vCPU | 16vCPU |
Memory | 2G | 32GiB |
Local Storage | 512M | 0 |
Network | 0.6Gbps | 10Gbps |
Price | 0.0000000333 USD/ms | 0.68 USD/h |
Using memory as a benchmark, 16 Lambda instances (with double the CPU) cost 2.82 times more than an EC2 instance. If your service is active for less than 8.5 hours a day, serverless is cheaper. Most peak loads last only a few minutes or an hour at most, so using serverless can drastically cut your bill.
In the past 20 years, maintaining a reliable online cluster involved extensive work
Serverless reduces this to just managing configurations and monitoring function performance logs. Serverless eliminates services; as long as the startup speed is acceptable and the resource pool is sufficient, CI/CD is simplified. Serverless functions are isolated, making capacity planning and performance monitoring easier.
Microservice development involves
Business complexity doesn’t disappear with any tech stack, but serverless reduces the complexity inherent in service-oriented tech stacks over the past 20 years. Serverless avoids state management tricks, drastically reducing complexity.
Serverless offers the greatest advantage and flexibility in cloud computing. Although not all existing codes can be directly migrated, its natural advantages make it a focus for many vendors. The future is promising.
Despite being heavily invested by multiple cloud vendors, many user codes are still in traditional architectures. Front-end tech stacks like Vercel and Cloudflare offer serverless infrastructure, and AWS Lambda leads in cold start speed.
Wondering if serverless is mature? Our site and ClapDB are entirely built on serverless tech. Experience the magic of serverless with low cost and excellent performance. Welcome to the Serverless era.