How to Engineer Social Discovery at Scale: Inside Friend Bubbles’ Building Blocks

By

Introduction

Ever wondered what it takes to build a feature that looks deceptively simple on the surface but requires immense engineering to work for billions? Meta’s Friend Bubbles on Reels is exactly that — it shows you which Reels your friends have watched and reacted to, turning passive scrolling into a social experience. But behind those floating avatars lies a complex journey of machine learning evolution, platform behavior differences, and one breakthrough discovery that made the whole system click. This step-by-step guide unpacks the engineering process behind building a social discovery feature that scales to billions, drawing from the insights shared by Subasree and Joseph on the Meta Tech Podcast.

How to Engineer Social Discovery at Scale: Inside Friend Bubbles’ Building Blocks
Source: engineering.fb.com

What You’ll Need (Prerequisites & Materials)

Step‑by‑Step Guide

Step 1: Define the Feature’s Core Logic

Start by nailing down the exact user experience. For Friend Bubbles, the idea is simple: “Show me Reels my friends have interacted with.” But you must decide which interactions count (watched? liked? commented?) and how to surface them without overloading the viewer. Create a specification that answers:

Document these rules clearly – they will guide every engineering choice later.

Step 2: Build the Data Infrastructure

Before you can recommend anything, you need to collect and store friend‑interaction signals. Set up a real‑time ingestion pipeline that captures every watch, like, share, and comment from every user and relates it to the Reel’s ID as well as to the friend’s profile ID. At the scale of billions, you must think about:

Meta engineers found that surprising edge cases (like a user with 10,000 friends) require special handling – plan for sparsity and long‑tail behavior from day one.

Step 3: Train the Machine Learning Model (Iteration 1)

The first ML model for Friend Bubbles might be simple: rank friends by recent interactions with the current Reel. But soon you’ll discover that “raw recency” doesn’t always produce engaging results. Start with a baseline (e.g., logistic regression) and then evolve:

As Subasree and Joseph explained, the model went through several iterations before hitting the right balance – be ready to experiment fast.

Step 4: Address Platform Behavioral Differences

During testing, you’ll notice that iOS and Android users behave differently. For example, iOS users might watch longer sessions but interact less per Reel, while Android users may tap reactions more frequently. The algorithm cannot be monolithic. Create separate A/B testing cohorts per platform, and retrain your model with platform‑specific features. In some cases, the same model will produce different quality scores on each OS – use that feedback to tune hyperparameters.

This step often reveals a “surprising discovery” that unlocks performance. Meta’s team found that tweaking the friend‑bubble animation timing changed engagement by double digits – something that would never appear in offline training.

How to Engineer Social Discovery at Scale: Inside Friend Bubbles’ Building Blocks
Source: engineering.fb.com

Step 5: Validate with Real Users (Beta & Gradual Roll‑out)

Before going live to billions, run a limited beta. Recruit internal users (Meta did this with employees) to catch bugs in ranking, latency, and UI. Use this phase to:

After the beta, roll out gradually at 1%, 5%, 25% etc., monitoring core metrics like time‑spent, friend‑interaction rate, and uninstall rate.

Step 6: Scale to Billions (the Engineering Backend)

Now you need to serve the feature for every user at every moment. That means:

Meta’s team had to rewrite parts of the real‑time stack because the original design couldn’t handle the burst of writes from millions of friends watching a viral Reel simultaneously.

Step 7: Monitor, Iterate, and Surprise

Even after launch, treat Friend Bubbles as a living feature. Monitor not just technical metrics but also user satisfaction. Set up dashboards for:

Be open to the “aha” moments – Meta’s engineers discovered that showing mutual friend bubbles increased engagement by 35% over just one friend’s activity. That iteration came after months of data analysis.

Tips for Success

Building social discovery at scale is not for the faint of heart, but by following these steps and embracing iterations, you can create a feature that feels simple yet profoundly connects users. Ready to build your own Friend Bubbles? Start with Step 1 – and don’t be afraid to break things along the way.

Tags:

Related Articles

Recommended

Discover More

Securing Your Node.js Applications: A Step-by-Step Guide to Addressing vm2 Sandbox VulnerabilitiesWhy Kubernetes Is Becoming the Foundation for AI WorkloadsNavigating the Cerebras IPO: A Comprehensive Investor's GuideThe Pacific's Power: How a Strong El Niño Could Push Climate Beyond a Critical ThresholdRust Expands Mentorship Horizons: Joining Outreachy for May 2026