Course contentsShow
← Software Engineering
Lesson 1527 of 1,93344. Cloud Architecture PatternsFree lesson

When Serverless is and Isn't Appropriate

Evaluate use cases where serverless excels (event-driven, bursty workloads) versus where traditional models are better.

When Serverless is and Isn't Appropriate

What you'll learn: How to evaluate whether serverless architecture fits your workload or if traditional compute models serve you better.

The Core Decision

Serverless excels in specific scenarios but isn't a universal solution. Think of serverless like a taxi service—perfect for occasional trips with unpredictable timing, but expensive if you're commuting daily for hours. The key is matching your workload's characteristics to serverless strengths and weaknesses.

Where Serverless Shines

Event-driven workloads are serverless's sweet spot. Image processing triggered by uploads, webhook handlers, scheduled data transformations, and API endpoints with sporadic traffic all benefit from pay-per-invocation pricing and automatic scaling.

Bursty or unpredictable traffic patterns mean you only pay when functions run. If your service gets 10 requests per hour normally but 10,000 during a marketing campaign, serverless scales automatically without provisioning infrastructure.

Low-maintenance operations matter when team size is limited. No servers to patch, no capacity planning, and minimal operational overhead make serverless attractive for teams focused on business logic.

Where Traditional Models Win

High-throughput sustained workloads become expensive with per-invocation pricing. A function processing 1000 requests per second continuously costs more than dedicated compute instances.

Long-running processes hit execution time limits (typically 15 minutes max). Video encoding, complex batch jobs, or ML training need traditional compute or containers.

Latency-sensitive applications suffer from cold starts. Real-time gaming, high-frequency trading, or sub-100ms APIs often can't tolerate the occasional startup delay, even with warm instance optimizations.

Stateful workflows requiring persistent connections (WebSockets, database connection pooling) don't fit the stateless function model well.

Key Takeaway: Choose serverless for event-driven, intermittent workloads where you value auto-scaling and minimal operations over predictable latency and cost. Use traditional compute for sustained high-throughput, long-running, or latency-critical applications.