Uber developed GitFarm, a "Git as a Service" platform, to manage Git operations across its massive monorepos. This centralized service significantly reduces client-side resource utilization and cold-start times by eliminating the need for local repository clones and providing pre-warmed checkouts. It leverages gRPC for high-performance API access and sandboxed command execution, demonstrating an effective approach to scaling developer infrastructure for large organizations.
Read original on InfoQ ArchitectureUber's diverse engineering organization, spanning Go, Java, Python, Web, Android, and iOS, operates within large-scale monorepos. Traditionally, individual services required full repository checkouts for various Git operations, leading to substantial resource consumption and slow cold-start times. For instance, cloning Uber's Go monorepo could take 15 minutes, consume 6 CPU cores, 32 GB of memory, and over 40 GB of disk space. This overhead became a significant bottleneck for developer workflows and automation systems, which collectively invoke Git millions of times daily.
GitFarm addresses these challenges by centralizing Git operations. It is not a source control management system but acts as a high-performance, shared Git client. Client systems no longer maintain local clones; instead, they interact with GitFarm via a gRPC API to execute standard Git commands. This approach has drastically reduced client-side resource utilization and eliminated lengthy cold-start delays, providing full Git checkouts in under 500 milliseconds.
Key System Design Principle: Centralization for Efficiency
GitFarm exemplifies the principle of centralizing a frequently performed, resource-intensive operation (Git clone and sync) into a dedicated service. This pattern is effective when the overhead of local execution becomes prohibitive across a distributed fleet of clients. By abstracting away the complexity and resource demands, the service optimizes performance and consistency for consumers.
This architecture not only improved individual client performance but also offered flexibility. Workloads requiring the absolute latest state can explicitly trigger `git fetch`, while those tolerating bounded staleness can utilize the backend's continuously synchronized state.
The adoption of GitFarm led to significant improvements. A code ownership service reduced CPU consumption from over 70 cores to 16 and memory from 400 GB to 32 GB across six hosts, with startup times falling from 15-20 minutes to less than one minute. A compliance auditing service saw median latency drop from 110-160 seconds to 20-30 seconds. GitFarm's roadmap includes features like streaming Git output, sparse checkouts, bare workspaces, and longer-lived sessions, indicating continued evolution for advanced use cases like coding agents.