How to Engineer a Social Discovery Feature That Scales to Billions: Lessons from Facebook Reels' Friend Bubbles

By

Introduction

When you first see the Friend Bubbles feature on Facebook Reels, it looks deceptively simple: a small indicator showing which Reels your friends have watched or reacted to. But behind this straightforward interface lies a complex engineering journey that required rethinking machine learning models, reconciling platform-specific behaviors, and finding the one breakthrough that made everything click. In this step-by-step guide, we draw on insights from the Meta Tech Podcast with engineers Subasree and Joseph from the Facebook Reels team to help you build a social discovery feature that can scale to billions of users.

How to Engineer a Social Discovery Feature That Scales to Billions: Lessons from Facebook Reels' Friend Bubbles
Source: engineering.fb.com

What You Need

  • A dedicated engineering team with expertise in backend systems, ML, and client engineering
  • Access to large-scale user interaction data (e.g., watch history, reaction patterns)
  • Infrastructure for A/B testing and gradual rollouts (e.g., feature flags, experiment platforms)
  • Machine learning framework capable of iterative model evolution
  • Deep understanding of your platform's differences (iOS vs. Android, web vs. app)
  • Strong product–engineering collaboration to define the 'simple' user experience

Step-by-Step Guide

Step 1: Define the Core User Need Behind the 'Simple' Feature

Before writing a single line of code, step back and articulate the social discovery problem. For Friend Bubbles, the team realized that users wanted to see what their friends are engaging with, not just a generic feed of popular Reels. The key was to make this feel effortless and native. Action items:

  • Interview users to identify friction points in current social discovery
  • Prototype minimal UI that hints at friend activity without overwhelming
  • Set clear success metrics (e.g., increased engagement, friend interaction rate)

Step 2: Design an ML Model That Evolves with User Behavior

The initial machine learning model for Friend Bubbles was built on top of existing Reels ranking signals, but it quickly became clear that social signals required a different approach. Subasree and Joseph describe the evolution as moving from a static friend-affinity model to a dynamic one that learns from real-time interactions. How to implement:

  • Start with a simple baseline: rank Reels by number of friends who watched
  • Incorporate recency and reaction weights (e.g., a friend's 'like' matters more than a view)
  • Iterate by adding per-user personalization: the more a user interacts with a friend, the higher that friend's signals rank
  • Use online learning to adapt to changing friend circles and trending content
  • Always test against control groups to avoid over-personalization that reduces discovery

Step 3: Uncover and Accommodate Platform Differences (iOS vs. Android)

One of the most surprising findings was that iOS and Android users exhibited very different behaviors around Friend Bubbles. For instance, iOS users tended to tap buttons more deliberately, while Android users were more exploratory. These differences required separate optimizations for each platform. Practical tips:

  • Run platform-specific A/B experiments early to catch behavioral divergences
  • Consider UI adjustments: iOS may need larger tap targets; Android may benefit from quicker feedback loops
  • Let the ML model treat platform as a feature – i.e., train separate models per OS if data supports
  • Monitor platform-specific performance metrics (e.g., crash rates, latency) to avoid degradation

Step 4: Find the 'Click' Moment Through Iterative Breakthroughs

According to the Meta engineers, the feature didn't click until a key insight emerged: users wanted to see why a friend watched a Reel – not just that they did. Adding subtle cues (like reaction icons or timestamps) transformed engagement overnight. How to engineer your 'click' moment:

How to Engineer a Social Discovery Feature That Scales to Billions: Lessons from Facebook Reels' Friend Bubbles
Source: engineering.fb.com
  • Don't settle for the first version; treat the feature as a hypothesis to be disproven
  • Use qualitative feedback (surveys, user testing) alongside quantitative metrics
  • Experiment with different levels of social information: who watched, who liked, who shared?
  • Be willing to overhaul your model when the data suggests a different path

Step 5: Scale to Billions Without Sacrificing Performance

Once the feature clicked, the team faced the engineering challenge of serving billions of personalized Friend Bubbles in real time. This required rethinking caching strategies, database queries, and network requests. Scaling strategies:

  • Precompute friend activity summaries for heavy users to reduce on-the-fly computations
  • Use tiered caching: in-memory caches for hot data, slower persistence for cold data
  • Optimize ML inference by quantizing models and pruning unused features
  • Implement gradual rollout with feature flags to catch regressions before full deploy

Tips & Best Practices

  • Embrace the 'simple' complexity: The most user-friendly features often require the deepest engineering. Don't underestimate the effort needed to make something look effortless.
  • Invest in cross-platform testing: Different devices and operating systems can radically change user behavior. Make platform-specific tuning a first-class part of your process.
  • Let data guide your model evolution: The ML model for Friend Bubbles went through several iterations. Start simple, measure impact, and pivot based on findings.
  • Build for iteration, not perfection: The 'click' moment came from a willingness to try bold changes. Create a culture where rapid experimentation is the norm.
  • Scale consciously: When a feature grows to billions, every millisecond and byte count. Invest in performance early to avoid technical debt that could sink the user experience.

By following these steps, you can replicate the approach used by Meta's Reels team to build a social discovery feature that feels effortless yet scales to the world's largest platforms. For more insights, listen to the full discussion on the Meta Tech Podcast.

Tags:

Related Articles

Recommended

Discover More

Razr Fold vs Galaxy Z Fold 7: My Verdict on the Better FoldableMicrosoft Recognized as a Leader in Sovereign Cloud Platforms by Forrester WaveThe Googlebook Platform: A Comprehensive Guide to Android-Powered Laptops with Gemini IntelligenceThe Hidden Cholesterol Risk: Understanding Lp(a) and Its Impact on Heart HealthStack Overflow for Teams: Your Private Q&A Knowledge Base