WebRTC Mesh vs Centralized Server Architecture

This article explores the fundamental architectural differences between a WebRTC Mesh network and centralized server architectures, such as Selective Forwarding Units (SFUs) and Multipoint Control Units (MCUs). We will examine how data flows in both setups, compare client-side and server-side resource utilization, and analyze which architecture is best suited for various real-time communication use cases.

WebRTC Mesh Architecture (Peer-to-Peer)

In a WebRTC Mesh (P2P) architecture, every participant (peer) establishes a direct connection with every other participant in the session. There is no intermediate media server to process or route the video and audio streams.

How Data Flows

If there are four participants in a call (A, B, C, and D), Participant A must send their media stream individually to B, C, and D. Simultaneously, Participant A must receive individual streams from B, C, and D.

Key Characteristics


Centralized Server Architecture (SFU and MCU)

In a centralized architecture, participants do not connect directly to one another. Instead, everyone connects to a central media server that manages the distribution of media streams. There are two primary types of centralized WebRTC servers:

1. Selective Forwarding Unit (SFU)

An SFU receives media streams from each participant and forwards them to all other participants without modifying or mixing the media.

2. Multipoint Control Unit (MCU)

An MCU receives media streams from all participants, decodes them, mixes them into a single consolidated video and audio stream, and encodes this single stream to send back to each participant.


Direct Architectural Comparison

Feature WebRTC Mesh (P2P) Centralized SFU Centralized MCU
Connection Topology Full Mesh (Direct P2P) Star (To Central Server) Star (To Central Server)
Upstream Streams (per client) \(N - 1\) \(1\) \(1\)
Downstream Streams (per client) \(N - 1\) \(N - 1\) \(1\)
Client CPU & Bandwidth Load High (Scales poorly) Moderate Very Low
Server CPU Load None Low (Routing only) High (Decoding/Encoding)
Infrastructure Cost Lowest Moderate High
Typical Capacity 2–5 participants 10–100+ participants Hundreds of participants
End-to-End Encryption Supported natively Challenging (Requires Insertable Streams) Not possible (Server must decrypt)

Summary of Use Cases