sysdesign-newsfeed-fanout

Design hybrid fan-out and merge-on-read for skewed social feeds.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/danilods/matilha-sysdesign-pack --skill sysdesign-newsfeed-fanout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sysdesign-newsfeed-fanout
Source: https://github.com/danilods/matilha-sysdesign-pack/tree/main/skills/sysdesign-newsfeed-fanout
Command: npx skills add https://github.com/danilods/matilha-sysdesign-pack --skill sysdesign-newsfeed-fanout

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Balance fan-out on write versus merge-on-read for celebrity-scale social feeds. This skill provides a structured approach to deciding when to push posts to all followers versus merging on read to protect latency and resource usage at scale, while ensuring moderation and traceability.

Core Features & Use Cases

  • Hybrid fan-out design: combine write-time propagation for small follow graphs with read-time merging for high-followers.
  • Inline moderation and bounded materialized feeds: enforce policy checks before materializing feeds and cap per-user feed length.
  • Observability plan: monitor p99 latency by follower-graph shape and provide a clear cutover threshold for celebrity accounts.
  • Use Case: a post from a Celeb account should bypass aggressive write fan-out and rely on read-time aggregation for their followers.

Quick Start

Provide a baseline social feed design and flag accounts above a follower threshold to switch from fan-out-on-write to merge-on-read.

Frequently Asked Questions about sysdesign-newsfeed-fanout

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a hybrid fan-out design for a social news feed?

A hybrid fan-out design combines write-time propagation for small follow graphs with read-time merging for high-follower accounts. This approach balances latency and resource usage by pushing posts to normal followers while aggregating celebrity posts on read.

How do I prevent latency spikes when a celebrity posts in a news feed?

To prevent latency spikes, you flag accounts above a specific follower threshold to bypass aggressive write fan-out. Instead, their posts rely on merge-on-read aggregation, protecting system resources and meeting p99 latency budgets during viral events.

How do I apply inline moderation before materializing feeds?

You apply inline moderation by enforcing policy checks before materializing feeds. This ensures content is vetted prior to being pushed or merged into the user's materialized feed, maintaining traceability and policy compliance.

What is the best way to manage storage for bounded materialized feeds?

The best way to manage bounded storage is to cap per-user feed length within your data model. This limits the maximum size of materialized feeds, preventing unbounded storage growth while preserving recent post history.

When should I switch from fan-out on write to merge-on read?

You should switch from fan-out on write to merge-on-read when an account crosses a predefined follower cutover threshold. Monitoring p99 latency by follower-graph shape determines this exact transition point for celebrity accounts.