Skip to main content
AllDevToolsHub
Back to Glossary

Serverless Computing

A cloud computing model where the provider manages the server infrastructure and automatically scales resources based on demand.

Detailed Explanation

In a serverless model (like AWS Lambda or Vercel Functions), developers write code as discrete functions that run in response to events. You don't manage the underlying servers, and you only pay for the execution time. This allows for rapid development and highly cost-effective scaling for unpredictable workloads.

Quick Summary

Serverless lets you ship code without provisioning or managing servers, the platform scales from zero to thousands of concurrent executions and bills per invocation. The servers exist; you just don't operate them.

Key Takeaways

Key Takeaways

  • Billing is per request and per ms of execution, often with a generous free tier, great for spiky or low-volume workloads.
  • Cold starts (first invocation after idle) add latency; runtimes like Node, Python, Go warm in <500ms, JVM warmer can take seconds.
  • Function size, runtime memory, and execution duration are capped per provider (e.g., Lambda: 10GB RAM, 15 min).
  • Stateless by design, persistent state must live in a database, cache, or object store.
  • Edge functions (Cloudflare Workers, Vercel Edge) run close to users with even tighter limits but near-zero cold starts.
Use Cases

When to use it

  • HTTP APIs and webhooks with variable load.
  • Event-driven pipelines: object uploaded → transform → store.
  • Cron-style scheduled jobs without a long-running worker.
  • Glue code between SaaS systems that would otherwise need a small always-on VM.
Watch out

Common Mistakes

  • Using serverless for steady high-throughput workloads, the per-invocation pricing model becomes more expensive than a VM.
  • Ignoring cold starts on user-facing endpoints, then debugging mysterious p99 spikes.
  • Bundling huge dependency trees into the function, blowing past size limits and worsening cold starts.
  • Forgetting that local filesystem is ephemeral and tiny, everything persistent must go to external storage.
FAQ

Serverless Computing, Frequently Asked

Is serverless cheaper than running my own VMs?

For spiky, low-volume, or zero-to-bursty workloads, yes, often dramatically. For steady high-throughput services, traditional VMs or containers win once utilization is consistent.

What's the difference between Lambda and edge functions?

Lambda runs in regional data centers; edge functions run at CDN PoPs close to users. Edge is faster but limits the runtime, memory, and APIs available (often a V8 isolate rather than a full Node.js).

Can I run a database on serverless?

Not the traditional way, connections are too expensive to open per request. Use serverless-friendly databases (PlanetScale, Neon, DynamoDB, Supabase, Cloudflare D1) that use HTTP or pooled connections designed for ephemeral compute.

Related Terms