Skip to main content

External Exercises

Unlike math or algorithms modules, microservices exercises are design exercises and operational drills, not LeetCode-style problem sets. Use the lanes below to build reps.

How To Use This Page

  1. Finish the relevant concept pages first.
  2. Solve at least one drill yourself without looking up notes.
  3. Only then open external material.
  4. Keep a mistake log with tags like shared db, entity service, timeout missing, retry no backoff, sync fan-out, contract break, lockstep deploy, broken trace propagation.

Lane 1: Decomposition Design Exercises

Use this lane when you can recite the theory but freeze when asked to decompose a real system.

  • microservices.io patterns index -- microservices.io/patterns/index.html. Pick 3 decomposition patterns and write a one-page comparison.
  • Sam Newman's boundaries chapter exercises -- Building Microservices 2nd ed., chapter "Identifying Microservice Boundaries". Do the end-of-chapter exercises on a SaaS or finance domain.
  • Self-curated decomposition kata (from practice page 01): pick 3 industries and decompose each:
    • Industry 1: E-commerce retailer.
    • Industry 2: SaaS project-management (or collaboration) tool.
    • Industry 3: Ride-sharing or food-delivery logistics.

Target outcomes:

  • 3 completed decompositions with owned-data tables
  • 2 written anti-pattern audits ("here is why this is not a distributed monolith")
  • 1 expand-contract plan for a cross-service rename

Lane 2: Contract and Data Drills

Use this lane when your API designs drift toward entity services or when you can't write an OpenAPI fragment without looking it up.

  • OpenAPI specification -- spec.openapis.org/oas/latest. Skim once, then write one complete mini-spec (3 paths, 4 schemas) for a hypothetical service.
  • JSON Schema -- json-schema.org/learn. Write an event schema for the OrderConfirmed/OrderCancelled/ShipmentDispatched trio.
  • Pact Foundation workshop -- github.com/pact-foundation/pact-workshop-js (or the equivalent for your language). Run through the 12-step workshop.
  • Confluent Schema Registry compatibility docs -- if you plan to use Kafka, read the 3-page section on compatibility modes (BACKWARD, FORWARD, FULL, NONE).

Target outcomes:

  • 2 OpenAPI specs authored from scratch, schema-valid
  • 2 event schemas with event_version field and example payload
  • 1 CDC test authored in Pact for a real interaction
  • 1 written-down compatibility cheatsheet for your team

Lane 3: Resilience and Communication

Use this lane when the theory is clear but you cannot confidently wire the four primitives onto a real call path.

  • resilience4j docs -- resilience4j.readme.io/docs for JVM.
  • Polly docs -- pollydocs.org for .NET.
  • opossum -- github.com/nodeshift/opossum for Node.js.
  • Envoy retry and circuit breaker docs -- envoyproxy.io/docs for mesh-level resilience.
  • Release It! exercise set -- Michael Nygard's book has end-of-chapter exercises on stability patterns. Do the "analyze this incident" exercises for chapters on Timeouts, Circuit Breakers, and Bulkheads.

Target outcomes:

  • 3 call paths specified in full (timeout / retry / breaker / bulkhead table)
  • 2 sequence diagrams drawn for partial-failure scenarios
  • 1 small code experiment (any language) implementing a circuit-breaker state machine

Lane 4: Observability and Operations

Use this lane for tracing, deployment independence, and operational habits.

Target outcomes:

  • 1 local demo where a request traces across two services end-to-end
  • 2 expand-contract plans written for actual contract changes you would like to make
  • 1 written self-assessment of your real team topology

Self-Curated Problem Set

Build a custom set with these minimums:

  • 3 full decompositions across different industries
  • 3 contract authorings (OpenAPI + event schema + CDC test for each)
  • 3 resilience specifications for different call paths
  • 2 trace designs with at least one retry and one bottleneck
  • 1 full ADR (architecture decision record) memo arguing for or against microservices for a chosen product

Completion Checklist

  • Completed at least one lane in full
  • Logged at least 12 tagged mistakes with corrections
  • Wrote at least 3 full decompositions
  • Authored at least 2 complete contract specs (sync + async for each)
  • Drew at least 2 resilience sequence diagrams
  • Ran at least one local tracing experiment

If you cannot do all of the above, your fluency is not where you think. Redo the weakest lane.