Engineering Friend Bubbles: A Step-by-Step Guide to Building Social Discovery at Scale

By

Introduction

Friend Bubbles might look like a simple feature—just a set of circular avatars showing which Reels your friends have watched and reacted to. But beneath that straightforward UI lies a complex engineering challenge: how do you surface meaningful social signals to billions of users without overwhelming them or breaking the system? In this guide, we'll walk through the key steps Facebook’s Reels team took to bring Friend Bubbles to life, drawing on insights from the engineers who built it. Whether you're building a social discovery feature or scaling any recommendation system, these steps will help you navigate the hidden complexities.

Engineering Friend Bubbles: A Step-by-Step Guide to Building Social Discovery at Scale
Source: engineering.fb.com

What You Need

Step-by-Step Guide

Step 1: Define the Core User Need

Start by clarifying what problem you're solving. For Friend Bubbles, the goal was to help users discover Reels through the lens of their friends—not just algorithmically. Instead of a purely personalized feed, the feature highlights content that friends have already engaged with, adding a social trust factor. Define metrics: increased engagement (likes, shares), time spent, and social interactions. Keep the user story simple: "I want to see what my friends are watching."

Step 2: Design the Machine Learning Model

The heart of Friend Bubbles is an ML model that predicts which Reels a user is likely to enjoy based on friends' behaviors. Initially, the team experimented with collaborative filtering—recommending Reels that friends of similar users liked. But they quickly found that recency and diversity mattered more than pure similarity. The model evolved to weight the latest friend interactions higher, and to avoid showing the same Reel from multiple friends. Train on historical data: user A watched Reel X, friend B also watched and liked it. Use a graph neural network to capture multi-hop friendships.

Step 3: Handle Platform Differences (iOS vs. Android)

Users behave differently on iOS and Android. The engineers discovered that iOS users tend to engage more with long-form content, while Android users swipe faster through short Reels. That meant the same friend interaction signal had different implications. Implement platform-specific model parameters: for iOS, emphasize watch duration; for Android, prioritize quick likes and comments. Also note that notification systems and feed rendering differ—test on both platforms early.

Step 4: The Surprising Discovery That Made It Click

During development, the team hit a plateau—Friend Bubbles weren't driving much lift. They then made a counterintuitive change: reduce the number of bubbles shown from six to three. This forced the algorithm to be more selective and only surface the most relevant friend interactions. The result? Engagement shot up. The lesson: less can be more. Constraint-driven design forces focus. In your feature, try limiting the number of recommendations or friends shown to avoid choice overload.

Engineering Friend Bubbles: A Step-by-Step Guide to Building Social Discovery at Scale
Source: engineering.fb.com

Step 5: Scale Infrastructure to Billions

With billions of Reels watched daily, computing friend activity for every user in real-time is impossible. Facebook built a caching layer that precomputes the top friend bubbles for each user during idle cycles (e.g., overnight, low traffic). Use an offline batch pipeline to generate candidate lists, then serve from a low-latency cache. For real-time updates (a friend likes a Reel now), use a streaming system (e.g., Apache Kafka) to push incremental changes. Monitor cache hit ratios and fallback gracefully to generic recommendations if caching fails.

Tips for Success

Building a social discovery feature that scales to billions is never as simple as it looks. Friend Bubbles succeeded because the team iterated on their ML model, embraced platform differences, and made a surprising discovery about the power of constraints. Apply these steps to your own feature, and you'll turn a seemingly simple idea into an impactful, scalable product.

Related Articles

Recommended

Discover More

Zara Customer Data Breach: Over 197,000 Records Compromised in Database AttackCritical Windows RPC Flaw Allows SYSTEM Privilege Escalation – No Patch AvailableApril 2026 Patch Tuesday: Comprehensive Guide to the Record-Breaking Security UpdatesAI Set to Fuel Software Development Boom, Not Bust, Experts SayReflections on Community, Legacy, and the Future of AI