Part 7 of 7 · 3 min read
Exercises
Easy
Easy 1: Name the filters (20 minutes)
A pipeline reads a CSV, drops rows with no email, lowercases emails and writes to a database. Label each step as producer, tester, transformer or consumer.
Done when: four steps labelled.
Hint
A tester checks a condition. A transformer changes the data.
Easy 2: Count the quanta (20 minutes)
A system has 6 services, 1 UI and 1 database shared by all. How many quanta? What would change if the database were split in two and the services split in two groups?
Done when: two numbers with reasons.
Hint
Services that share one database form one quantum.
Easy 3: Broker or mediator (20 minutes)
For each need pick broker or mediator: very high throughput with simple reactions; a trade that needs a manual approval step; a clear audit of every step and restart on failure.
Done when: three choices with reasons.
Hint
Control and recovery point to the mediator.
Medium
Medium 1: Draw a broker flow (30 minutes)
A user signs up. Design a broker-topology flow with at least four processors for account creation, welcome email, loyalty points and a sales alert. List initiating and processing events.
Done when: a table like the order example, with who listens to what.
Hint
The initiating event is the sign-up. Each processor announces its own result.
Medium 2: Fail the payment (30 minutes)
In the broker topology the payment processor crashes after "order-created". List what the other processors do, what the user sees, and what is inconsistent. Then show how a mediator topology would handle the same crash.
Done when: two walk-throughs and a list of inconsistencies.
Hint
In the broker topology, nobody owns the state of the request.
Medium 3: Library split (30 minutes)
A service-based system has 9 services and 40 tables in 5 data domains. Design the shared library layout. Count the services rebuilt for a change in each domain with a made-up usage table.
Done when: a library plan and a table of rebuild counts.
Hint
Put each data domain behind one library, plus a controlled common one.
Hard
Hard 1: Choose per part (45 minutes)
An e-commerce company has a nightly sales report, a storefront, a stock system and a fraud check on every payment. Assign one of the three styles to each part, justify, and describe how they connect.
Done when: a table with style, reason and one connection per part.
Hint
A fraud check on every payment reacts to an event but needs a quick answer.
Hard 2: Request-reply design (45 minutes)
A quote service must answer within 2 seconds, using a pricing service over queues. Design the queues, headers and timeouts with the correlation id technique. State what happens on timeout and on a late reply.
Done when: a message flow with headers and a timeout rule.
Hint
A reply with a correlation id that no one waits for any more is dropped.
Hard 3: Service-based to microservices (50 minutes)
A service-based system with 7 services and one database has two services that need to scale 20 times more than the rest. Argue whether to split those two out into finer services, and what would have to happen to their data.
Done when: a proposal with costs, data plan and a go or no-go.
Hint
Scaling needs may be met by running more copies of the one service first.