System Design Atlas

Live and on-demand video streaming

04 / 10Worked example

Change commands and retries

How does segment identity remain immutable when multiple transcoders submit results?

Scale alone does not ensure consistent retry behaviour. This proposed API binds the role, business object, change payload and expected state to each new intent. An idempotency key identifies the same intent after a response is lost.

Starting point Plan 30 Gbit/s delivery separately from the control API.

Assumptions for the example case

Fictitious example design: a live channel followed by an on-demand archive; three quality levels; six-second segments; time-limited playback rights. Figures and quality targets are illustrative test assumptions. Rights acquisition, global rights advice, full DRM implementation and interactive video conferencing are outside scope.

Retries and new intent

Completion event · segment, generation and digest

Completion eventS-120 · Generation 4 · Digest
Fertigmeldung → ObjektbelegTesting digest
Object completion evidenceFinalised + immutable
Identical → one M-61 entryDifferent → quarantineGET → bytes, no new record

An identical event is a replay; a different digest blocks S-120 and prevents overwriting the manifest.

A worker reports the same segment again. Check sequence, generation and digest together. Same identity with other bytes is visibly blocked.

Proposed domain API contracts

  1. POST/channels/{id}/segment-completions

    Report a completed segment ready for publication.

    Input
    Authenticated transcoder, L-61, generation, sequence 120, duration 6 s, variant data, digest and completed object reference.
    Result
    One completion record; an identical digest is deduplicated, while a different digest under the same identity triggers quarantine.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  2. POST/channels/{id}/publications

    Activate manifest generation.

    Input
    Editorial team, L-61, expected generation, segment references with complete evidence and rights profile.
    Result
    M-61 references only confirmed objects. Lack of completion prevents activation.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  3. POST/playback-authorizations

    Validate the time-limited playback right.

    Input
    Viewer identity, L-61, R-61 and server-side current time.
    Result
    Authorisation applies only within [12:00,13:00) UTC; the result binds the channel and validity interval for protected requests.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  4. GET/channels/{id}/segments/{sequence}

    Retrieve protected immutable segment.

    Input
    Channel, generation, sequence and valid proof of authorization at the delivery edge.
    Result
    Matching bytes, or rejection if the right has expired; retrieval creates no new segment identity.
    Retry behaviour
    Repeating a read creates no business effect; the returned current state may change between requests.

Address immutable segments

Address immutable segments

Check the sequence, generation and digest together.

A worker reports the same segment again.

Different bytes under the same identity are explicitly blocked.

Alternative considered
Overwritten segment paths provide alternating content.
Trade-off
Error correction needs a new generation.
Reassess
Source change requires a different continuity model.

Terms in this step

Address immutable segments
Different bytes under the same identity are explicitly blocked.

Try it yourself

Two workers provide the same segment identity with the same and different digest. Predict both outcomes.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
The same digest is published once; the second completion event refers to the same object.
Second part of the solution
Different digests under the same generation and sequence produce quarantine. Overwriting would provide changing bytes under the same identity.

Apply to your project

Which corresponding assumption would you check first in your project when a source change requires another continuity model?

Step 5 examines: Time-limit rights.