How to Engineer a Viral Social Discovery Feature: A Step-by-Step Blueprint

By ⚡ min read

Introduction

Imagine a feature so simple you'd explain it in one sentence: “Friend Bubbles shows you which Reels your friends recently watched and liked.” Yet behind that simplicity lies a cascade of engineering challenges—scaling machine learning models to billions of users, reconciling behavioral differences between iOS and Android, and uncovering a hidden insight that made everything click. This is the story of how Meta's Reels team turned a neat idea into a global social discovery engine. In this step-by-step guide, we distill their journey into actionable steps for any team aiming to build a socially intelligent feature that scales.

How to Engineer a Viral Social Discovery Feature: A Step-by-Step Blueprint
Source: engineering.fb.com

What You Need

  • Engineering Team – At minimum: ML engineers, backend infrastructure engineers, iOS and Android developers.
  • Data Pipeline – Access to real-time engagement signals (watch, like, share, comment) for billions of daily interactions.
  • Machine Learning Model – A recommendation system that can learn from friend behavior without over-personalizing.
  • Cross-Platform Testing Environment – Separate environments for iOS and Android to catch platform-specific quirks.
  • Scalable Infrastructure – Cloud or on-premise capacity to handle peak loads (e.g., Super Bowl night).
  • User Research & A/B Testing Framework – To validate hypotheses and measure social engagement lift.

Step-by-Step Blueprint

Step 1: Define the Simple, Social-Led Experience

Start with a crystal-clear user value: “Show me Reels my friends have watched and reacted to.” Resist the urge to overcomplicate. Friend Bubbles is essentially a social filter on top of an already robust Reels recommendation engine. Your goal is social discovery—surfacing content through friends' actions, not just algorithms. Write a one‑paragraph product spec and stick to it. This constraint forces deep engineering work later.

Step 2: Build the ML Model for Friend Signal Extraction

Now the hard part. You need a machine learning model that identifies which Reels a user’s friends have engaged with—and decides which of those to surface. The Meta team evolved their model through multiple iterations. Start with a simple collaborative filtering approach: for each user, retrieve the most recent “likes” and “watches” from their friend graph. Then rank those Reels by global popularity as a fallback. But this naive approach drowns in noise. You’ll need to train a model that balances:

  • Recency – A friend’s action from 5 minutes ago matters more than one from 5 days ago.
  • Strength of signal – A “save” is stronger than a “like”.
  • Diversity – Don’t show the same friend’s activity repeatedly.

Use a two-tower neural network: one tower encodes the user and their friend graph, the other encodes Reels features (creator, audio, visual themes). Train offline on historical engagement, then A/B test online.

Step 3: Address Platform Disparities (iOS vs Android)

You might expect the feature to behave identically on both mobile operating systems. Surprise—it doesn’t. The Meta team discovered that iOS users generate richer engagement signals (more time‑spent, more comments) while Android users produce more taps and scrolls. This imbalance can skew the model if not accounted for. Solution:

  • Maintain separate training cohorts per platform during the initial rollout.
  • Use platform‑specific data preprocessing (e.g., bias correction to normalize signal strengths).
  • Validate model performance separately on iOS vs Android before merging.

Pro tip: Run shadow A/B tests on both platforms simultaneously to catch unexpected behaviors early.

Step 4: Uncover the “Aha!” Moment Through Data Exploration

The Meta engineers hit a wall. Early versions of Friend Bubbles showed lots of Reels, but engagement was flat. Then they made a surprising discovery: users didn’t want every friend’s activity—they wanted close friends only. The LLM wasn’t sophisticated enough to infer friendship strength from raw graph data. So they added a lightweight “intimacy” signal: frequency of direct messages and mutual comments. This small tweak dramatically improved relevance. To replicate this:

How to Engineer a Viral Social Discovery Feature: A Step-by-Step Blueprint
Source: engineering.fb.com
  • Dig into your own user interaction logs. Look for hidden behaviours (e.g., a friend you interact with daily vs. one you follow but never talk to).
  • Incorporate a secondary model that predicts friendship closeness using features like message count, mutual friends, and shared group membership.
  • Test the uplift—you’ll likely see a 15‑25% boost in click‑through rate.

Step 5: Scale the Feature to Billions of Users

Once the model works for millions, scale out. This isn’t just about adding more servers. You need to handle:

  • Data freshness – Friend actions are real‑time events. Use a stream‑processing framework (e.g., Apache Kafka) to update candidate lists within seconds.
  • Load balancing – Peak usage (e.g., evenings) can cause cascading failures. Implement region‑specific caching and precomputation of top friends’ activity.
  • Lazy personalization – For new users without a friend graph, fall back to popular Reels. Gradually introduce social signals as their network grows.

Meta’s Reels team also optimized their inference pipeline by quantizing the model (reducing precision from float32 to int8) to cut latency by 40% without sacrificing accuracy.

Step 6: Launch, Listen, and Iterate

Friend Bubbles didn’t ship perfectly on day one. The team continuously monitored metrics like time spent per session, social sharing rate, and friend bubble tap‑through rate. They also set up a feedback loop on Instagram, Threads, and X to gather qualitative input. Changes were deployed in weekly app updates. Some key learnings:

  • Don’t over‑personalize – Users still want serendipity. Too much friend content feels like a group chat they didn’t sign up for.
  • Privacy matters – Always give users control. Friend Bubbles lets users opt out of showing their activity.
  • Edge cases win – Handling accounts with 1,000+ friends required a page‑ranking algorithm to sample the top 50 most relevant friends.

Tips for Your Journey

  • Start with a clear, simple product hypothesis. Complexity breeds confusion—define the problem before building.
  • Expect platform differences. iOS and Android aren’t twins. Gather separate telemetry from day one.
  • Listen for the “aha” signal. Your best insight may come from frustrating dead ends. Let the data surprise you.
  • Resist feature creep. Friend Bubbles stayed focused on friend activity. Adding “trending among friends I don’t follow” dilute the concept.
  • Plan for scale early. Pre‑compute heavy queries; cache aggressively. Your first 10 million users will thank you.

Building a social discovery feature that touches billions is never simple. But by breaking the process into these steps—starting with a minimal product, iterating on the ML model, respecting platform quirks, and scaling with care—you can replicate the success of Friend Bubbles. Now go turn that simple idea into reality.

Recommended

Discover More

Motorola's 2026 Razr Lineup: Incremental Updates, Higher Prices – What You Need to KnowPixel 11 Rumors and Fitbit Air: What You Need to KnowParanormal Activity: Threshold Cancelled: What Went Wrong?6 Things to Know About Apple's Record Stock Surge Past $300Optimizing WebAssembly Execution with Speculative Inlining and Deoptimization: A Step-by-Step Guide