GitHub
GitHub logoGitHub · Feature trail

High Availability Search Architecture for GitHub Enterprise Server

9 posts · Jan 2015 – Mar 2026

What this trail covers

This feature thread tracks the evolution of GitHub's distributed systems for storing and replicating Git repositories, focusing on improving robustness, speed, and flexibility. Initially, GitHub used DRBD for block-level replication, which was sensitive to latency and required replicas to be co-located. The development of DGit (now Spokes) introduced application-level replication, enabling wider geographical distribution of replicas and improved availability through automatic healing and load balancing. This post details the implementation of HAProxy for load balancing MySQL replicas, making the pools context-aware by allowing backend MySQL hosts to signal their inclusion status based on replication lag, server role, and maintenance status. It introduces a graceful failover mechanism using multiple backend pools and ACLs to ensure continuous service availability by switching to a backup pool with lagging replicas when the primary pool has insufficient capacity. The HTTP service for checks is implemented using xinetd and shell scripts, enabling dynamic decision-making without frequent HAProxy configuration changes.

All GitHub trails