Course contents
On this page
Lesson plan 18: Computation boundaries
Trace the work removed by moving computation across an application-to-database boundary.
Placement: Part 3: Turning requests into execution.
Prerequisites: Lesson 17: Execution engines, plus the earlier dependency chain.
Learning outcomes
- Trace the work removed by moving computation across an application-to-database boundary.
- Compare embedded calls, server RPCs, stored procedures, and sandboxed modules in deployment and resource ownership.
- Explain why removing round trips does not remove validation, isolation, durability, or external-side-effect obligations.
- Separate a general mechanism, a documented implementation choice, and an illustrative numerical assumption.
Teaching sequence
- Establish the motivating situation: A contended transfer holds state while making several application-to-database round trips.
- Introduce the vocabulary and the correctness obligation before an optimization. Define embedded databases, database servers, stored procedures.
- Develop the mechanism: Compare the same invariant and durability contract across process boundaries; trace where waiting occupies ownership.
- Follow the complete worked example: Reducing four 1 ms database round trips removes 4 ms from the dependent path before other costs. Explain the assumptions, intermediate units, and limiting interpretation.
- Extend the scenario to changed load, skew, or failure, explaining sandboxing, modules, serialization, locality.
- Connect the mechanism to a documented implementation and an alternative with a different workload fit. Close by stating the remaining cost and the next lesson dependency.
Required chapter material
Use a complete execution trace or worked calculation, supported by an annotated static diagram or table. Include language-neutral pseudocode or labeled SQL when it clarifies the mechanism. State preconditions, ownership, visibility, and failure boundaries for algorithms. Describe operational costs as well as the normal path. All questions raised in the narrative must be resolved in the text.
Visual explanation
Two sequence diagrams perform the same protected operation through dependent RPCs and through colocated computation, with identical correctness boundaries. The accompanying prose explains the arrows, state changes, or table entries so the lesson remains understandable in a plain Markdown reader.
Editorial checks
Confirm that the numerical example agrees with its units and assumptions. Check that a faster path preserves the stated contract, or explicitly identify the changed guarantee. Keep hypothetical figures separate from product measurements. Explain both an appropriate use and a limitation of the case design. Check terminology against the glossary and links against the course index.