In this post
Serverless functions
- You supply code; the provider runs it on demand and scales it, including to zero.
- You pay for use, which suits spiky or occasional load.
- Limits on run time, memory and start-up latency apply.
Containers
- You package the application with its dependencies and run it on a platform you configure.
- More control over runtime, networking and long-running work.
- More to operate, and you pay for capacity while it runs.
How to choose
- Short, event-driven, spiky work leans towards serverless.
- Steady, long-running or specialised work leans towards containers.
- Check limits and start-up behaviour against your latency needs.
- Estimate cost at your real volume before deciding.
It is not either/or
Many systems use both. Pick per workload, and keep the boundaries clean so you can move one later.
Sources and further reading
- IICTP. Cloud Architecture Practitioner credential page. iictp.org/certifications/cap.
IICTP is a new independent credential and is not ISO/IEC 17024 accredited.