Who Decides the Next Step, and What Deciding Costs
Last timeThe Four Shapes a Split Can Take
A router is a step with an accuracy of its own, and it multiplies everything behind it. The arithmetic for choosing in code against choosing with a model call, on one order-answering service.
Something has to decide which step runs next. On the service this course is
built around, the first thing that happens to a customer's written question
about an order is that it gets sorted, and what the sorting produces decides
which lookup, which draft and which check follow. That decision can be made by
ordinary code reading a field, or by a model call reading the question.
The two look interchangeable in a design document. They are not remotely
interchangeable in the arithmetic, and the gap is larger than almost anyone
guesses before working it out.
The decision is a step, so it has a step's arithmetic
Take the service as three steps behind a chooser: find the matching order and
policy, draft the reply, check the draft against the policy. Each is right 95
times in 100, so a correctly routed request comes out right
of the time, which is 0.857.
Now the chooser. Assume, and this is the assumption everything below rests on,
that a request sent down the wrong branch produces a wrong answer. A refund
question answered by the delivery branch is wrong no matter how good the
delivery branch is.
- how often the whole request comes out right
- how often the chooser picks a branch that is able to answer
- how often step i of the chosen branch is right
- how many steps the chosen branch has, which is three here
- how long the chooser takes, which is 0.8 seconds for a model call and effectively nothing for a rule
- how long step i takes, which is 0.8 seconds throughout this course
So the arithmetic has three cases. A rule that reads a field is right whenever
the field is right, which makes and leaves the system at 0.857. A model
call that sorts as well as the other steps do has , giving
, which is 0.815, and that is exactly the four
step entry of the compounding table from two lessons back and agrees with the
81 in 100 the four step service actually measures. And a router right 9 times in
10 has , giving , which is 0.772.
The lesson stops here
7 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents