Creating an HTTP Load Balancer in Python
Learn how the internals of a load balancer work!
This course explores a critical part of network infrastructure -- an HTTP load balancer.
In this course, you'll learn how to implement a load balancer in Python using Test-Driven Development (TDD). This course is aimed at full-stack developers, DevOps engineers, and enthusiasts interested in taking a deep drive into how Load Balancers work and their different features.
Learning Objectives
By the end of this course, you will be able to:
- Explain what a load balancer is and why it's needed in network infrastructure
- Describe the differences between host and path-based routing
- Implement host and path-based routing with Flask
- Practice Test-Driven Development
- Explain why health checks are necessary for load balancing and implement them
- Manipulate HTTP requests via the HTTP headers, URL parameters, and the URLs themselves
- Discuss and implement various load balancing algorithms for maximizing resiliency
- Add IP and path blocking to the load balancer so it can be used as a firewall
Tools and Technologies
- Python
- Flask
- pytest
- Docker
- Requests
Prerequisites
To get the most out of this course, you should preferably have strong working knowledge of Python 3.
You should also have a solid understanding of the following Internet and web fundamentals:
- IP addresses, URL structures, and DNS
- Web browsers and web servers
- HTTP requests and responses
It is helpful to know the following but by no means compulsory:
- Intermediate level understanding of how the TCP and HTTP protocol work.
- Intermediate level Python.
- Beginner level understanding of Docker.
- Beginner level understanding of Makefiles.
Review the following videos for more info:
- The Kids Guide to the Internet
- What is the Internet?
- The Internet: IP Addresses & DNS
- The Internet: HTTP & HTML
Info
- Current version: 1.0.0
- Last updated: December 7th, 2020
- Author: Neeran Gul
Table of Contents
- Theoretical Concepts
- Routing
- Configuration
- Health Checks
- Manipulating the HTTP Request
- Load Balancing Algorithms
- Intelligent Firewall
- Open Source Load Balancers
- Conclusion
- Appendix: Vocabulary
Join our mailing list to be notified about course updates and new tutorials.