System Design Atlas

Creator community with feeds and moderation

08 / 10Worked example

Bottlenecks and trade-offs

Which measurements distinguish business waiting time from technical bottlenecks when distributing community posts?

The sequence is defined; now examine its possible bottlenecks. Large follower groups cause high feed lag; numerous status checks cause long read latency. The two metrics drive separate optimisations. The following measures are initial decisions to test; their benefits have yet to be measured.

Starting point Delayed feed work respects current visibility.

Assumptions for the example case

A fictional example design for a local community with text posts, a chronological home feed and traceable moderation. A feed projection with lag below 30 seconds is within the assumed target; from 30 seconds, the backlog is displayed and reported. All figures and test targets are illustrative assumptions.

Trace symptoms to their causes

Branched diagnostic tree

Feed is laggingSignal
Measure fan-out ageMeasurement
Platform operationsResponsible
Post missing despite a feed referenceSignal
Check visibilityMeasurement
ModerationResponsible
Media access deniedSignal
Check the authorisation decisionMeasurement
Community APIResponsible

Measurement separates competing causes before a role acts.

Large follower groups cause high feed lag; numerous status checks cause long read latency. The two metrics drive separate optimisations.

Measure before making changes

SymptomValidationTargeted action
Large follower groups cause high feed lag; numerous status checks cause long read latency.Check source freshness, the business reason for waiting and processing time separately.Address the evidenced cause first, then retest the same case.
One post for 100000 followersMeasure the duration of the atomic decision and concurrent access.Move lengthy work outside the commit; preserve the business invariant in the concurrency test.
Stale display despite stored evidenceCompare the authoritative version with the projection version.Rebuild the projection; continue deciding state changes from the authoritative state.

Large follower groups cause high feed lag; numerous status checks cause long read latency.

Validation
Check source freshness, the business reason for waiting and processing time separately.
Targeted action
Address the evidenced cause first, then retest the same case.

One post for 100000 followers

Validation
Measure the duration of the atomic decision and concurrent access.
Targeted action
Move lengthy work outside the commit; preserve the business invariant in the concurrency test.

Stale display despite stored evidence

Validation
Compare the authoritative version with the projection version.
Targeted action
Rebuild the projection; continue deciding state changes from the authoritative state.

Fan out to large follower groups in batches

Fan out to large follower groups in batches

Fan out to large follower groups in batches.

Large follower groups cause high feed lag; numerous status checks cause long read latency. The two metrics drive separate optimisations.

Large follower groups cause high feed lag; numerous status checks cause long read latency. The two metrics drive separate optimisations. The exercise specifies the input and expected result.

Alternative considered
Adding compute capacity indiscriminately does not resolve missing business evidence.
Trade-off
Multiple measurement points and separate causes increase the diagnostic effort.
Reassess
Use measurements after the targeted change to decide whether further scaling is needed.

Try it yourself

Name two different causes of delay in this case. Choose a measurement for each and justify the first action.

A hint for your attempt

Record the business reason for waiting, source age and technical compute time separately.

Compare with a possible solution
Case-related diagnosis
Large follower groups cause high feed lag; numerous status checks cause long read latency. The two metrics drive separate optimisations. First distinguish these causes using their own timestamps and states.
Hotspot
Measure concurrent access and commit duration for one post reaching 100000 followers. Move lengthy external work outside the transaction, then repeat the same concurrency test.

Apply to your project

Which similar display could have two different causes in your project?

Next, keep moderation reasons and appeal paths traceable.