Split an app into small services that each do one job and can be deployed on their own.
Microservices split one big application into many small services. Each one does one business job, runs on its own, has its own data, and talks to the others over the network.
In a microservices architecture, each service owns one business capability, such as Catalog, Cart, Payments or Shipping. A service is small enough for a team to understand fully, and independent enough to be released without asking the others.
Services talk through APIs (REST, gRPC) for direct questions, or through events and message queues for things that can happen later. Each service keeps its own database. No other service may read its tables. If the Orders service needs a customer's name, it asks the Users service.
Because the services are separate programs, they can use different languages and databases, and each can run many copies by itself. In front of them there is usually an API gateway, and behind them there is shared tooling for logs, metrics and tracing.
| Way to split | Example | Note |
|---|---|---|
| By business capability | Orders, Payments, Shipping | The most common and usually best approach |
| By domain (Domain-Driven Design) | A bounded context such as Billing | Boundaries follow how the business thinks and talks |
| By data ownership | The service that owns the customer table | Helps avoid shared databases |
| By technical layer | A โdatabase serviceโ or โUI serviceโ | Usually a mistake: every change touches every service |
A simplified model. Every process is assumed to be up 99.9% of the time, and a page needs every service it calls, so availability multiplies. Timeouts, retries, caching and fallbacks (see Circuit Breaker) bring the real numbers back up.
| Term | Meaning in easy words |
|---|---|
| Microservice | A small, independently deployable service that owns one business capability |
| Bounded context | A clear boundary in which one model and one set of words apply (from domain-driven design) |
| Database per service | Each service owns its data and no one else touches it directly |
| API Gateway | A single entry point that routes client requests to the right service |
| Service discovery | How services find the current address of each other |
| Saga | A series of local transactions with compensating steps, used instead of one distributed transaction |
| Eventual consistency | Data in different services becomes the same after a short delay |
| Distributed tracing | Following one request as it passes through many services |
| Distributed monolith | Services that must be released together, with the costs of both styles |
| Orchestration vs choreography | A central coordinator tells services what to do, or services react to each other's events |
| Blast radius | How much a single failure can damage |
| Choice | We gain | We lose |
|---|---|---|
| Split into services | Independent scale, release and failure | Network cost and many things to run |
| Database per service | Loose coupling and free technology choice | No joins or single transactions across services |
| Synchronous calls | Simple and instant answer | Tight coupling and chains of failure |
| Asynchronous events | Loose coupling and resilience | Complex flow and delayed results |
| Many small services | Very focused teams | More deployments, more network hops, more to monitor |
| Few bigger services | Less overhead | Less independence |