The API for network traffic forwarding is omitted.
API for management:
// Create load balancer
POST /loadBalancers -> LoadBalancer
{
id, // output
name,
algorithm,
config, // algorithm parameters
}
// Other CRUD methods for load balancer is omitted.
POST /loadBalancers/
{
id, // output
serverIp,
weight, // for weighted round-robin
}
// Other CRUD methods for registrations are omitted.
// status
GET /loadBalancers/
{
id,
status, // online | offline | etc.
uptime,
lastHeartbeat,
...
}
// log
Get /loadBalancer/
{
id,
log, // Array of logs
}
A database is used to store configuration information:
LoadBalancer table:
Registration table:
A relational database can be used here. Say we support up to 10k of load balancers, and each load balancer supports up to 1k of server IPs, the storage need: 10k * 1k * 1k (data) = 10Gb which is very small for a database.
Logs
Request Handler:
Load balancing engine
Request handler and load balancing engine is located on the same server.
Config DB
Management API
Health Monitor
Logging Service
Session Manager
Client request flow:
Management flow:
Health checks
Load balancing algorithm
Single instance, active-passive, or multi-instance software load balancer
Handle peak traffic
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?