What is serverless architecture?
Serverless architecture is a way of building software in which the cloud provider owns the underlying infrastructure and your team owns only the code and its configuration. You write functions or container images, connect them to managed services such as databases, queues and API gateways, and the platform decides when and where they run. Server management, capacity planning and patching move to the provider, so a serverless architecture eliminates most of the routine work of keeping server infrastructure running, and developers can focus on writing code instead.
The name is misleading. Physical servers still sit in a data center somewhere, and you simply never touch them. With traditional servers, dedicated servers or virtual machines, your team picks the machine size, installs updates and keeps the operating system healthy. In serverless environments, infrastructure management belongs to the provider, and you pay for what actually runs.
Serverless computing is not an alternative to cloud computing. It is one cloud computing model within it, placed at the end of the range where you manage the least.
Two building blocks make up most serverless applications:
- Function as a Service (FaaS): you deploy discrete functions, each triggered by an event such as an HTTP request, a file upload or a timer. AWS Lambda, Azure Functions and Cloud Run functions, formerly Google Cloud Functions, are the best-known examples.
- Backend as a Service (BaaS): you rely on third-party managed backend features, such as user authentication or a hosted database, instead of building them yourself.
Production systems usually combine serverless functions for custom business logic with managed services for storage systems, messaging and identity.
How serverless architecture works
Serverless architecture works by turning application logic into small units that wake up when an event arrives. The platform allocates computing resources, runs the code and releases the resources afterwards. In practice, a serverless computing architecture has three layers: event sources, functions or containers, and managed services. AWS describes the Lambda model in three steps: Lambda receives an event, the runtime reshapes it into a format your code understands, and your handler processes it. Lambda runs each function inside a secure, isolated execution environment that it manages. When more events arrive, it creates additional environments, and when demand falls it stops the ones nobody needs.
A typical web request moves through five stages:
- A browser or mobile app calls an API gateway endpoint. Amazon API Gateway is AWS's managed service for creating, publishing, securing and monitoring REST, HTTP and WebSocket APIs.
- The gateway applies throttling rules and, if you configure one, an authorizer that handles user authentication.
- The gateway hands the request to a function through a proxy integration.
- The function runs your business logic and reads or writes database storage, object storage or messaging queues as needed.
- The function returns its result, and the gateway relays the response to the caller.
Not every flow begins with a person. In an event-driven pipeline, a file upload, a queue message or a timer fires the function, and nothing waits for a reply. The same pattern drives real-time data processing of device and log streams.

Key serverless concepts
| Term | What it means |
|---|---|
| Event | Anything that triggers a function, such as a request, a new database item or a schedule |
| Handler | The entry point in your code that receives the event |
| Function instance | One running copy of your function; the platform adds copies as traffic grows |
| Cold start | Extra latency while the platform prepares a new execution environment |
| Concurrency | How many function instances run at the same moment |
| Timeout | The longest time a single execution may run before the platform stops it |
Stateless by design
AWS says that Lambda can reuse an existing execution environment after a function finishes, and that reuse lets a function keep things like database connections between calls. Treat that as an optimization, not a guarantee, because serverless applications must never depend on it. Any state that must survive, such as sessions, carts or workflow progress, belongs in a database or cache.
When a process spans several steps, orchestration services track progress and retries for you. Azure Durable Functions use checkpointing to build serverless workflows that recover from failures, and AWS offers Step Functions for the same kind of job.
Types of serverless architecture: FaaS, BaaS, serverless containers and Knative
Serverless architecture is no longer limited to functions. Serverless solutions fall into a few families that differ in what you package and how much control you keep from the cloud provider.
| Type | What you deploy | Examples | Typical fit |
|---|---|---|---|
| Function as a Service (FaaS) | Short event-driven functions | AWS Lambda, Azure Functions, Cloud Run functions | APIs, triggers, scheduled tasks, data processing |
| Backend as a Service (BaaS) | Nothing; you consume managed backend features | Managed authentication, hosted databases | Sign-in, mobile backends |
| Serverless containers | A container image | Google Cloud Run, Azure Container Apps | Web services that need a custom runtime |
| Serverless on Kubernetes | Knative services | Knative | Portable workloads on any Kubernetes cluster |
A few platform details are worth knowing before you choose:
- Google Cloud: Cloud Functions became Cloud Run functions in 2024, and Google says second-generation functions run on the Cloud Run platform. Many older articles still use the previous name Google Cloud Functions. Cloud Run scales a revision to zero when it gets no traffic by default, and you can keep a minimum number of instances warm.
- Azure Functions: Microsoft recommends the Flex Consumption plan for new apps, calls the Consumption plan a legacy option, and says the Linux Consumption plan retires in September 2028. Check the hosting plan before you design around it.
- Knative: this open-source layer adds serverless behavior to Kubernetes. It graduated from the Cloud Native Computing Foundation in 2025, and it runs wherever Kubernetes runs, including on-premises.
AWS Lambda arrived in 2014 and set the pattern that the other serverless platforms followed, which is why most vocabulary in this guide uses Lambda terms.
Benefits of serverless architecture
Serverless architecture offers real advantages, though each depends on the workload.
- Lower operational overhead. The provider operates the host operating system, the virtualization layer and the facilities, as AWS explains in its Lambda shared responsibility model. Routine backend operations, from patching to scaling, shift to the provider, so server management shrinks and your development teams spend less time maintaining servers and planning capacity.
- Automatic scaling. Platforms add capacity as traffic grows and remove it when traffic falls. On Cloud Run and Azure Container Apps, idle services can scale to zero.
- Pay-for-use pricing. You are billed for requests and execution time, not for idle machines, which suits spiky traffic.
- Smaller deployable units. Each function ships and scales on its own, so a change in one place rarely forces a release of everything else.
- Faster delivery. Serverless computing removes machine setup, so teams can focus on writing business logic, shorten software development cycles and test ideas quickly.
On serverless adoption, the best official data point is older than most guides admit. In the CNCF 2021 annual survey, 39% of respondents said they used serverless technology, and most of them used hosted platforms. The sample is the cloud-native community, not every company. Provider moves since then point the same way: Google merged Cloud Functions into Cloud Run, and Microsoft steers new apps on its functions service to the Flex Consumption plan.
These serverless benefits are not automatic. Savings depend on traffic patterns, function duration and memory size, and the limits below can outweigh the advantages for the wrong workload.
Limitations and trade-offs of serverless architecture
Serverless architecture caps execution time, memory and concurrency, and it trades control for the convenience of hands-off server management. Most guides say limits exist without naming them, so here are the defaults for AWS Lambda.
| Limit | AWS Lambda default |
|---|---|
| Function timeout | 900 seconds (15 minutes) |
| Memory | 128 MB to 10,240 MB |
| Concurrent executions | 1,000 per Region, can be raised; new accounts start lower |
| Synchronous payload | 6 MB for request and response |
| /tmp storage | 512 MB to 10,240 MB |
These figures come from the AWS Lambda quotas page, checked in November 2026. Newer options such as Lambda Managed Instances allow longer maximums for some invocation types, so confirm the current page before you design around a limit. Microsoft and Google publish their own limits.
Cold starts
A cold start is the delay that occurs when a platform has to prepare a new execution environment before it can run your code. AWS says that loading the code, starting the runtime and running initialization code account for most of that latency. Lambda offers two documented ways to reduce it:
- SnapStart restores functions from a cached snapshot and can cut startup to under a second in good cases. It supports Java 11 and later, Python 3.12 and later, and .NET 8 and later, and works only on published versions.
- Provisioned concurrency keeps a set number of environments initialized and ready to answer in double-digit milliseconds. It suits strict latency targets and carries its own charge.
Cloud Run and Azure offer similar controls, such as minimum instances. Pinging a function every few minutes keeps a single instance warm at best and does nothing for a sudden burst.
Vendor lock-in
Triggers, APIs and managed services differ across providers, so moving a serverless architecture is rarely a copy-and-paste job. This vendor lock-in is the price of deep integration with a cloud provider's platform. To limit it, keep business logic apart from the function handler, define infrastructure as code, and consider containers or Knative where portability matters.
Debugging, testing and monitoring
Functions are short-lived and distributed, so one request can cross multiple functions and managed services. Unit tests on application code are easy, but integration tests are harder in serverless environments. Serverless testing tools such as the AWS SAM CLI run functions locally in a Lambda-like environment before you deploy. For production, Amazon CloudWatch records API Gateway and Lambda activity, and third-party platforms such as Datadog Serverless Monitoring collect metrics, traces and logs from Lambda functions.
Cost and state
Pay-per-use is cheapest for bursty workloads and can cost more than an always-on server under heavy, sustained load. The pricing section below shows the arithmetic. And because functions are stateless, anything that must persist lives in external storage, which adds design work and latency.
Serverless vs containers vs virtual machines vs traditional servers
A serverless architecture and its alternatives differ mainly in what you manage and how you pay.

| Model | You manage | Scaling | Billing | Best for |
|---|---|---|---|---|
| Serverless functions | Code, permissions, configuration | Automatic, including scale to zero on some platforms | Requests and execution time | Short, event-driven or spiky workloads |
| Serverless containers | The container image and its dependencies | Automatic, handled by the platform | Per use, platform-specific | Web services that need a custom runtime |
| Containers on Kubernetes | Containers, cluster configuration, orchestration | Configured by you through an orchestrator | The nodes you run | Steady, high-traffic services |
| Virtual machines | Operating system, patches, runtime, capacity | Added by you or by auto-scaling rules | Provisioned capacity, used or not | Long-running, predictable workloads |
| Dedicated or physical servers | Hardware and everything above it | Manual, by adding hardware | Fixed cost | Maximum control, strict compliance or performance needs |
Serverless architecture vs microservices
These are not competing choices. Microservices describe how you divide an application into independent services, and serverless describes how those services run. You can deploy each microservice as a function, a serverless container or a long-running container.
Serverless architecture vs Kubernetes
Neither is better in general. Kubernetes gives you control over the runtime and the software stack and suits steady traffic, but your team operates the cluster. Serverless removes that work and can scale to zero, which suits event-driven and spiky workloads within platform limits. Many teams combine serverless functions with containers: containers handle the steady core, and functions handle events and background work. Kubernetes on its own is not serverless; Knative is what adds that behavior.
Serverless vs PaaS
A platform as a service typically keeps your application running on allocated capacity, while serverless runs code per event and bills per execution. The line is blurring, because services such as Cloud Run and Azure Container Apps sit between the two.
Is EC2 serverless?
No. Amazon EC2 provides virtual servers whose size and operating system you choose and maintain. Lambda, by contrast, runs your code without you provisioning or managing the servers behind it.
Serverless architecture examples and use cases
Serverless excels where work is triggered by events, runs briefly and arrives unevenly. These serverless architecture examples show the common patterns:
- API backends. API gateways in front of functions serve a REST interface and scale with demand. Azure lists building a web API from HTTP triggers as a core Functions scenario.
- File and image processing. An upload triggers a function that resizes an image, generates a thumbnail or transcodes media. Google Cloud's announcement of Cloud Run functions names thumbnail generation and text analysis among the typical cases.
- Real-time data processing. Functions react to events from devices, logs or streams. The same Google announcement mentions teams using functions to transform data and load it into BigQuery.
- Scheduled tasks. Reports, backups and data synchronization run on a timer and cost nothing between runs.
- CI/CD pipelines. Repository events can trigger functions that start builds or tests, so continuous integration and continuous delivery steps run only when something changes.
- User authentication and security checks. Functions can verify tokens, handle sign-in steps or scan new resources for misconfigurations. API Gateway can use Lambda functions to authorize requests.
- Workflow automation and webhooks. An order event can update inventory, send a confirmation and notify shipping as separate small functions, which is a common way of automating tasks across systems.
Serverless shines for variable workloads such as promotions, seasonal spikes and unpredictable traffic, because capacity follows demand instead of being bought in advance. These are the main use cases of serverless architecture, and most real systems mix several of them.
Does Netflix use Lambda?
Yes, for specific workloads. A 2014 AWS case study describes Netflix planning to use event-based triggers in Lambda to automate media encoding, validate backup completions and instance deployments, and monitor AWS resources. A 2022 AWS re:Invent session shows Netflix using Lambda alongside Amazon EC2 for multi-account deployments. Netflix is not a fully serverless company. It uses serverless where event-driven functions fit and other compute where they do not.
How serverless pricing works, and when always-on is cheaper
Most serverless platforms bill for requests and for code execution time, scaled by memory. On AWS Lambda, the published rates for x86 functions in US East, in the first pricing tier, are $0.20 per million requests and $0.0000166667 per GB-second. The free tier covers 1 million requests and 400,000 GB-seconds each month. These figures were checked in November 2026 and vary by region, architecture and volume.
| Workload | Compute | Requests | Estimated monthly cost |
|---|---|---|---|
| Example A: 3 million requests, 120 ms, 1,536 MB | 540,000 GB-s, 140,000 billable | 2 million billable | $2.73 |
| Example B: 100 million requests, 200 ms, 1 GB | 20 million GB-s, 19.6 million billable | 99 million billable | about $346 |
Example A comes straight from AWS's own pricing page. Example B is our arithmetic from the same rates: 19.6 million billable GB-seconds at $0.0000166667 is about $327, plus $19.80 for requests. Both exclude API Gateway, logging and data transfer.
Now compare Example B with an always-on server. At 100 million requests a month, the average load is about 39 requests per second. AWS's pricing page lists an m7g.xlarge instance at $0.1632 per hour on demand in US East, which is roughly $119 for a 730-hour month. On paper, a single instance is cheaper at that sustained load, and a fair comparison also needs a second instance for redundancy, a load balancer and engineering time for patching. At Example A's traffic the picture reverses: serverless costs a few dollars, and an idle server still bills for every hour.

The rule of thumb is simple. The more idle time a workload has, the more serverless saves, and the closer it runs to constant full utilization, the stronger the case for containers or always-on VMs. To keep costs predictable, set budget alerts, cap concurrency so a traffic spike or a retry loop cannot flood downstream systems, and right-size function memory.
Security and observability basics
Security in a serverless architecture is a shared job. AWS states that it operates and controls components from the host operating system and virtualization layer down to physical facilities, while you remain responsible for your code, configuration, data and permissions. AWS also says Lambda execution environments run in microVMs that are dedicated to a single AWS account.
Practical habits that follow from that split:
- In serverless applications, give every function its own execution role with only the permissions it needs, as the AWS guidance on least privilege recommends.
- Keep credentials in a secrets service, not in code.
- Validate input and protect API endpoints with authentication, authorization and rate limiting.
- Encrypt sensitive data in transit and at rest, using the data protection controls your platform provides.
Serverless security tools from security and observability vendors add scanning and runtime protection on top of these basics. For observability, track latency, errors, cold starts and downstream dependencies for every function, and trace requests across functions and managed services.
When to use serverless architecture and when not to
Serverless architecture is a strong fit when:
- Work is triggered by events such as uploads, queue messages, webhooks or schedules.
- Traffic is spiky or unpredictable, with long idle periods.
- Each task finishes in seconds or minutes and keeps no state in memory.
- You are prototyping or building an MVP and want to skip infrastructure setup.
- You need glue code between managed services.
Consider containers, virtual machines or dedicated servers when:
- A process runs longer than the platform allows, such as the 15-minute Lambda timeout.
- Traffic is steady and close to constant utilization, where always-on capacity often costs less.
- Latency requirements are strict and cold-start mitigations are not enough.
- You need control over the operating system, hardware or runtime.
- The application keeps heavy state in memory.
- Portability across providers is a hard requirement.
A quick test: ask whether the workload is event-driven, whether each task is short, whether traffic is uneven and whether you can accept provider-specific services. Three or four yes answers point to serverless. Most teams end up with a hybrid, mixing serverless solutions for events and background work with containers for steady core services.
How to start with serverless architecture and migrate gradually
Most development teams adopt serverless in stages, moving one workload at a time and leaving the rest on the current stack. A practical path:
- Pick one low-risk, event-driven workload. A report job, a file-processing task or a webhook handler is a good first candidate.
- Choose a platform that fits your stack. AWS Lambda, Azure Functions and Cloud Run functions all cover the basics, so match the choice to your team's languages and your existing cloud provider. Compare serverless solutions on limits, pricing and tooling, not on feature lists.
- Define everything as code. Amazon's Serverless Application Model (AWS SAM) is an open-source framework whose templates extend AWS CloudFormation with shorthand for functions, APIs and event sources. The Serverless Framework works similarly, with a serverless.yml file for functions, events and resources. Either one is a serverless deployment framework; pick one per service, because mixing multiple deployment frameworks in one codebase makes reviews harder. Our guide to infrastructure as code covers the wider tooling choices.
- Automate delivery and testing. Run unit tests on function code, integration tests in a staging environment, and deploy through CI/CD pipelines that cover continuous integration and continuous delivery. Automated testing catches permission and configuration errors before users do.
- Set up monitoring and budgets from day one. In your cloud provider account, create spend alerts and alarms on error rates and latency before the first production release.
- Replace the old system piece by piece. Put an API gateway in front of the legacy application and move one route or task at a time to new functions, a pattern often called the strangler fig approach.
Keep the first serverless application small enough to finish. The goal is to learn your provider's limits, pricing and tooling on a workload where a mistake is cheap.
Serverless in practice: a lending data integration on Azure
A real project shows how the pieces above fit together. Grand Financial, Inc., a US company that sells vehicles with financing, collected loan offers from lending partners by hand. Sales agents logged in to external portals, read loan terms and retyped them into internal systems, which was slow and error-prone.
Softellar's case study describes the serverless pipeline that replaced it:
- Orchestration: Azure Durable Functions retrieve offers from six financial institutions, handling authentication, retries and data freshness checks.
- Data layer: the functions normalize the incoming data into one schema in Azure SQL Database, and Azure Blob Storage keeps historical snapshots and sync logs for audit.
- Access: a .NET Web API exposes the data, and a React portal lets agents search, filter and compare offers. The frontend is served through Azure CDN.
- Cost model: the backend runs on a consumption-based plan, with scheduled syncs twice a day.
The design shows why serverless architecture fits this kind of workload. The sync jobs run briefly on a schedule and sit idle the rest of the day, so paying per execution beats keeping servers on. Durable Functions keep the state and retry logic that plain stateless functions would leave to you. Softellar reports an 80% reduction in manual processing time; the project took five specialists eight months.
If you are deciding whether a workload belongs on serverless, containers or a mix, Softellar's cloud architecture and Azure pages describe how its engineers approach those decisions, and its cloud migration service covers moving existing systems step by step.
Conclusion
Serverless architecture represents a shift in who carries the operational burden: the cloud provider takes server management, scaling and patching, and you take code, data and cost control. It is a strong fit for event-driven, short-lived and unevenly loaded work, and a poor fit for long-running processes, steady high-throughput services and workloads that need tight control or portability.
Check three things before you commit: the platform's published limits, your real traffic pattern against the pricing formula, and how you will monitor and test distributed functions. Start with one low-risk workload, measure it, and expand from there. Most mature teams end up with a mix of serverless, containers and VMs, each used where it is cheapest and simplest to run.
Sources
- Lambda developer guide: how Lambda runs your code
- Lambda developer guide: core concepts
- Lambda quotas (checked November 2026)
- Lambda SnapStart and provisioned concurrency
- Lambda pricing (checked November 2026)
- Lambda: data protection
- Security overview of Lambda: the shared responsibility model
- AWS Compute Blog: building a solid security foundation for Lambda
- Amazon API Gateway developer guide
- AWS Serverless Application Model FAQs
- Amazon EC2
- AWS case study: Netflix and Lambda, 2014
- AWS re:Invent 2022 session: Netflix multi-account deployments
- Microsoft product page: functions
- Microsoft Learn: functions overview
- Google Cloud: Cloud Functions is now Cloud Run functions
- Google Cloud: Cloud Run instance autoscaling
- CNCF: Knative graduation announcement, 2025
- CNCF Annual Survey 2021
- Serverless Framework documentation
- Datadog documentation: Serverless Monitoring for Lambda
- Softellar case study: data integration and automation for a car dealer

