Skip to main content

Module 2: Architecture Patterns & Modular Monoliths: Mistake Clinic

This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.


Module-Specific Mistake Radar

Start with these traps. Replace or extend them with real mistakes from your own work.

Mistake to look forWhere it shows upSymptomRepair evidence
Finishing Style Selection Lab with only a final answerStyle Selection LabThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Modular Monolith Boundaries Workshop with only a final answerModular Monolith Boundaries WorkshopThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Microservices Decomposition Clinic with only a final answerMicroservices Decomposition ClinicThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Architecture Pattern Katas with only a final answerArchitecture Pattern KatasThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Treating Layered Architecture: The Default, Its Pros and Sinkholes as vocabulary instead of a toolLayered Architecture: The Default, Its Pros and SinkholesThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.
Treating Pipeline Architecture: Pipe-and-Filter for Data Transforms as vocabulary instead of a toolPipeline Architecture: Pipe-and-Filter for Data TransformsThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.

Practice Mistake Checks

Pull any miss from these checks into your mistake log.

Style Selection Lab

Source: practice/01-style-selection-lab.md

For each statement, identify the error in 2 sentences:

  1. "We are modernizing the stack, so we are moving to microservices."
  2. "Our monolith is slow. We will split it into services to make it faster."
  3. "We can share the database across our microservices to keep things simple."
  4. "We use Kafka, so our architecture is event-driven."
  5. "Each service has one REST endpoint. We are very granular."
  6. "We started with microservices because we will need them eventually."

Modular Monolith Boundaries Workshop

Source: practice/02-modular-monolith-boundaries-workshop.md

Identify the issue in each code/structure fragment (2-3 sentences each):

  1. A package named shared.utils with 23 files and Ca = 18, Ce = 12.
  2. A Java service class CheckoutService with methods create_order, send_marketing_email, export_for_audit, lookup_gdpr_consent.
  3. A Python codebase where checkout/domain/pricing.py imports catalog.persistence.product_repo.
  4. A Ruby Packwerk config with enforce_dependencies: false for a package that imports 9 others.
  5. An ArchUnit rule that checks nothing because the should().onlyDependOnClassesThat() clause is missing.
  6. A "modular monolith" whose CI has no architecture test; boundaries are documented in a wiki page only.

Microservices Decomposition Clinic

Source: practice/03-microservices-decomposition-clinic.md

For each scenario, identify the anti-pattern in 2-3 sentences and prescribe the fix:

  1. "Our 12 microservices each have their own schema, but they all live in the same Postgres cluster and freely join across schemas in reports."
  2. "Every deploy to the order-service requires a coordinated deploy to the customer-service and the billing-service."
  3. "A request to view a single order touches 9 services."
  4. "We have 40 services; each one exposes 1-2 endpoints."
  5. "Our observability story is 'we tail logs from 18 hosts in tmux.'"
  6. "We extracted 6 services but have no platform team. The CI pipelines were copy-pasted from the monolith."

Repair Protocol

For each real mistake:

  1. Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
  2. Name the hidden assumption.
  3. Repair the artifact.
  4. Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
  5. Add one retrieval card beginning with Check... before... or Do not use... when....

Mistake Log

DateMistakeSymptomRoot causeRepair evidenceRetrieval card
StarterPick one radar row aboveExplain how it would fail in this moduleName the assumptionAdd a counterexample or corrected artifactWrite the card before closing the page

Completion Standard

  • At least five real mistakes are logged.
  • At least two mistakes include a counterexample or failing test.
  • At least one mistake connects to an older semester skill.
  • At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.