When AWS Lambda launched in late 2014, it quietly broke a habit that had defined software deployment for decades: renting a server before running a single line of code. Today, function as a service (FaaS) lets teams ship a piece of logic and let the platform decide how much hardware it needs, spinning capacity up from zero in milliseconds and billing only for the time the code is awake.
That shift sounds simple. In practice, it reshapes how developers think about architecture, testing, cost, and even debugging. This article walks through what FaaS really is, how the major platforms differ, where it breaks down, and what practical choices separate a smooth serverless rollout from an expensive mess.
What Function as a Service Actually Means
FaaS is a cloud execution model where the developer uploads a single function, ties it to an event, and never touches the underlying server. The platform handles provisioning, scaling, patching, and teardown. When no events arrive, no containers run and no bill accrues.
The CNCF Serverless Whitepaper, first published in 2018, frames FaaS around four traits: it is event-driven, stateless, short-lived, and scales automatically with pay-per-invocation billing. That definition is narrower than “serverless,” a term that also covers managed databases, queues, and storage. Conflating the two is one of the most common mistakes in architecture discussions — a team will say “we went serverless” when they only moved a cron job.
A useful mental model: FaaS is the compute layer of a serverless stack. Everything else — object storage, message brokers, identity — is a supporting service.
How the Execution Model Works Under the Hood

A function invocation follows a predictable path. An event fires (an HTTP request, a file upload, a queue message). The platform routes it to a runtime environment. If a warm instance exists, the code runs immediately. If not, the platform cold-starts a new sandbox, loads the runtime, initializes the code, and then executes the handler.
That initialization step is where most surprises live. Global variables, database connection pools, and SDK clients created outside the handler persist between invocations on the same instance — which is exactly why experienced developers move heavy setup out of the handler and into module scope. Doing the opposite adds hundreds of milliseconds to every cold start.
Cold starts remain the defining latency characteristic of FaaS. Providers have responded with mitigations: provisioned concurrency on AWS Lambda, always-ready instances on Azure Functions, and minimum instances on Google Cloud. These features trade money for predictability, and they are usually worth it for user-facing endpoints but wasteful for background batch work.
Execution limits also shape design. AWS Lambda’s maximum invocation duration was raised to 15 minutes in 2018, which is generous compared with earlier caps, but Azure and Google set their own ceilings that differ by hosting plan. Long-running jobs — video transcoding, large report generation — often belong on containers or virtual machines rather than in a function.
The Major Platforms Compared
The three hyperscalers dominate, but their models differ in ways that matter during migration.
| Platform | Launched | Programming model | Notable strength | Watch out for |
|---|---|---|---|---|
| AWS Lambda | 2014 | Handler plus event source mappings | Deepest integration with AWS services | IAM complexity grows fast |
| Azure Functions | 2016 (preview) | Triggers and bindings declared in config | Strong .NET and enterprise tooling | Hosting plan choice changes limits and pricing |
| Google Cloud Functions | 2016 beta, 2018 GA | HTTP and event-driven functions | Clean integration with Firebase and Pub/Sub | Rebranded as Cloud Run functions in 2024 |
Beyond the hyperscalers, open-source options matter for teams with data-residency or vendor-lock-in concerns. OpenFaaS, Knative Serving, and Apache OpenWhisk all let you run FaaS-style workloads on your own Kubernetes cluster. The trade-off is real: you inherit the operational burden the managed platforms were supposed to remove. Self-hosted FaaS is a control decision, not a cost-saving one in most small and mid-sized deployments.
Where FaaS Fits and Where It Fights You
FaaS shines in a specific shape of work: short, bursty, event-triggered, and stateless.
Good fits include image resizing after an upload, webhook receivers, scheduled cleanup jobs, lightweight APIs behind an API routing layer, and glue code that moves data between services. These workloads scale to zero overnight and spike to thousands of concurrent executions without anyone filing a ticket.
Poor fits are equally clear. Long-running computations hit duration caps. Workloads with heavy cold-start sensitivity and no budget for provisioned capacity feel sluggish. Anything requiring persistent local state or a long-lived database connection will fight the model, because each instance is ephemeral and concurrency multiplies connections quickly. Teams that ignore this end up exhausting database connection pools and blaming the platform.
A practical pattern that works well: keep the function thin, push state into a managed service, and connect through a pooler or an HTTP-based data API rather than opening raw connections per instance.
Cost, Billing, and the Traps Nobody Mentions
FaaS billing is typically per-invocation plus per-GB-second of execution, with a free tier. On paper this is cheaper than an idle server. In practice, three patterns quietly inflate bills.
The first is runaway recursion — a function that writes to a queue it also consumes, or a storage trigger that fires on its own output. The second is over-provisioned memory, since CPU scales with memory allocation on several platforms; teams often set memory far above what the code needs. The third is chatty architectures, where a single user action fans out into dozens of invocations, each with its own billed duration.
Date-stamping matters here. Pricing pages change, free tiers shift, and regional rates differ. Any cost comparison older than a few months should be re-run before it informs a decision.
Cost discipline also connects to broader operational hygiene. The same instinct that makes teams check what a background process is consuming — the kind of curiosity behind guides on what an antimalware service executable is and how to fix antimalware service executable high CPU usage — applies to serverless fleets. Someone has to look at the dashboards. (Function as a service)
Security and Observability in a Stateless World
Two operational areas get harder before they get easier.
On security, the surface shrinks in one sense (no servers to patch) and grows in another (every function is an entry point with its own permissions). The fix is disciplined least-privilege identity per function, secrets pulled from a managed store rather than baked into environment variables, and dependency scanning in the build pipeline. A function with broad permissions and a public trigger is a genuine risk, not a theoretical one.
For observability, distributed tracing becomes mandatory rather than optional. A single request may cross an API entry point, three functions, a queue, and a database. Without correlation IDs passed through every hop, debugging turns into archaeology. Structured logging and per-invocation metrics — duration, error rate, cold-start count — should be in place before the first production deploy, not after the first incident.
Standardization efforts are slowly helping. The CNCF’s serverless workflow specification work, now carried forward under the Open Workflow Specification project, aims at portable definitions so orchestration logic is not locked to one vendor. It is worth watching, though governance and scope have shifted since the effort began, so teams should verify current status rather than assume stability.
Practical Tips That Separate Smooth Rollouts From Painful Ones
These come from patterns that repeatedly work in real deployments.
- Keep handlers thin. Parse the event, call a service, return a response. Business logic belongs in testable modules.
- Initialize outside the handler. Reuse SDK clients and connection pools across invocations on the same instance.
- Set memory deliberately. Benchmark at two or three levels; the cheapest setting is rarely the smallest one.
- Use provisioned capacity only for user-facing paths. Background jobs can absorb cold starts.
- Cap concurrency. Reserved or maximum concurrency limits protect downstream databases from thundering herds.
- Test cold starts explicitly. Local emulators hide them; staging environments with realistic traffic do not.
- Automate rollback. Versioned deployments with traffic shifting beat manual recovery every time.
The same principle of deliberate configuration applies when teams evaluate supporting infrastructure — whether that is picking a best VPN service for remote engineering access or choosing a dealership’s service department for a fleet vehicle. Defaults are rarely optimized for your situation.
Local and regional operations face similar choices. A team running field service fleets might weigh a Mitsubishi dealer near me against a Kia auto dealer near me for maintenance scheduling, and the same evaluation discipline — inventory, service options, response time — applies to cloud vendors. Even premium vehicle owners researching a Jaguar dealer or a Land Rover dealer for local maintenance and repair services are doing a comparison of service-level commitments. The pattern is universal: match the provider’s model to your actual workload.
Conclusion
Function as a service is neither a silver bullet nor a passing trend. It is a specific compute model with a specific shape of fit: event-driven, stateless, short-lived, and bursty. Used there, it removes enormous operational overhead and scales in ways traditional infrastructure cannot match. Used outside that shape — long jobs, stateful workloads, latency-critical paths without provisioned capacity — it creates new problems while solving old ones.
The teams that succeed with FaaS tend to share habits: they keep functions small, they measure cold starts instead of guessing, they cap concurrency before production traffic finds the limits, and they re-check pricing rather than trusting a comparison from last year. None of that is exotic. It is just deliberate engineering, applied to a model that rewards discipline and punishes assumptions.
Frequently Asked Questions
What is the difference between serverless and function as a service?
Serverless is the broader category. It covers any managed service where you do not provision or manage servers, including object storage, managed databases, queues, and event buses. FaaS is the compute subset: event-driven, stateless functions that scale automatically and bill per invocation. All FaaS is serverless, but most serverless architectures use several non-FaaS services alongside their functions.
Which cloud provider had the first FaaS offering?
AWS Lambda, launched in late 2014, is generally credited as the first widely adopted FaaS product defined in the narrow, event-driven, per-invocation sense. Earlier platforms offered managed application hosting and auto-scaling, but they did not match the FaaS model of stateless functions triggered by events with billing tied to execution time. The “first” claim depends heavily on how narrowly FaaS is defined.
Are cold starts still a problem in 2025?
They are better managed, not eliminated. Provisioned concurrency, always-ready instances, and minimum instance settings let teams pay to keep capacity warm, and runtime improvements have shortened initialization. But cold starts still appear after scale-out events, deployments, and idle periods. For user-facing endpoints with tight latency budgets, provisioned capacity remains the reliable answer.
Can FaaS handle long-running background jobs?
Usually not directly. Most platforms cap invocation duration — AWS Lambda at 15 minutes, for example — and other providers set their own limits that vary by hosting plan. Long jobs are better handled by containers, virtual machines, or orchestration services that can run for hours. Functions can still trigger and monitor those jobs, which is often the cleanest split.
How do you control FaaS costs?
Start with three levers: right-size memory (CPU often scales with it), cap concurrency to prevent runaway fan-out, and audit for recursive triggers where a function’s output re-invokes it. Then watch invocation counts per user action — chatty architectures multiply billed duration. Finally, re-check current pricing pages, since rates and free tiers change and old comparisons mislead.
Is it worth self-hosting an open-source FaaS platform?
Only when control justifies the overhead. OpenFaaS, Knative Serving, and Apache OpenWhisk are mature enough for production, but you inherit cluster operations, upgrades, scaling tuning, and on-call responsibility — the exact work managed platforms remove. Teams with strict data-residency rules or heavy existing Kubernetes investment benefit; smaller teams usually do not.


