Home DevOps

A practical guide to when to use FaaS in your product

Functions as a service (FaaS) shines for bursty, event-driven work. Learn where it fits in your stack and where containers do better.

FaaS-Functions as a Service

Functions as a service (FaaS) offers a simple deal. You write a function, your cloud provider runs it when something happens, and you pay only while it’s working. For the right workload, that deal is hard to beat. For the wrong one, it brings surprise bills, latency complaints and awkward workarounds. Knowing when to use FaaS comes down to a few questions about your traffic, your run times and how much you value portability.

What FaaS does well

FaaS is built for short, stateless tasks triggered by events. A file lands in storage, a webhook arrives, a message hits a queue or a timer fires, and your function runs, does one job and exits. The provider handles servers, patching and scaling. Amazon Web Services (AWS) Lambda, Azure Functions and Google Cloud Run functions are the best-known options.

For independent software vendors (ISVs), the natural fits are the small jobs around the edges of your product. That might mean handling a payment gateway webhook, generating a PDF receipt or resizing product images after upload. It could also mean syncing point-of-sale (POS) transaction data to your cloud back end overnight, or connecting your platform to a customer’s software-as-a-service (SaaS) tools. These tasks are bursty and short, and they don’t need a server running around the clock.

When to use FaaS based on cost

The pricing model is FaaS’s biggest strength and its biggest trap. When nothing is running, you pay almost nothing. That makes FaaS ideal for low or unpredictable traffic, new features you’re still testing, and workloads that spike during business hours and sit quiet overnight.

The math flips under steady, high volume. Per unit of compute, FaaS usually costs more than a container or virtual machine (VM) that’s busy all day. Once a function runs constantly, you’re paying a premium for elasticity you aren’t using.

Watch the extra costs, too. An application programming interface (API) gateway, logging, monitoring and data transfer all add up. So does any option that keeps instances warm, because those are typically billed even when idle. Before you commit, model your costs at today’s volume and at ten times that volume, then compare the results with a container running the same code.

Cold starts and latency

When a function hasn’t run recently, the platform has to spin up a fresh environment before it can respond. That delay is called a cold start. For background jobs, nobody notices. For customer-facing requests, such as a checkout page or a card authorization at the register, an extra second can be the difference between a smooth experience and a support ticket.

You can shrink cold starts by keeping deployment packages small, choosing lighter runtimes and moving heavy setup work out of the startup path. Every major provider also offers a way to keep instances warm. Those options cost money and wear away the pay-only-when-used advantage, so test response times under realistic traffic before you promise customers a service-level agreement (SLA).

Vendor lock-in is a design choice

Your function code is usually portable. Everything around it isn’t. Triggers, event formats, identity and access management (IAM) rules and the managed services your functions call are specific to each provider. The more you lean on them, the harder a future move becomes.

You can limit that risk. Keep business logic in plain modules that don’t depend on a provider’s software development kit (SDK). Write thin handlers that translate platform events into your own data structures. Define your infrastructure as code. If you sell to enterprises that may require deployment in their own cloud or data center, take lock-in seriously from day one.

Long-running and stateful work

FaaS platforms cap how long a single function can run, and functions don’t keep state between calls. Batch processing, video transcoding, large data imports and machine learning training don’t fit that model. You can split long jobs into steps and chain them with an orchestration service (such as AWS Step Functions, Azure Durable Functions or Google Workflows), but that adds complexity. Often it’s simpler to run the work in a container or a batch service built for the job.

When containers or a traditional server is the better choice

Containers are usually the better option for steady traffic, long-running processes, persistent connections such as WebSockets, custom runtimes and cases where portability matters. You still get automation and scaling, and you control the environment.

A traditional server or VM still has its place. Think legacy applications, software with hardware or licensing ties, predictable round-the-clock workloads, and regulated deployments where you need full control of the operating system. Many ISVs end up with a mix: containers or servers for the core application, and functions for the event-driven work around it.

Platform limits to check before you build

On AWS Lambda, synchronous invocations are capped at 15 minutes. AWS now allows up to 90 minutes for asynchronous and event source mapping invocations on its Lambda Managed Instances option. AWS also began billing for the initialization phase across all Lambda configurations on August 1, 2025, so cold-start time now counts toward your bill.

On Azure Functions, the classic Consumption plan has a default timeout of 5 minutes and a maximum of 10. Microsoft’s Flex Consumption plan offers optional always ready instances to reduce cold starts. When you enable them, you’re billed for the memory provisioned across those instances.

On Google Cloud Run functions, HTTP functions can run for up to 60 minutes, while event-driven functions are limited to 9 minutes.

Use FaaS when / avoid FaaS when

Use FaaS when:

      • Work is triggered by events and finishes in seconds or a few minutes
      • Traffic is low, spiky or hard to predict
      • You want to ship a small feature without managing infrastructure
      • Occasional cold-start delays won’t hurt the user experience

Avoid FaaS when:

      • Traffic is steady and high enough that a busy container costs less
      • Jobs run longer than your platform’s timeout or need to keep state
      • Users expect consistently low latency on every request
      • Customers require portability across clouds or on-premises deployment

When you’re unsure, start with a single low-risk workload, measure its real cost and latency for a month, and let that data shape your next decision.


Datacap - We Solve Payment Problems
Jay McCall

As Co-founder of DevPro Journal, Jay McCall combines 25 years of experience in journalism and IT content creation with a passion for thought leadership. With a sharp focus on creating engaging, practical content, the publication addresses the unique needs of software developer leaders, offering strategies to build sustainable and fulfilling businesses.

×