Course contentsShow
← System Design
Lesson 1677 of 1,91940. Real-World System: Social Media FeedFree lesson

Selective Push Strategies

Deciding when to push updates immediately versus batching or deferring based on user activity and importance.

Selective Push Strategies

You'll learn: How to intelligently decide which real-time updates to push immediately versus batch or defer, optimizing both user experience and system resources.

The Core Idea

Not all updates deserve instant notification. When a celebrity posts or your friend shares a photo, your system must decide: push it to everyone's WebSocket connection right now, or let them discover it on the next pull? Selective push means making smart choices about who gets what updates when, based on user activity, relationship strength, and content importance.

Why Selective Matters

Imagine pushing every single post from every followed account to every user in real-time—you'd overwhelm inactive users, waste bandwidth, and crush your connection servers. Instead, you apply filters:

Active vs Inactive Users

Push immediately only to users currently online with open WebSocket connections. Inactive users can fetch updates on their next session via pull.

Relationship Strength

Push posts from close friends (high engagement history) immediately, but batch or defer updates from casual follows or celebrity accounts users rarely interact with.

Content Importance

Push breaking news, direct mentions, or high-engagement content immediately. Defer routine posts or content from accounts the user rarely views.

Implementation Approach

When fanout occurs, the fanout service checks:

  • Is the recipient connected? (presence detection)
  • What's their engagement score with this author?
  • Is this content tagged urgent/important?

Based on these signals, route the update to either:

  • Real-time pub-sub → WebSocket → instant delivery
  • Timeline cache/DB → retrieved on next pull
  • Batch queue → bundled digest sent every N minutes

Key Takeaway: Selective push strategies balance real-time responsiveness with system efficiency by intelligently routing updates based on user context, relationship strength, and content priority rather than blindly pushing everything to everyone.