In a monolith, all features ship as one application. In a microservices architecture, the same product is split into services such as orders, payments and catalogue. Each one is built, deployed and scaled on its own by the team that owns it.
James Lewis and Martin Fowler wrote the most cited description of the style on 25 March 2014. They described services organised around business capabilities, deployed automatically, keeping logic in the services rather than in shared middleware, and each managing its own data.
How it works
- One business capability per service. "Payments" is a service. "Database access" is not.
- Each service owns its data. Other services never query its tables. They call its API or listen to its events.
- Communication over the network. This can be synchronous (REST or gRPC) or asynchronous (events through Kafka, SQS or similar). An API gateway usually sits in front for external clients.
- Independent deployment. Each service has its own pipeline and can release without coordinating with others. In practice they often run as containers on Kubernetes or ECS.
The framework doesn't matter. Spring Boot, .NET, Node.js and Python services all follow the same rules.
Example: an e-commerce checkout
A customer places an order:
- The order service saves the order as
PENDINGand publishesOrderPlaced. - The inventory service reserves stock and publishes
StockReserved. - The payment service charges the card through the gateway and publishes
PaymentCaptured. - The order service marks the order
CONFIRMED. The notification service sends the email.
No single database transaction covers all four steps. If payment fails, inventory must release the stock. That is a saga, and each event must be published reliably, usually with a transactional outbox. In a monolith, the same flow is a single transaction.
Microservices vs monolithic architecture
| Monolith | Microservices | |
|---|---|---|
| Deploy | One unit | Many, independently |
| Data consistency | Database transactions | Sagas, events, eventual consistency |
| Scaling | The whole app | Each service separately |
| Failure | One bug can take down everything | Isolated if designed well, with timeouts and circuit breakers |
| Operating cost | Low | High: per-service pipelines, tracing, on-call |
Our view, set out in monolith vs microservices for startups, is to start with a modular monolith. Extract a service when there is a specific reason: one part needs very different scaling, isolation (for example to reduce PCI DSS scope), a different language, or several teams keep blocking each other's releases. "It will scale better" is not enough on its own.
Costs teams underestimate
- Distributed data. There are no joins or transactions across services, so reconciliation becomes part of the design.
- Observability. Without distributed tracing, one slow request means searching through logs from ten services.
- Testing. You need contract tests between services and a realistic integration environment.
- Latency. Every network hop adds time and a new way to fail.
A distributed monolith is the worst result: services that must be deployed together because they share a database or call each other synchronously in long chains. It carries the costs of both styles and the benefits of neither.
We help teams decide where service boundaries belong, and split systems safely, through our technology transformation work.