<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lakshya Purohit</title>
    <description>The latest articles on DEV Community by Lakshya Purohit (@lakshya_purohit_8acdb147e).</description>
    <link>https://dev.to/lakshya_purohit_8acdb147e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3832550%2F9fcaa839-203e-4666-b3fa-edd059f69bb6.png</url>
      <title>DEV Community: Lakshya Purohit</title>
      <link>https://dev.to/lakshya_purohit_8acdb147e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lakshya_purohit_8acdb147e"/>
    <language>en</language>
    <item>
      <title>Why Your WebRTC App Breaks After 3 Users (And How Zoom Fixes It)</title>
      <dc:creator>Lakshya Purohit</dc:creator>
      <pubDate>Wed, 18 Mar 2026 20:05:16 +0000</pubDate>
      <link>https://dev.to/lakshya_purohit_8acdb147e/why-your-webrtc-app-breaks-after-3-users-and-how-zoom-fixes-it-3i0b</link>
      <guid>https://dev.to/lakshya_purohit_8acdb147e/why-your-webrtc-app-breaks-after-3-users-and-how-zoom-fixes-it-3i0b</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A simple explanation of WebRTC scaling problems and how Mediasoup solves them using SFU architecture.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you tried building a video calling app using WebRTC, you probably thought it was easy.&lt;/p&gt;

&lt;p&gt;Until the third or fourth user joins and everything starts breaking.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lag increases&lt;/li&gt;
&lt;li&gt;Video freezes&lt;/li&gt;
&lt;li&gt;CPU usage spikes&lt;/li&gt;
&lt;li&gt;Bandwidth explodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So how do apps like Zoom or Google Meet handle thousands of users smoothly?&lt;/p&gt;

&lt;p&gt;They don’t use pure WebRTC.&lt;/p&gt;

&lt;p&gt;They use a smarter architecture.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Simple Promise of WebRTC
&lt;/h2&gt;

&lt;p&gt;WebRTC allows direct browser-to-browser communication.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No plugins&lt;/li&gt;
&lt;li&gt;No external software&lt;/li&gt;
&lt;li&gt;Ultra-low latency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At its core, it creates a direct connection between users.&lt;/p&gt;

&lt;p&gt;Sounds perfect — until it isn’t.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where Things Break
&lt;/h2&gt;

&lt;p&gt;WebRTC uses a &lt;strong&gt;mesh architecture&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means every user sends video to every other user.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;2 users = 1 connection&lt;/li&gt;
&lt;li&gt;4 users = 6 connections&lt;/li&gt;
&lt;li&gt;10 users = 45 connections&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This grows exponentially.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mesh Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd1o54th0selhq8odsgvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd1o54th0selhq8odsgvs.png" alt="Mesh Architecture" width="720" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Mesh architecture: every user connects to every other user, causing exponential connections.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Problem
&lt;/h2&gt;

&lt;p&gt;Every new user multiplies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bandwidth usage&lt;/li&gt;
&lt;li&gt;CPU load&lt;/li&gt;
&lt;li&gt;Network complexity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browsers crash&lt;/li&gt;
&lt;li&gt;Calls lag&lt;/li&gt;
&lt;li&gt;Systems fail to scale&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Breakthrough: Mediasoup (SFU)
&lt;/h2&gt;

&lt;p&gt;Instead of connecting everyone to everyone, we introduce a server.&lt;/p&gt;

&lt;p&gt;This is called an &lt;strong&gt;SFU (Selective Forwarding Unit)&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  New flow:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;User sends stream → server&lt;/li&gt;
&lt;li&gt;Server forwards stream → other users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now users do not send data to everyone.&lt;/p&gt;




&lt;h2&gt;
  
  
  SFU Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fef9merzw7qivp48ed691.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fef9merzw7qivp48ed691.png" alt="SFU Architecture" width="704" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SFU architecture: a central server forwards streams efficiently.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Changes Everything
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mesh architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Too many connections&lt;/li&gt;
&lt;li&gt;High bandwidth usage&lt;/li&gt;
&lt;li&gt;Not scalable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SFU architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;One connection per user&lt;/li&gt;
&lt;li&gt;Efficient forwarding&lt;/li&gt;
&lt;li&gt;Scales to large rooms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is how real systems are built.&lt;/p&gt;




&lt;h2&gt;
  
  
  Inside Mediasoup
&lt;/h2&gt;

&lt;p&gt;Mediasoup acts as a media router.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core components:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Worker&lt;/strong&gt;&lt;br&gt;
Handles media processing using CPU cores&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Router&lt;/strong&gt;&lt;br&gt;
Represents a room&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transport&lt;/strong&gt;&lt;br&gt;
Manages WebRTC connections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Producer&lt;/strong&gt;&lt;br&gt;
Sends media&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consumer&lt;/strong&gt;&lt;br&gt;
Receives media&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every user is both a producer and a consumer.&lt;/p&gt;




&lt;h2&gt;
  
  
  How a Call Actually Works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;User connects via Socket.IO&lt;/li&gt;
&lt;li&gt;Server creates worker and router&lt;/li&gt;
&lt;li&gt;User joins a room&lt;/li&gt;
&lt;li&gt;User sends video&lt;/li&gt;
&lt;li&gt;Other users receive it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is routed efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mediasoup Flow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fek3ovl2htrrjrmyvuymo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fek3ovl2htrrjrmyvuymo.png" alt="Mediasoup Flow" width="704" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Mediasoup flow: producer sends media to server, which routes it to consumers.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Frontend: React / Next.js&lt;/li&gt;
&lt;li&gt;Backend: Node.js&lt;/li&gt;
&lt;li&gt;Signaling: Socket.IO&lt;/li&gt;
&lt;li&gt;Media: Mediasoup&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Hard Truth
&lt;/h2&gt;

&lt;p&gt;This is not easy.&lt;/p&gt;

&lt;p&gt;You will face:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WebRTC debugging challenges&lt;/li&gt;
&lt;li&gt;NAT traversal (STUN/TURN) issues&lt;/li&gt;
&lt;li&gt;Media synchronization problems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But once you understand it, you can build production-grade systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Insight
&lt;/h2&gt;

&lt;p&gt;WebRTC gives you real-time communication.&lt;/p&gt;

&lt;p&gt;Mediasoup gives you scalability.&lt;/p&gt;

&lt;p&gt;That is the difference between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A demo project&lt;/li&gt;
&lt;li&gt;A real product&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Originally Published
&lt;/h2&gt;

&lt;p&gt;This article was originally written and published on my portfolio:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.lakhsyapurohit.online/blog/real-time-video-with-webrtc-and-mediasoup" rel="noopener noreferrer"&gt;https://www.lakhsyapurohit.online/blog/real-time-video-with-webrtc-and-mediasoup&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;If this helped you, consider sharing it 🚀&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
