The monolith's boundaries, today. No solutions.md before submitting.
Exercise 1 — The honest matrix
- Complete §1's table for YOUR context (team, volume, compliance) with NUMBERS: how many deploys/week would 5 microservices mean? How much would the saga cost per flow (how many of your features would become distributed)?
- The case in favor: write the best REAL argument for microservices for TicketFlow (not the marketing): which one, and what would have to happen for it to outweigh its cost?
- The monolith's case: the counter-argument with the same data: the decision written in 5 lines with its review (48's ADR).
Exercise 2 — The modularization
- Reorganize (or draw) your repo into §2's 5 modules: what goes in each and what is left over (24's utils? the shared junk drawer)? The module map with its own language (52: ubiquitous per context).
- The public interface: write tickets' and payments'
api.py(the public functions and their types). What shows up when writing it (functions crossing modules underneath: the imports the boundary forces up)? - The boundary test: implement the CI test (§2) forbidding
from tickets.modelsin payments/ (and every forbidden combination). Run the CI: how many violators did it catch in YOUR repo? Migrate them to the public interfaces.
Exercise 3 — The contracts between modules
- The synchronous one: checkout (payments) calls
tickets.reservar(): write the contract test between modules (35 applied to the import: the signature? the exceptions? the summary?). What happens if tomorrow the function changes signature — who catches it? - The asynchronous one: the
PaymentSucceededevent (payments→tickets via outbox, 25/30): write the event's contract test (minimum payload? who consumes it and what does it do?). What gets lost making it synchronous (the single transaction? the receiver's coupling)? - The written rule: in
docs/adr/, the sync/async choice rule between modules (§3) with the repo's 2 examples as case study. 8 lines.
Exercise 4 — The threshold and the strangle
- The 5 thresholds (§4) applied to TicketFlow: which fires first and with which real event (56's PCI? the ×10 volume?)? Write the ADR's trigger with the measurable condition.
- The simulated strangle: plan (49: phases with estimate) the extraction of payments: which phases (duplicate with flag? canary? dethrone?) and how much it costs WITH exercise 2's boundary done vs WITHOUT it? The two numbers, the comparison.
- The exit plan: the day payments gets extracted: what changes in the repo (the outbox stops being a table and becomes an external stream? 32's saga crosses the network?)? List the 5 architectural changes extraction forces (the ones the prepared boundary already mitigated).
Exercise 5 — Defending the decision
- The pitch to the imaginary CTO asking for microservices "because we scale": it is 51's answer: the real metrics (how many replicas does the monolith use today? how many would it need separately?) and the alternative proposal (the modular monolith + the documented trigger?). Max 10 lines.
- The new teammate's question: "why not microservices?" — the answer in 3 sentences with the link to the ADR. The test: do they understand it without context?
- The close: your personal architecture rule in 3 lines (monolith first? boundary before physics? trigger before fashion?) — paste it into your onboarding (48).
Submit
Paste the matrix with numbers, the public interfaces with the boundary test, the threshold's ADR and the compared strangle plan. Next: Lesson 54 — Resilience.