Appendix D. Computer networking primer
The client-server model is the foundation of the web: Your browser is the client, servers sit out in the internet cloud, and computer networking is how they talk to each other. JavaScript can only do so much by itself; most web applications are still built around the communication back to the web server. The fundamentals of computer networking—and terminology like headers, latency, throughput, and polling—are covered in most undergraduate computer science programs, but because web development attracts people from a broad range of backgrounds, this appendix assumes you’ve not been through a program like that. Here, we’ll introduce you to the following concepts:
- The basics of computer networking
- The overhead of headers
- Two important network performance metrics: latency and throughput
- Polling versus event-driven communications
- Server-side choices for event-driven web applications
- The WebSocket protocol
Along the way, you’ll also briefly review the hacks used in HTML4 to avoid the particular performance trade-offs inherent in the fundamental web protocol, HTTP. For starters, if you’re not sure what real-time web development even means, this appendix will provide some context.