Final design
The end-to-end path shows an honest ending. What conditions ensure the result?
Testing live counters alone can conceal missing votes.
Starting point Recalculate the total from accepted votes.
Assumptions for the example case
A fictional audience poll on the best play. Each account can cast at most one immutable vote per poll. Chat has a separate moderation path. All quantities, thresholds and operational objectives of this design are illustrative assumptions.
Live architecture with evidence
Two processing paths
Vote acceptance and aggregation remain separate from moderated chat and fanout.
Test plan with expected outcomes
| Input and initial state | Expected result | Return to an earlier step |
|---|---|---|
| U-51 still without vote → Option A/B and B/A simultaneously | Exactly one vote; first successful acceptance wins. | Step 5/7 |
| V-51 accepted → Identical after the deadline; other option under same key | Original vote; altered replay conflict. | Step 4 |
| Deadline 60,000 ms → Test time 59,999/60,000/60,001 ms | Only first vote allowed. | Step 2 |
| 300,000 votes accepted, 299,999 processed → attempt finalization, then process the last vote | First, tallying remains pending; then the final result is published with a total of 300,000. | Step 9/10 |
U-51 still without vote → Option A/B and B/A simultaneously
- Expected result
- Exactly one vote; first successful acceptance wins.
- Return to an earlier step
- Step 5/7
V-51 accepted → Identical after the deadline; other option under same key
- Expected result
- Original vote; altered replay conflict.
- Return to an earlier step
- Step 4
Deadline 60,000 ms → Test time 59,999/60,000/60,001 ms
- Expected result
- Only first vote allowed.
- Return to an earlier step
- Step 2
300,000 votes accepted, 299,999 processed → attempt finalization, then process the last vote
- Expected result
- First, tallying remains pending; then the final result is published with a total of 300,000.
- Return to an earlier step
- Step 9/10
End-to-end test and unresolved agreements
- First end-to-end path
- Open a poll, test competing votes and the deadline, deliberately delay tallying, and publish the final result only after reaching the complete watermark.
- Clarify before real use
- Identity level, protection against abuse, moderation guidelines, fanout budget and real viewership require your own product decisions.
The end-to-end test shows an accurate final tally.
Test the deadline, concurrency and backlog together.
Testing live counters alone can conceal missing votes.
Acceptance is allowed at 59,999 and blocked at 60,000; return to step 2. Final only at 300,000/300,000; back to 5 and 9.
- Alternative considered
- A happy-path test does not prove correct finalization.
- Trade-off
- A controlled clock and a paused worker are required.
- Reassess
- Additional event formats follow once this behavior is proven.
Try it yourself
Assign deadline and watermark tests to the relevant earlier design steps.
A hint for your attempt
Testing live counters alone can conceal missing votes.
Compare with a possible solution
- Time limit
- Acceptance is allowed at 59,999 and blocked at 60,000; return to step 2.
- Watermark
- Final only at 300,000/300,000; back to 5 and 9.
Apply to your project
What is the equivalent of “The end-to-end path shows an honest final status” in your own project?
Start your own design
Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.
Download design template (.md)Compare the ten tasks with the example case
Purpose and boundary
What is the equivalent of “Vote and Chat Have Separate Effect.” in your own project?
In the example: The domain processing paths remain independent.
Requirements
What is the equivalent of "The server time decides the deadline." in your own project?
In the example: The check time must be less than 60,000 ms.
Scale estimates
Which equivalent has “Fanout exceeds acceptance load.” in your own project?
In the example: Channels and bounded selections reduce deliveries.
Interfaces
What is the equivalent of "Replay remains legible after the deadline." in your own project?
In the example: An identical key returns the original result.
Data and states
Which equivalent has “Final means Completely Counted.” in your own project?
In the example: The final tally binds a complete watermark.
Overall architecture
What is the equivalent of “Chat Scales Regardless of Votes.” in your own project?
In the example: Separate workers and datastores implement different rules.
Critical flow
What is the equivalent of “An account has exactly one winner” in your own project?
In the example: A unique key on account and poll protects acceptance.
Bottlenecks and trade-offs
What is the equivalent of “backlog needs the right measuring point” in your own project?
In the example: Measure ingestion, aggregation and fanout separately.
Operations and security
What is the equivalent of “restoration begins with votes.” in your own undertaking?
In the example: Recalculate the total from accepted votes.
Final design
What is the equivalent of “The end-to-end path shows an honest final status” in your own project?
In the example: Test the deadline, concurrency and backlog together.