Microservices

Independent services working together

API Gateway
Auth
Node.js
Payment
Python
User
Go
✓ Benefit
Scale independently
⚠ Tradeoff
More complex
Tools: Docker • Kubernetes
When to Use:
Large apps with different scaling needs per feature
"Design microservices with API gateway and service discovery"

What is Microservices?

Microservices Architecture splits your app into independent services that communicate over APIs. User Service, Payment Service, Notification Service—each runs separately, has its own database, and can be deployed independently. Opposite of Monolith (everything in one codebase). Benefits: team autonomy, independent scaling, language flexibility. Costs: complexity, network calls, distributed debugging. Most startups should start with monolith.

When Should You Use This?

Use microservices when you have multiple teams stepping on each other in a monolith, when different parts need different scaling (payments need 100x more capacity than admin panel), or when you want to use different tech stacks per service. Don't use microservices until monolith is truly painful—usually 20+ engineers. Start with monolith, extract microservices later when clear boundaries emerge.

Common Mistakes to Avoid

  • Microservices on day 1—premature optimization, adds complexity before PMF
  • Too many tiny services—"nano-services" are hard to manage
  • Wrong service boundaries—services that constantly talk to each other defeat the purpose
  • No API versioning—breaking changes break other services
  • Distributed monolith—microservices that share a database aren't really independent

Real-World Examples

  • Amazon—Pioneered microservices, each team owns a service
  • Netflix—600+ microservices, each team deploys independently
  • Uber—Started monolith, split into microservices at scale
  • Shopify—Monolith for years, extracted microservices for specific domains (payments, shipping)

Category

System Design Patterns

Tags

microservicesarchitecturedistributed-systemsscalingsystem-design

Permalink