System Design Atlas

Live sports interaction for large audiences

10 / 10Worked example

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

BrowsersVote + chat
Interaction APIAccount + Deadline
Vote partitionVotes by Poll + Account
Aggregation workerWatermark
Result projectionIntermediate + Final
Chat APIChat acceptance
Chat storeVersions
Moderation workerRelease / Removal
FanoutworkerChannels
Live transport serviceExternal
Browser → Interaction APIVote
Interaction API → Vote partitionAccount + poll atomically
Vote partition → Aggregation workerCommitted votes
Aggregation worker → Result projectionTally + watermark
Browser → Chat APIChat contribution
Chat API → Chat storeC-51
Chat store → Moderation workerSubmitted posts
Moderation worker → Fanoutworkerrelease version
Fanoutworker → Live Transportation ServiceChannel Event
Live Transportation Service → BrowserLive Update

Vote acceptance and aggregation remain separate from moderated chat and fanout.

Topology from step 6, with timing evidence at acceptance, completeness at aggregation and removal at chat; return links to steps 2, 5, 9.

Test plan with expected outcomes

Input and initial stateExpected resultReturn to an earlier step
U-51 still without vote → Option A/B and B/A simultaneouslyExactly one vote; first successful acceptance wins.Step 5/7
V-51 accepted → Identical after the deadline; other option under same keyOriginal vote; altered replay conflict.Step 4
Deadline 60,000 ms → Test time 59,999/60,000/60,001 msOnly first vote allowed.Step 2
300,000 votes accepted, 299,999 processed → attempt finalization, then process the last voteFirst, 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.

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?

Transfer the decisions and their counterexamples to the editable design template.

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
  1. 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.

  2. 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.

  3. Scale estimates

    Which equivalent has “Fanout exceeds acceptance load.” in your own project?

    In the example: Channels and bounded selections reduce deliveries.

  4. 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.

  5. Data and states

    Which equivalent has “Final means Completely Counted.” in your own project?

    In the example: The final tally binds a complete watermark.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.