System Design Atlas

Creator community with feeds and moderation

06 / 10Worked example

The overall architecture

How are post responsibility and external processing divided between modules and processes?

The local consistency rule determines the structure of the community API. Feed fanout handles deferred work in a separate process. Post state, relationships, visibility and moderation are modules within the API. Creators write through the community API to the relational post and relationship store. Feed fanout reads published references and distributes them to a separate feed read model. Members read candidate posts from that model; the API filters each against current visibility and audience. Moderation writes directly to the authoritative visibility state. Media files reside in external media storage and require the same authorisation decision. This topology fans out on writes and checks visibility on reads.

Starting point Moderation decisions have their own history.

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.

Runtime components and datastores

Runtime topology · External entities, processes and datastores

Creators and membersWrite, follow and read
Media file storageFile only after authorization

Community and visibility

Community APIMaintain posts and relationships
Post and relationship datastoreAuthoritative relational state
Feed fanoutDistribute references in batches
Feed read modelCandidates with sort timestamps
Visibility gateCheck state and audience on every read
Creators and members → Community APIPublishing or reading
Community API → Post and relationship datastoreContent and visibility
Post and relationship datastore → Feed fanoutPublished reference
Feed fanout → Feed read modelFan-out while writing
Feed read model → Visibility gateCandidates
Visibility gate → Post and relationship datastoreCurrent visibility
Visibility gate → Media file storageAuthorised access

Reads exclude blocked or deleted posts using their authoritative visibility state.

Creators write through the community API to the relational post and relationship store. Feed fanout reads published references and distributes them to a separate feed read model. Members read candidate posts from that model; the API filters each against current visibility and audience. Moderation writes directly to the authoritative visibility state. Media files reside in external media storage and require the same authorisation decision. This topology fans out on writes and checks visibility on reads.

Domain responsibilities within the API

Inside the community API

PostMaintain content, revision and audience
RelationshipRead following relationships for fanout
Moderation decisionRecord blocks and appeal decisions
Read filterCheck each feed candidate against current visibility
Beitrag → BeziehungDomain call
Beziehung → ModerationsentscheidungDomain call
Moderationsentscheidung → LesefilterDomain call

These responsibilities run within the same API process.

The community API contains post state, relationships, visibility and moderation. Show calls between these responsibilities; the modules have no separate server icons.

Map responsibilities to runtime components

Domain taskRuntimeResponsibility
Post stateCommunity APIMaintains the post and its publication.
RelationshipsCommunity APIManages following relationships and permitted audiences.
VisibilityCommunity APIChecks access to every delivered post.
ModerationCommunity APIRecords blocks, reasons and subsequent reviews.
Feed fanoutSeparate background processProcesses stored work and external feedback.
Media file storageExternal boundaryProvides or confirms the evidence agreed for this case.

Post state

Runtime
Community API
Responsibility
Maintains the post and its publication.

Relationships

Runtime
Community API
Responsibility
Manages following relationships and permitted audiences.

Visibility

Runtime
Community API
Responsibility
Checks access to every delivered post.

Moderation

Runtime
Community API
Responsibility
Records blocks, reasons and subsequent reviews.

Feed fanout

Runtime
Separate background process
Responsibility
Processes stored work and external feedback.

Media file storage

Runtime
External boundary
Responsibility
Provides or confirms the evidence agreed for this case.

Feed fanout runs outside the post commit

Feed fanout runs outside the post commit

Feed fanout runs outside the post commit.

A blocked or deleted post is excluded at read time using its authoritative visibility state, even when an old feed reference exists.

Posts, relationships, moderation history and feed references must express the same valid state. The exercise specifies the input and expected result.

Alternative considered
A separate service for every module would spread the guarantee that reads exclude blocked or deleted posts using authoritative visibility across additional network boundaries.
Trade-off
Common schema changes require coordinated releases.
Reassess
A substantially different load or independent ownership for feed fanout justifies revisiting process boundaries.

Try it yourself

Classify post state, feed fanout and media file storage as a module, process or external system. Add the authoritative datastore.

A hint for your attempt

A domain responsibility becomes a process only when it has its own execution unit.

Compare with a possible solution
Boundaries
Post state is a module in the community API; feed fanout is a separate process; media file storage is external.
Storage
Posts, relationships, moderation history and feed references hold the authoritative evidence. Reads exclude blocked or deleted posts using authoritative visibility, even when an old feed reference exists. The shared transaction protects this relationship; external responses remain separate evidence.

Apply to your project

Which planned service boundary would distribute a currently local guarantee across the network?

Next, delayed feed work respects current visibility.