Scalable Real-Time Backends With Websockets

Posted By: ELK1nG

Scalable Real-Time Backends With Websockets
Published 8/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 11.35 GB | Duration: 11h 30m

Advanced WebSockets internals for Building scalable Real-Time bidirectional gaming and chatting backends

What you'll learn

System Design for Real-Time backend scaling

The Internals of WebSockets

How WebSockets Work

WebSockets on Secure TLS

Scaling WebSockets with Layer 4 Proxying

Scaling WebSockets with Layer 7 Proxying

WebSockets on HTTP/2 and HTTP/3

Building a Real-time Group Chatting App (IO Intensive)

Building a Real-time Game App (CPU Intensive)

Requirements

Fundamentals of Backend Engineering

Description

Engineering efficient and scalable backends is such an enjoyable design activity. Understanding the frontend workflows, designing the APIs, picking the right protocols and databases for the task, and determining the communication patterns—whether the workload is CPU- or I/O-intensive—are all part of the fun.However, what’s truly more challenging is designing real-time backend applications that support unfettered and ad-hoc bidirectional communication. The workloads of gaming, chatting, and even mission-critical real-time applications are unique in that they require a “push” nature to function effectively.I spent a few months designing this course, and I chose the WebSockets protocol as the foundation for this work. WebSockets is by far the most widely available bidirectional protocol, supported across all clients—from browsers and command-line apps to runtimes like Node and Bun, and even other languages like C and Go.While there is the newer WebTransport protocol, it isn’t yet as widely supported or battle-tested as WebSockets. Perhaps I’ll refresh this course in a few years when WebTransport matures.This course is divided into three main sections:1. WebSockets Internals – A deep dive into the inner workings of the protocol: the handshake, keepalive mechanisms, frame headers, and how it behaves over TLS. We’ll also discuss limitations—because I believe understanding limitations helps us build better applications. Each lecture will include a coding session and a quiz at the end of the section.2. Scaling WebSockets – Taking your WebSocket knowledge to the maximum: how to scale this protocol over HTTP/1.1, HTTP/2, and HTTP/3. We’ll cover implementation with proxies in both stream mode (Layer 4) and application mode (Layer 7), along with their pros and cons. Each lecture will include a coding session and a quiz at the end of the section.3. Building Real-Time System Designs – Putting everything into practice by designing two systems: an I/O-intensive chat system and a CPU-intensive game. I’ll propose multiple designs for each and choose one to implement.Prerequisite: Fundamentals of Backend Engineering.I hope you enjoy the course.

Overview

Section 1: Introduction

Lecture 1 Welcome

Lecture 2 Who is this course for?

Lecture 3 Course Outline

Lecture 4 Course Data

Section 2: Foundations of Web Communications

Lecture 5 Web Communications Section Introduction

Lecture 6 Understanding the OSI Networking Model

Lecture 7 Overview of Transmission Control Protocol (TCP)

Lecture 8 Overview of the HTTP Protocol

Lecture 9 Overview of HTTPS and TLS

Section 3: WebSockets Internals

Lecture 10 WebSockets Internals Section Introduction

Lecture 11 The WebSockets Protocol

Lecture 12 The WebSockets Handshake

Lecture 13 WebSockets Frame Structure

Lecture 14 WebSockets Security (WSS)

Lecture 15 WebSockets on HTTP/2 and HTTP/3

Lecture 16 The Limitations of WebSockets

Section 4: Scaling WebSockets Backends

Lecture 17 Scaling WebSockets Section Introduction

Lecture 18 Forward Proxy vs Reverse Proxy

Lecture 19 WebSockets Stream Proxying (Layer 4)

Lecture 20 WebSockets Application Proxying (Layer 7 h1 & h2)

Section 5: Real-Time Systems - Building Scalable IO Intensive Chatting Backend

Lecture 21 Group Chat System - What Are We Building?

Lecture 22 Group Chat System Design 1

Lecture 23 Group Chat System Design 2

Lecture 24 Group Chat System Design 3

Lecture 25 Group Chat System Design 4

Lecture 26 Implementation - Chat System

Section 6: Real-World System - Scalable CPU Intensive Gaming Backend

Lecture 27 Gaming System - What are We Building?

Lecture 28 Real-Time Gaming System Design 1

Lecture 29 Real-Time Gaming System Design 2

Lecture 30 Implementation - Game System

Section 7: Conclusion

Lecture 31 Course Summary & Next Steps

Intermediate Backend Engineers wanting to build scalable backends