It's hard to imagine a modern developer workflow without a sufficiently advanced build system: Make, Gradle, Maven, Rake, and many others. In this talk, we'll discuss the evolution of build systems that leads to distributed build systems. Then, we'll dive into how we can build a scalable system that is fast and resilient, with examples from Google. We'll conclude with the discussion of general challenges of migrating systems from one architecture to another.
5. What does a build system do?
Photo by smemon / CC BY
6. Build Scenario
Project with dependencies
Makefile
main.o : main.c defs.h
cc -c main.c
main.c :
curl –O http://remote/main.c
7. Build Scenario
Project with dependencies
Find dependencies
Makefile
main.o : main.c defs.h
cc -c main.c
main.c:
curl –O http://remote/main.c
8. Build Scenario
Project with dependencies
Find dependencies
Build project with the dependencies
Download build artifacts
9. Test Scenario
Project with dependencies
Find dependencies
Build project with the dependencies
Download build artifacts Run the test
Get the results of the test
14. Scale
• Engineers: >30,000 developers in 40+ offices
• Commits: 15K by humans + 30K by robots/day
• Source code: 2 billion LOC
15. Scale
• Engineers: >30,000 developers in 40+ offices
• Commits: 15K by humans + 30K by robots/day
• Source code: 2 billion LOC
• Builds and tests: 5M per day through BuildRabbit
16. Scale
• Engineers: >30,000 developers in 40+ offices
• Commits: 15K by humans + 30K by robots/day
• Source code: 2 billion LOC
• Builds and tests: 5M per day through BuildRabbit
• Petabytes of output artifacts
17. Scale
• Engineers: >30,000 developers in 40+ offices
• Commits: 15K by humans + 30K by robots/day
• Source code: 2 billion LOC
• Builds and tests: 5M per day through BuildRabbit
• Petabytes of output artifacts
• 1 repository
18. Working in One Repository
Photo by flyingblogspot / CC BY SA
21. Working in One Repository
• Linear revision history
• Extensive code sharing & reuse
• Everything can be cross-referenced
• Large-scale refactoring for codebase modernization
• Easier collaboration across teams
22. Working in One Repository
• Linear revision history
• Extensive code sharing & reuse
• Simplified dependency management
• No confusion about authoritative version of the file
• No forking of shared libraries
• Components for library releases = Git subtree or Git
subcomponents to separate release from WIP versions
23. Working in One Repository
• Linear revision history
• Extensive code sharing & reuse
• Simplified dependency management
• Predictable, repeatable builds from source
24. Working in One Repository
• Linear revision history
• Extensive code sharing & reuse
• Simplified dependency management
• Predictable, repeatable builds from source
• Optimizations to avoid compiling same artifacts
25. Working in One Repository
• Linear revision history
• Extensive code sharing & reuse
• Simplified dependency management
• Predictable, repeatable builds from source
• Optimizations to avoid compiling same artifacts
• Decouple each team's processes as much as
possible
56. MAXIMUM VISIBILITY INTO SYSTEM STATE
DECOUPLE LAUNCH OF SERVICES
TARGET LAUNCH-FRIENDLY CLIENTS
FOCUS ON MIXED MODE
MIGRATE BACKENDS FIRST
57. PRACTICE THE LAUNCH
MAXIMUM VISIBILITY INTO SYSTEM STATE
DECOUPLE LAUNCH OF SERVICES
TARGET LAUNCH-FRIENDLY CLIENTS
FOCUS ON MIXED MODE
MIGRATE BACKENDS FIRST
58. PRACTICE THE LAUNCH, A LOT
MAXIMUM VISIBILITY INTO SYSTEM STATE
DECOUPLE LAUNCH OF SERVICES
TARGET LAUNCH-FRIENDLY CLIENTS
FOCUS ON MIXED MODE
MIGRATE BACKENDS FIRST
59. HAVE A SOLID ROLLBACK PLAN
PRACTICE THE LAUNCH, A LOT
MAXIMUM VISIBILITY INTO SYSTEM STATE
DECOUPLE LAUNCH OF SERVICES
TARGET LAUNCH-FRIENDLY CLIENTS
FOCUS ON MIXED MODE