Building Reddit’s iOS and Android app

The Pragmatic Engineer 1h26 8 min #34
Building Reddit’s iOS and Android app
Watch on YouTube

Summary

  • Reddit’s native iOS and Android apps are massive — each around 2.5 million lines of code, with 500+ screens and 200+ mobile engineers — and between 2021 and 2025 the company undertook a sweeping modernization of both codebases under an internal initiative called “Corestack.” Three members of Reddit’s mobile platform team (Lauren, Brandon, and Eric) walk through why the rewrite was necessary, how they chose their tech stacks (GraphQL, MVVM, Jetpack Compose on Android, and a homegrown UI framework called SliceKit on iOS), what worked, what didn’t, and what they’re still changing.

The scale of Reddit’s mobile codebase

  • Each platform (iOS and Android) has roughly 2.5 million lines of code and around 580 screens — far more than most people expect from an app they think of as “a feed and some posts.”
  • Android has about 800 Gradle modules; iOS has over 1,000 build targets of varying kinds.
  • Build times were a major pain point: full clean builds took ~30 minutes on iOS and 8–9 minutes on Android (with remote caching). Incremental builds are much faster, and the teams use “focus mode” / “playground” builds that let developers compile only the subset they’re working on, dropping build times to 30 seconds–10 minutes depending on the area.
  • The mobile platform teams are about 10–11 engineers each (iOS and Android separately), supporting roughly 200 mobile engineers across ~20 feature teams company-wide. This is unusual — most companies mix Android and iOS engineers on a single platform team, whereas Reddit runs them as sister teams with deep platform-specific expertise.

Why Reddit has so many mobile engineers

  • Beyond the obvious feed and post-detail surfaces, Reddit has dedicated mobile engineers working on safety features, moderation tools, ads, eventing/logging, experimentation platforms, and a developer platform for third-party extensions.
  • A significant investment in test infrastructure and automation (including contractors brought in to build a testing culture) also accounts for many of the builds and headcount.
  • Testing maturity has grown from ~2% unit test coverage and no integration/E2E tests to a full pyramid: unit tests (enforced by coverage ratchets), integration tests, blackbox UI tests for accessibility assertions, and even memory-leak analysis wired into UI test infrastructure. Tests run on both simulators and real devices via a vendor partnership.
  • The payoff: fewer production incidents, easier onboarding, and the ability to hire more junior engineers who no longer need to understand a patchwork of legacy patterns. The downside: flaky tests and the pain of retrofitting testability onto code never designed for it.

AI coding tools in their workflows

  • None of the three rely on AI to write production mobile code. Eric uses Gemini in Android Studio as a “fancy autocomplete” but doesn’t trust it for problem-solving. Brandon uses Apple’s built-in Xcode tooling and ChatGPT heavily for ad-hoc tasks (e.g., relearning Git commands, breaking down problems) but has never gotten good code for specific mobile challenges.
  • The more promising near-term use case is AI-assisted test insights — identifying which tests are actually pulling their weight after the coverage ratchets were applied — though this is not yet widely adopted.

Why Reddit launched the Corestack modernization in 2021

  • Around 2021, Reddit was growing internationally and shifting from web-first to mobile-first, especially overseas. The company roughly quadrupled its mobile engineering org (from ~40–50 to ~200 engineers) in about two years.
  • At the same time, developer experience was terrible: clean builds took 2.5 hours, there was no test infrastructure, and feature teams couldn’t execute on their goals. New hires were shocked by the state of the tooling.
  • User-facing metrics were also at their worst: Android P90 startup time was 13 seconds, iOS was 7–8 seconds, and there were production incidents with no observability (e.g., a feed outage the week Eric joined where the team couldn’t diagnose what was wrong).
  • Executive leadership asked for a single umbrella plan — this became “Corestack,” a branded prescription for the entire mobile tech stack.

The Corestack prescription

  • Monorepo, modularized by feature — each platform moved to a single repo with clear module boundaries.
  • Modern language — Kotlin on Android, Swift on iOS (both already underway, just needed to be blessed as the standard).
  • GraphQL-first (then GraphQL-only) API layer — migrating from REST to give clients typed contracts, clearer observability, and a single networking layer to optimize.
  • MVVM architecture — replacing the legacy MVP (Model-View-Pattern) pattern, largely forced by the adoption of reactive UI frameworks.
  • New design system — to stop the proliferation of duplicate UI components (at one point there were ~15 different spinner controls across the clients).
  • The promise: if feature teams follow this prescription, the platform team builds “golden path” tooling so feature engineers can focus on features, not infrastructure.

The REST-to-GraphQL migration

  • The migration took years and is only recently winding down. An early internal GraphQL implementation (built by an engineer named Aiden) lasted five years in the codebase.
  • GraphQL gave Reddit typed contracts, a schema, and the ability to name queries — which proved invaluable for incident response (e.g., discovering a problematic call was only deployed on Android, so iOS on-call could stand down).
  • The migration was initially naive: a 1:1 mapping of REST endpoints to GraphQL, which preserved flat models and didn’t fully exploit GraphQL’s flexibility. This left too much client-side logic in the app and led to overfetching.
  • The backend GraphQL team drove much of the adoption and was a strong partner, but the initial GraphQL infrastructure was noticeably slower than REST. Feature teams were frustrated migrating toward a latency hit, so Reddit worked with the backend team to reduce latency before fully switching over.
  • Despite the pain, all three engineers say they’d do it again — the unified contract and single networking layer have enabled codegen, optimizations, and better observability that wouldn’t be possible with a fragmented REST surface.

Android’s bet on Jetpack Compose (while it was still in alpha)

  • When the Android team started its first Compose feature, the framework was still in alpha; they shipped while it was in beta.
  • The bet was possible because the feature (Reddit Talk, a live voice-chat room feature) was greenfield, launched to only two subreddits initially, and owned end-to-end by a single engineer (Eric) who was willing to rewrite it if the bet failed.
  • Compose forced the shift from MVP to MVVM because it’s a reactive framework and imperative architecture patterns don’t work well with reactive UI.
  • Reddit Talk became the reference implementation for Corestack and proved that greenfield work could adopt the new stack quickly. Adapting legacy, critical-path features required more effort and extensions beyond the base prescription.

iOS’s homegrown SliceKit — and the move to SwiftUI

  • In 2021, iOS evaluated SwiftUI but decided against it: the back-deployment target was iOS 13–14, SwiftUI was still relatively new and immature, and it had real limitations.
  • Instead, the team built SliceKit — a declarative wrapper around UICollectionView. It solved real problems: it moved the feed (and other vertical scrolling lists) off Texture (an async UI framework from Facebook/Pinterest that no one on the team knew), made dynamic type and accessibility easier, and brought the codebase back to Apple’s main-thread UI model.
  • Over time, SliceKit’s limitations became clear: it’s tremendously complex to write a declarative wrapper around UIKit, component reuse is hard, and boilerplate remains an issue.
  • The iOS team is now progressively replacing SliceKit with SwiftUI, but doing it carefully: individual SwiftUI cells can be dropped into SliceKit screens, A/B tested for performance and accessibility, and rolled out at each team’s own pace. The full replacement is a multi-year effort, and the platform team ensures that everything teams shipped in production today continues to work throughout the transition.

Server-driven UI — promising in theory, painful in practice

  • Reddit experimented with server-driven UI on its most important surface: the feed. The motivation was sound — the feed had tons of display logic duplicated across clients, and Android and iOS feeds sometimes looked different for the same content.
  • In practice, it backfired: the server-driven UI definitions didn’t include full post models, so the app had to double-fetch (once for the UI spec, once for the actual data). This doubled the error surface — a failed fetch on either call meant tapping a post did nothing, a bug users saw in production.
  • The team is walking back from server-driven UI on the feed. However, it works well in simpler contexts like the content-reporting flow, where the server is just driving a list of strings (reporting reasons).
  • Lauren argues the idea shouldn’t be abandoned — the problem was underdeveloped implementation and insufficient cross-team coordination, not a fundamental flaw. Brandon points out that web browsers are proof server-driven UI can work at extreme complexity, but mobile teams need to carefully scope what they’re trying to achieve.

How the modernization paid off

  • Developer experience: Developer sentiment surveys went from rough to positive. Onboarding is easier because there’s a consistent set of patterns. Interview candidates are now excited by the tech stack rather than dismayed. The teams can hire more junior engineers. Platform teams can build tools and observability that work for most teams most of the time because everyone is on a similar stack.
  • Productivity: Feature teams built Reddit Recap with half the people compared to the previous year. Features ship faster with extra polish (animals, animations) because engineers spend less time fighting infrastructure. Code ownership and modularization improved productivity measurably.
  • User-facing metrics: Crash rates improved ~1.5 percentage points on Android and ~1% on iOS (from nullability safety alone in Kotlin/Swift). Startup times dropped to under 3–4 seconds at P98+ and have stayed there for years. Stability and performance metrics rarely regress because the team puts policies in place to guard them.
  • Organizational: The platform teams can now focus on the next pressing problem (scroll performance, video performance) rather than constantly firefighting. Shared understanding across the org means mentoring is easier — you no longer need 15 minutes of context to answer a question.

What Reddit’s platform teams look for in hires

  • A mix of internal transfers (top performers from feature teams who have pain points they want to solve at scale) and external hires (from both large companies with scale experience and startups with scrappy zero-to-one skills).
  • Key traits: ownership, first-principles thinking, and genuine interest in helping other engineers (at least ~25% DevX work). Platform engineers need to sit with the long-term consequences of their decisions — systems they build tend to last 5+ years and must be maintained and re-evaluated as assumptions change.
  • Platform work is not a great first job; experience at a startup or smaller org where you see what happens after you ship is valuable. But the bar has risen as Reddit has scaled, so applying even if you’re not sure you meet all criteria is encouraged.
  • The teams actively push back on the “elite platform team” archetype. Psychological safety, blameless postmortems, and humility are essential — otherwise platform teams play it safe and add friction (lint rules, process) instead of solving real problems.

Rapid fire picks

  • Favorite framework: Brandon picks SwiftUI (usability and elegance); Eric picks libgraphql.js (taught him the most); Lauren picks Jetpack Compose (maintainable, testable, unidirectional data flow).
  • Book recommendation: Brandon recommends Tidy First by Kent Beck (a thin book full of small ideas that changed how the team thinks about code structure); Eric recommends The C Programming Language (Kernighan & Ritchie) — typing out every example will make you a better programmer; Lauren recommends Project Hail Mary by Andy Weir (fiction she couldn’t put down).
Back to The Pragmatic Engineer