SteelReed

Search

Search posts, questions…

MicroservicesQuestion 2 / 24

Junior

Which principles do you follow when designing microservices?

Short answer

Each service owns one business capability, with high cohesion inside and loose coupling outside. The concrete rules follow: its own data, talking via APIs or events, independent deploys, and designing for failure.

One business capabilityHigh cohesion insideLoose coupling outsideOwn DB, API or eventsIndependent deploysDesigned for failure

3 points to say:

  1. One service = one business capability (ordering, payment), not a table; splitting too fine creates a distributed monolith.
  2. High cohesion inside, loose coupling outside: own data, communication via APIs/events, versioned contracts.
  3. Independent deploys, design for failure (timeouts, circuit breakers, idempotent consumers) and observability from day one.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.