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
Community and visibility
Reads exclude blocked or deleted posts using their authoritative visibility state.
Domain responsibilities within the API
Inside the community API
These responsibilities run within the same API process.
Map responsibilities to runtime components
| Domain task | Runtime | Responsibility |
|---|---|---|
| Post state | Community API | Maintains the post and its publication. |
| Relationships | Community API | Manages following relationships and permitted audiences. |
| Visibility | Community API | Checks access to every delivered post. |
| Moderation | Community API | Records blocks, reasons and subsequent reviews. |
| Feed fanout | Separate background process | Processes stored work and external feedback. |
| Media file storage | External boundary | Provides 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.
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?