Highlights

Contents

Part VIII
08

Case study: private video delivery

We combine verified storage, access, routing, freshness, and source protection into one request. Each cache decision must preserve the representation and permission contract. We will trace playback, recover origin failure, reconcile all rates, and explain the role of every component.

CHAPTER ATLAS / FOLLOW THE READING PATHCHAPTER ATLAS / FOLLOW THE READING PATH1Edges, origins, hits andmisses2TTL and Cache-Control3Invalidation andversioned URLs4Pull vs push CDN andshielding5Signed URLs and privatedelivery6Geographic routing7Video and image delivery8Case study: private videodelivery

#Section 29Publish before issuing delivery access

Heron’s storage workflow finishes verification and processing under immutable source and rendition identities. The database then publishes a pointer to the allowed rendition and manifest. Only after that state transition does the app issue viewer access appropriate to the delivery path.

The viewer resolves the delivery hostname and reaches the selected edge. The edge applies required access validation, derives the normalized content key, and checks usable retained state. On a miss it uses the configured shield and restricted origin path, preserving representation policy and validators. A hit returns the same permitted bytes without moving write authority to the edge.

PLAYBACK: APP GRANTS AND POINTS, EDGE CHECKS AND SERVES, ORIGIN STAYS LOCKEDPLAYBACK: APP GRANTS AND POINTS, EDGE CHECKS AND SERVES, ORIGIN STAYS LOCKEDapppermission + pointeredgeaccess checkcache or shieldreuserestricted originverified bytes
Figure 14.34Full playback path. Metadata publication, capability validation, and content reuse have separate owners.
EVERY SIGNED REQUEST IS CHECKED AT THE EDGE, HIT OR MISSEVERY SIGNED REQUEST IS CHECKED AT THE EDGE, HIT OR MISSvieweredgeoriginsigned GET c7-v1miss: authorized fetchimmutable bytespermitted responsenext request: validated again
Figure 14.35Private delivery trace. The repeated access check remains necessary even when the content lookup can hit.

The cached manifest can point to many objects, so its freshness and signed policy scope matter. Test the whole reference chain rather than fetching a standalone public image and claiming the private video path is verified.

#Section 30Origin failure and bounded stale service

Origin stops responding while edges retain representations. Immutable content with valid access may continue serving according to its retained-state policy. Mutable score or manifest state needs its explicit freshness and stale allowance. An origin error is not permission to ignore expired access or expose a private cached response.

Under the illustrative age policy, a response at age 320 has 20 seconds of staleness and fits a 30-second stale-if-error window beyond lifetime 300. At age 340 it exceeds that window. The fallback should stop or obtain another permitted source, rather than silently extending its own limit until recovery.

ORIGIN DOWN: SERVE ONLY IF ACCESS IS VALID AND THE COPY IS INSIDE ITS STALE WINDOWORIGIN DOWN: SERVE ONLY IF ACCESS IS VALID AND THE COPY IS INSIDE ITS STALE WINDOWoriginaccess valid?age ≤ 300 + 30?age 320: serveage 340: refusedegradation keeps its declared bound and grants no new authority
Figure 14.36Failure decision. Origin reachability, permission, and representation age are independent conditions.

When a shield or CDN path fails, direct origin fallback can overload the very source it was meant to protect. Apply bounded admission and protect expensive dynamic generation. A recovery plan should include warm state, cold state, and the visibility of stale-mode activation to operators and users where it affects decisions.

#Section 31Reconcile rates through each layer

The illustrative API path produces 1,000 viewer requests per second, 950 edge hits, and 50 original misses at 95% hits. Equal response payload gives 2,000,000 viewer bytes per second and 100,000 original miss bytes per second. Cache layers can change the final origin count, but they cannot erase viewer egress.

The separate illustrative video path creates 8,333.333 recurring segment requests per second. With 100 edges and ideal equivalent-key collapse, edge-to-next-layer segment fetches are 16.666666 recurring per second. One shared ideal shield sends 0.166666 recurring fetches per second, while viewers still receive 25,000,000,000 payload bytes per second.

REQUESTS SHRINK LAYER BY LAYER; VIEWER BYTES STAY AT 25,000,000,000 B/SREQUESTS SHRINK LAYER BY LAYER; VIEWER BYTES STAY AT 25,000,000,000 B/Sviewers8,333.333/sedges16.666/sshield0.166666/ssegment requests: 50,000 ÷ 6, then 100 ÷ 6, then 1 ÷ 6the bytes to viewers are unchanged by any of it
Figure 14.37Ideal single-rendition model. Different variants, errors, retries, and range rules change reuse.

A constant hot identity revalidated independently at 100 edges every 300 seconds would create a simplified 100/300, or 0.333333 recurring refresh requests per second. Synchronized expiration can concentrate those requests into a burst. Average arithmetic should be paired with an explicit temporal trace and request-collapsing policy.

#Section 32What each component contributes

The database publishes exact immutable references and visibility state. The application verifies permission and signs the intended access policy. DNS or network routing selects a serving path. The edge validates access and chooses a usable representation; the shield can aggregate source fetches, and restricted origin provides verified bytes.

Each box has a different failure question. A valid signature cannot repair a missing object. A fresh entry cannot authorize its viewer. A nearby edge cannot make stale score state current. A correct immutable object cannot update a cached manifest without the manifest’s own policy.

FOUR BOXES, FOUR REASONS TO EXISTFOUR BOXES, FOUR REASONS TO EXISTapp + metadatapermission, published idroutingchoose a usable siteedge + shieldreuse permitted copiesoriginverified source bytesa fresh copy cannot authorize; a valid signature cannot fix a missing object
Figure 14.38Complete architecture summary. The mechanisms cooperate without substituting for one another’s guarantees.
ONE REQUEST, FOUR CHECKS, FOUR COMMON MISTAKESONE REQUEST, FOUR CHECKS, FOUR COMMON MISTAKESidentityright version + variantmixed representationspermissionvalid viewer policypublic origin bypassfreshnessage + directivesage reset at each layercapacitywarm and cold pathorigin stampede
Figure 14.39Independent design checks. A pass on one row does not imply a pass on another.

This chapter has not promised a particular CDN’s prices, global footprint, or origin throughput. Those are choices to verify with current documentation and workload tests. The next unit studies search, where queryable content uses indexes and ranking rather than simply reusing the same immutable response.