Microservices and API Gateway
When splitting a system into services pays off, how services find each other, what a gateway does, and how sagas replace distributed transactions.
Monolith first
A monolith is one deployable application containing all features. A microservice architecture splits the system into small services, each owning one business capability (orders, payments, search), deployed and scaled independently and talking over the network (HTTP/REST, gRPC, or messages).
| Monolith | Microservices | |
|---|---|---|
| Deploy | One unit; any change redeploys everything | Each service on its own schedule |
| Scaling | Scale the whole app | Scale only the hot service |
| Team fit | Small team, one codebase | Many teams, clear ownership |
| Debugging | One stack trace | Requests cross many services; needs tracing |
| Data | One database, real transactions | Database per service; no cross-service transactions |
| Failure modes | In-process calls rarely fail | Every call can time out or fail |
| Cost | Low operational overhead | Needs CI/CD, containers, monitoring, platform team |
Quick check
Which situation most justifies moving from a monolith to microservices?
1 of 7