· Leo  · 4 min read

Frankly, Your Business Doesn't Deserve to Use Servers

Frankly, Your Business Doesn't Deserve to Use Servers

Frankly, Your Business Doesn't Deserve to Use Servers

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.

The Challenge of Business Fluctuations

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.

Daily PV traffic chart

Finer Time Scale Fluctuations

Even zooming into a 30-minute segment, the workload isn’t stable.

Half of a Hour PV traffic chart

As PV fluctuates wildly, how often are the resources planned for the peak actually used?

Cost Advantage of Serverless

Here’s a direct cost comparison:

AWS Lambda vs. AWS EC2 Costs

Using the AWS Mumbai Region prices:

ResourceLambdaC5.4xlarge EC2
CPU2vCPU16vCPU
Memory2G32GiB
Local Storage512M0
Network0.6Gbps10Gbps
Price0.0000000333 USD/ms0.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.

Serverless KO Service in billings

Operational Costs: Serverless vs. Service

Service Operational Costs

In the past 20 years, maintaining a reliable online cluster involved extensive work

  • capacity planning
  • service installation and deployment
  • performance monitoring
  • configuration management
  • CI/CD,
  • disaster recovery.

Serverless Operational Costs

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.

Development Costs: Serverless vs. Service

Service Development Complexity

Microservice development involves

  • mocking dependencies
  • handling version dependencies
  • network communication costs
  • ensuring idempotent service APIs
  • Lack of a full-link perspective in cross-service debugging of business issues, requiring debugging within each application or relying on global log tracking and monitoring systems.
  • Each service, even if a pod, has to handle multiple business requests, potentially exposing sensitive information of multiple users in logs and monitoring.

Serverless Simplification

  • No need to mock services; use the same code in production, just clone data.
  • Serverless functions can run multiple versions without consuming resources.
  • Network performance impact is minimal, and calls between functions are compiled into one function to avoid cold starts.

New Issues with Serverless

  • Cold Start Problems
  • Single serverless functions have limited resources and are unsuitable for handling large resources. Code needs redesign to distribute tasks among more functions. Microservice design principles don’t apply; state should be externalized, and cross-service calls are unsuitable.
  • Lambda is billed based on memory usage and runtime. Avoid using unnecessary memory; runtimes that start slowly and use a lot of memory are not suitable for Serverless. However, reducing runtime improves user experience.

Complexity Shift

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.

Future Outlook

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.

Current State of Serverless Tech Stack

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.

Conclusion

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.

Share:
Back to Blog

Related Posts

View All Posts »