CLOSE
Updated on 11 Jun, 20268 mins read 18 views

Introduction

Before understanding WebRTC, we must first understand the problem it was created to solve.

Many developers learn WebRTC by memorizing.

createOffer()
createAnswer()
setLocalDescription()
setRemoteDescription()

Without understanding:

  • Why these APIs exist
  • Why browsers exchange offers
  • Why STUN servers are needed
  • Why ICE candidate appear
  • Why signaling is required

As a result, they can build simple demos but struggle to design real-world systems.

We will first understand the networking problems that existed before WebRTC and then see how WebRTC solves them.

What Is WebRTC?

WebRTC stands for:

Web Real-Time Communication

It is a technology that allows browsers and applications to communicate directly with each other in real time.

It enables:

  • Video calls
  • Voice calls
  • Screen sharing
  • File sharing
  • Chat systems
  • Multiplayer games
  • Collaborative applications

without requiring media or file data to pass through a cental server.

Simple example:

Browser A
     |
     |
     тЦ╝
Browser B

Direct communication.

This is called:

Peer-to-Peer Communication

or

P2P

What Did We Before WebRTC?

Before WebRTC, browsers had limited communication capabilities.

A browser could:

Browser
   |
HTTP Request
   |
Server

and

Server
   |
HTTP Response
   |
Browser

That's it.

Everything required a server.

Example:

Sending a file.

User A
   |
Upload
   |
Server
   |
Download
   |
User B

The server handled everything.

Traditional File Sharing

Imagine sharing a 1 GB file.

Without WebRTC:

User A
   |
Upload 1 GB
   |
Server
   |
Store File
   |
Download 1 GB
   |
User B

Total traffic:

2 GB

because:

1 GB Upload
+
1 GB Download

The server becomes responsible for:

  • Storage
  • Processing
  • Network bandwidth

Why This Is Expensive

Suppose:

1,000 users

share:

1 GB files

daily.

Server traffic:

1,000 x 2 GB = 2 TB

per day.

Video Calls Before WebRTC

Video calls had an even bigger problem.

Traditional architecture:

User A
   |
Video Stream
   |
Server
   |
Video Stream
   |
User B

The server continuously receives and sends video.

Example:

A 3 Mbps Video stream.

For two users:

3 Mbps Upload + 3 Mbps Download = 6 Mbps

server bandwidth.

With thousands of users:

Mega infrastructure costs
Buy Me A Coffee

Leave a comment

Your email address will not be published. Required fields are marked *

Your experience on this site will be improved by allowing cookies Cookie Policy