Course contents
On this page
Lesson plan 33: Realtime delivery
Establish a race-free relationship between an initial snapshot and subsequent updates.
Placement: Part 6: Scaling execution and state delivery.
Prerequisites: Lesson 32: Caches and maintained results, plus the earlier dependency chain.
Learning outcomes
- Establish a race-free relationship between an initial snapshot and subsequent updates.
- Explain event order, replay, filtering, fan-out, and authorization changes across reconnects.
- Bound slow-consumer memory and choose resynchronization behavior when history is no longer retained.
- Separate a general mechanism, a documented implementation choice, and an illustrative numerical assumption.
Teaching sequence
- Establish the motivating situation: A reconnecting client misses changes between fetching its snapshot and subscribing.
- Introduce the vocabulary and the correctness obligation before an optimization. Define pub/sub, snapshots plus updates, ordering.
- Develop the mechanism: Establish a snapshot watermark and ordered catch-up, then bound slow-client state.
- Follow the complete worked example: 20000 changes/s times 100 recipients times 80 bytes equals 160 MB/s of payload. Explain the assumptions, intermediate units, and limiting interpretation.
- Extend the scenario to changed load, skew, or failure, explaining replay, subscriptions, fan-out, backpressure.
- 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
A snapshot-watermark timeline shows updates before, during, and after snapshot construction, followed by ordered catch-up without an unprotected gap. 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.