Designing for Productivity in a Large-Scale iOS Application

How innovation in technology and people processes have enabled iOS developers to remain productive in a large codebase.

Michael Bachand
16 min readintermediate
--
View Original

Overview

This article discusses how the iOS team at Airbnb has enhanced developer productivity within a large-scale application by addressing challenges associated with a growing codebase. It highlights the adoption of a modern build system, the introduction of module types, and the creation of Dev Apps to streamline development processes.

What You'll Learn

1

How to adopt a modern build system using Buck

2

Why designing module types improves code organization and discoverability

3

How to create Dev Apps for efficient feature development

Prerequisites & Requirements

  • Understanding of iOS development and Xcode
  • Familiarity with build systems like Buck(optional)

Key Questions Answered

What challenges does Airbnb face in developing a large-scale iOS app?
Airbnb's iOS application has grown to 1.5 million lines of code, posing challenges such as code organization, long build times, and difficulties in using Xcode effectively. These issues hinder productivity and complicate the development process as the team scales.
How has Airbnb improved its iOS development workflow?
Airbnb has implemented a modern build system using Buck, redesigned its code organization into module types, and introduced Dev Apps to streamline development. These changes have significantly reduced build times and improved code discoverability.
What is a Dev App and how does it benefit developers?
A Dev App is an ephemeral Xcode workspace that allows developers to work on a single module and its dependencies. This minimizes the code loaded in Xcode, leading to faster indexing and compilation, thus enhancing the development loop.
What impact has the new architecture had on code ownership?
The modular architecture has enabled 100% code ownership among teams, allowing for easy transfer and repartitioning of ownership with minimal refactoring. This structure supports nearly 1,500 modules in the codebase.

Key Statistics & Figures

Lines of code in Airbnb's iOS application
1.5 million
This figure highlights the scale of the codebase that the iOS team manages.
Percentage of local builds driven by Dev Apps
over 50%
This statistic indicates the significant adoption of Dev Apps in the development workflow.
75th percentile of Dev App build times
under two minutes
This shows the efficiency gained from using Dev Apps compared to traditional build methods.
Test coverage for modern module structure
over 50%
This reflects the improved testing practices resulting from the new architecture.

Technologies & Tools

Build System
Buck
Used to manage builds and improve developer productivity through caching and a query interface.
IDE
Xcode
The primary development environment for iOS engineers at Airbnb.

Key Actionable Insights

1
Implement a modern build system like Buck to enhance developer productivity.
By transitioning to a build system that supports features like network caches and a query interface, teams can significantly reduce build times and improve the overall development experience.
2
Organize code into meaningful module types to improve discoverability.
Creating a clear hierarchy and documentation for module types helps engineers quickly understand the codebase, reducing the time spent searching for implementations and improving code quality.
3
Utilize Dev Apps for focused feature development.
Dev Apps allow developers to work in a minimal environment, reducing distractions and speeding up the development cycle, which is especially beneficial for isolated features.

Common Pitfalls

1
Failing to maintain code organization can lead to confusion and inefficiencies.
As codebases grow, without a clear structure, developers may struggle to find and utilize existing code, leading to duplicated efforts and increased complexity.
2
Neglecting to adopt modern tools can hinder productivity.
Sticking with outdated build systems or practices can result in longer build times and frustration among developers, ultimately affecting the quality of the application.

Related Concepts

Modular Architecture In Software Development
Best Practices For Ios Development
Build Systems And Their Impact On Productivity