Serverless Computing: What Users Like and Dislike
In this article
Serverless computing lets you run code without managing servers—you upload functions, and the cloud provider handles scaling, patching, and availability. Most users like the reduced operational overhead and pay-per-use pricing, but they dislike cold starts, vendor lock-in, and debugging difficulties. This guide walks you through the common likes and dislikes, so you can decide if serverless fits your project.
What You'll Need
- Basic understanding of cloud computing (e.g., what a function is).
- Familiarity with at least one serverless platform (AWS Lambda, Azure Functions, Google Cloud Functions) or a framework like Serverless or AWS SAM.
- No code required—just a willingness to learn from real-world user feedback.
Step-by-Step
- List the main benefits users report. Start with the most common: no server management. Users don't provision or patch servers; the provider does it. This saves time and lets developers focus on code.
- Note the cost model. Users like paying only for execution time (measured in milliseconds) and requests, not for idle servers. For spiky or low-traffic workloads, this can be cheaper than renting a VM.
- Recognize automatic scaling. Serverless scales instantly with demand. Users don't configure auto-scaling policies; the platform adds instances as needed. This is a big plus for unpredictable traffic.
- Acknowledge the built-in high availability. Providers replicate functions across multiple availability zones, so users get redundancy without extra setup.
- Identify the biggest dislike: cold starts. When a function hasn't run for a while, the first invocation may take 1–5 seconds extra. Users dislike this for latency-sensitive apps. Mention that keeping functions warm (e.g., by periodic pings) reduces it but costs a bit more.
- Point out debugging difficulty. Users find it hard to test and debug serverless functions locally because the environment differs from production. They also miss traditional logging and tracing; you need to use cloud-specific tools like AWS X-Ray or Azure Application Insights.
- Discuss vendor lock-in. Each provider has its own function format, event sources, and CLI. Users dislike being tied to one cloud. Mitigation: use open-source frameworks like Serverless or Knative, but note that they still have provider-specific parts.
- Mention execution limits. Functions have timeouts (e.g., 15 minutes on AWS Lambda) and memory limits. Users dislike these constraints for long-running tasks. They often work around it by splitting work into smaller chunks or using step functions.
- Cover the lack of direct control. Users can't choose the OS, runtime version, or network configuration easily. Some miss having a dedicated server for custom setups. If you need specific libraries or low-level control, serverless may not suit.
- Summarize the user sentiment. Most users recommend serverless for event-driven, short-lived, and variable workloads (like webhooks, image processing, or IoT). They advise against it for long-running, stable, or latency-critical applications.
Common Mistakes
- Assuming serverless is always cheaper. For constant, high-traffic workloads, a reserved VM can be less expensive. Users often forget to calculate the cost of invocations plus data transfer.
- Ignoring cold starts in architecture. If you build a real-time API without warm-up strategies, users will notice delays. Plan for it from the start.
- Writing monolithic functions. Users sometimes put too much logic in one function, making it slow and hard to debug. Break it into smaller, single-purpose functions.
- Not setting up proper monitoring. Without cloud-native logging and metrics, you're blind. Users often skip this and regret it during outages.
- Forgetting about state. Serverless functions are stateless—you can't store data in local memory between invocations. Users who try to use local variables for caching get unexpected results. Use external storage like Redis or S3.
Tips
- Start with a small, non-critical function. For example, a webhook that processes form submissions. That way you learn the workflow without risking your main app.
- Use the provider's local testing tools. AWS SAM CLI, Azure Functions Core Tools, and Google Cloud Functions emulator let you run functions locally. This reduces debugging pain.
- Design for cold starts. Use lightweight runtimes (e.g., Node.js or Python) instead of heavier ones like Java. Also, keep your deployment package small.
- Set up a budget alert. Providers let you set billing alerts, so you don't get a surprise bill. Users recommend this as a first step.
- Use environment variables for configuration. Avoid hardcoding settings; that makes it easier to move between environments.
Troubleshooting
If your function is slow on the first call: That's a cold start. Try increasing memory (which often also increases CPU and reduces cold start time), or use a provisioned concurrency feature if your provider offers it. If that's not an option, consider a scheduled warm-up ping.
If you can't debug why a function fails: Check the cloud provider's logs. For AWS, use CloudWatch; for Azure, use Application Insights; for Google, use Cloud Logging. Look for stack traces and error messages. Also, test locally first.
If your costs are higher than expected: Review your invocation count and duration. You might be calling functions in a loop or using too much memory. Use the provider's cost explorer to see which functions are expensive.
If you hit the timeout limit: Refactor the function to do less work, or split it into multiple functions that run in parallel. For long-running jobs, use a step function or a queue-based approach.
If you can't access a database from your function: Check VPC settings. Many serverless functions run outside your VPC by default. You'll need to configure VPC access, but note that this can add cold start latency. Also, ensure your database's security group allows connections from the function's IP range.
Frequently Asked Questions
Is serverless really serverless?
No, there are still servers, but you don't manage them. The cloud provider provisions and runs them for you. You only see your code.
Can I run any programming language on serverless?
Most providers support popular languages like Node.js, Python, Java, Go, and .NET. Check your provider's list, as not all runtimes are available everywhere.
How do I handle authentication in serverless?
Use API Gateway (AWS) or similar services to add authentication. You can also use third-party identity providers like Auth0. Your function receives the event with user claims.
Can I use serverless for a website backend?
Yes, many users do. You can serve APIs and static assets. However, for very high-traffic sites, a traditional server might be more cost-effective.
What is the difference between serverless and containers?
Containers require you to manage the container runtime and orchestration (like Kubernetes). Serverless abstracts all that away. Containers give you more control, but serverless is simpler.
Is serverless secure?
It's as secure as you make it. The provider secures the infrastructure, but you must secure your code, dependencies, and permissions. Follow the principle of least privilege for IAM roles.