Part 8 of 8 · 2 min read
Exercises
Easy
Easy 1: Sort the code (20 minutes)
List 15 areas of a shop's code (for example "price rules", "delivery slots"). Assign each to a context and mark those that fit nowhere.
Done when: a sorted list and a list of leftovers.
Hint
Code that fits nowhere may be a missing context.
Easy 2: Pick a driver (20 minutes)
For each case, name the BM driver: a coming sale event, a team move to another country, a new audit rule, an experiment with a new language.
Done when: four cases matched to four drivers.
Hint
Pace of change, team structure, security and technology.
Easy 3: Strangler or rewrite (20 minutes)
Give two conditions in which you would use a strangler and two in which a clean rewrite might be chosen instead.
Done when: four conditions with a reason each.
Hint
A strangler needs a point where requests can be intercepted.
Medium
Medium 1: Cut a foreign key (30 minutes)
An invoices table has a foreign key to a products table in another context. Write the steps to remove the key, the new call, and two business questions to ask.
Done when: a step list and two questions.
Hint
First stop the read, then drop the key.
Medium 2: Draw a strangler (30 minutes)
Draw a proxy in front of an old application with five features. Show the order in which features move and how to switch each back.
Done when: a drawing and a table of moves with rollback.
Hint
Move the least tangled feature first.
Medium 3: Transaction choices (30 minutes)
An operation changes three tables that will end up in three schemas. For each of the three options in section 6, describe how it would work and what might go wrong.
Done when: three paragraphs and a recommendation.
Hint
Think about who is waiting while each option runs.
Hard
Hard 1: Full split plan (45 minutes)
A monolith has Catalog, Orders, Payments and Reporting, with one database. Plan the sequence: code seams, data seams, schema split, service split. Give the first, second and last split with reasons.
Done when: an ordered plan with reasons and checks at each stage.
Hint
Split the data before the application.
Hard 2: Keep the reports (45 minutes)
After a split into four databases, finance wants the same monthly report. Compare calls to services, a data pump and events for it. Choose one and state what it costs.
Done when: a comparison table and a decision.
Hint
Large volumes rule out calls one by one.
Hard 3: Whiteboard test (50 minutes)
Take your plan from Hard 1. Walk three use cases across the new boundaries with CRC cards. List every call, every circular call and any chatty pair, and say what you would change.
Done when: three traces, a list of problems and a revised design.
Hint
Two services that call each other in every trace may belong together.