How do microservices differ from a serverless (Function-as-a-Service) architecture, and when would you choose one over the other?

Last updated 3 July 2026

  • A microservice is a long-running process or container you operate and scale. A serverless function (e.g. AWS Lambda) is a stateless, event-triggered unit the platform runs, scales to zero, and bills per execution.

  • Choose serverless for event-driven, spiky, or infrequent workloads where low ops and pay-per-use win (accepting cold starts).

  • Choose microservices for steady high traffic, long-running or low-latency work, runtime control, and avoiding vendor lock-in. Many systems mix both.

  • https://www.geeksforgeeks.org/system-design/microservices-vs-serverless/
  • https://gist.github.com/svaza/a1db71dd1c05d3a1d2eb45efa4fa4fd1
  • https://github.com/alirezarezvani/claude-skills/blob/main/agents/personas/startup-cto.md
All Microservices interview questions