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 CommunicationIt 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 BDirect communication.
This is called:
Peer-to-Peer Communicationor
P2PWhat Did We Before WebRTC?
Before WebRTC, browsers had limited communication capabilities.
A browser could:
Browser
|
HTTP Request
|
Serverand
Server
|
HTTP Response
|
BrowserThat's it.
Everything required a server.
Example:
Sending a file.
User A
|
Upload
|
Server
|
Download
|
User BThe 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 BTotal traffic:
2 GBbecause:
1 GB Upload
+
1 GB DownloadThe server becomes responsible for:
- Storage
- Processing
- Network bandwidth
Why This Is Expensive
Suppose:
1,000 usersshare:
1 GB filesdaily.
Server traffic:
1,000 x 2 GB = 2 TBper day.
Video Calls Before WebRTC
Video calls had an even bigger problem.
Traditional architecture:
User A
|
Video Stream
|
Server
|
Video Stream
|
User BThe server continuously receives and sends video.
Example:
A 3 Mbps Video stream.
For two users:
3 Mbps Upload + 3 Mbps Download = 6 Mbpsserver bandwidth.
With thousands of users:
Mega infrastructure costsLeave a comment
Your email address will not be published. Required fields are marked *


