Serverless Anti-Patterns
Recurring serverless mistakes make systems slow, expensive, fragile, or difficult to evolve over time.
This chapter is deliberately practical. It focuses on recurring mistakes that make serverless systems slow, expensive, fragile, or difficult to evolve. Most of these problems are not caused by managed infrastructure itself. They come from carrying old habits into a different execution model and then mistaking the resulting pain for a platform limitation.
Read the lessons in order. They move from oversized function design into chatty network behavior, hidden statefulness, and finally hidden platform coupling. The thread across all four is that serverless works best when boundaries, state, and dependencies are made explicit rather than being smuggled into handlers, runtime assumptions, or vendor-specific shortcuts.
In this section
- The Function-as-a-Monolith Anti-Pattern
Explain oversized functions with too many responsibilities, large dependency graphs, and tangled business logic. Show why this recreates monolith pain inside serverless.
- Chatty Functions and Network Thrash
Describe the anti-pattern where functions make too many small calls to databases, services, or third parties. Explain how this hurts latency, cost, and resilience.
- Stateful Assumptions in Stateless Compute
Show the dangers of assuming local memory, local disk, or execution reuse as durable state. This anti-pattern is subtle and common.
- Vendor Lock-In Through Hidden Coupling
Explain how deep platform-specific integrations, opaque workflow logic, and platform-native assumptions can make future migration or multi-cloud strategy harder than expected.