The Pragmatic Engineer
The Pragmatic Engineer

Scaling Slack and GitHub with Maude Lemaire

Brought to You By: • Antithesis – verify your system’s correctness without human review or traditional integration tests – and avoid bugs or outages. • turbopuffer – a vector and full-text search engine built on object storage. It’s fast, cheap, and extremely scalable. • Entire – The Git forge for a

Featured Speakers

Mode Lemaire Guest

Topics Discussed

Episode Summary

Executive Summary: Principal engineer Mode Lemaire shares lessons from scaling Slack, GitHub, and Cursor: identify real usage patterns before load testing, build targeted simulations, and treat performance and reliability as product concerns. She describes Slack’s database and WebSocket challenges, GitHub’s scatter-query limits in a Rails monolith, and why platform teams need ongoing contact with product teams. AI can accelerate exploration and implementation, but engineers must verify foundational changes themselves.

Main Topics: Slack’s data model and careful migrations: Slack initially sharded data by workspace, but enterprise use created cross-workspace load and complicated membership queries across separate tables for channels, private channels, and DMs. Lemaire consolidated access through a minimal abstraction, using feature flags, double writes, backfills, and shadow reads; a rollout mistake temporarily blanked employees’ sidebars. Load testing WebSocket-heavy products: Slack’s key risks were not captured by API-only tests: the team needed to simulate active WebSocket clients and realistic downstream behavior. Headless Chrome proved too costly and unstable, so Lemaire built lightweight Go clients and a recorder to capture representative product flows. Thundering herds, event floods, and product trade-offs: A popular announcement can prompt many users to load a channel and react at once, multiplying WebSocket traffic. Event floods can also overwhelm individual power users. Lemaire argues that engineers and product managers must decide which activity matters most under load; Slack prioritized text messages over emoji events. GitHub’s shard constraints and Rails monolith: GitHub had only 16 database shards for pull requests and issues, partly because scatter queries without a shard key had to hit many shards. Active Record made the underlying SQL and query impact difficult to see, while pages could involve over 100 database queries. Reducing scatter queries was necessary but difficult in a large legacy system. AI’s limits in performance and platform work: AI helped with exploration and implementation, but was weak at diagnosing complex performance problems, instrumenting asynchronous systems, and questioning foundational assumptions. Lemaire manually analyzed Cursor’s time-to-first-token path and used mutation testing to expose tests that merely confirmed generated code. Cross-pollination between product and platform teams: Product engineers who repeatedly encounter shared reliability or performance problems can help create platform solutions. But platform engineers can become detached from product realities, so Lemaire recommends regular rotations between teams to keep platforms aligned with how products are actually built and shipped.

Key Arguments: Load testing should begin with a clear understanding of how people use the product and which usage patterns are likely to break it; realistic, targeted simulations are more useful than generic throughput tests. A high-fidelity test is not automatically the best test. Slack replaced resource-intensive headless Chrome clients with lightweight Go processes that maintained WebSocket connections and reproduced selected API and cache requests. Reliability decisions require product judgment: when capacity is constrained, teams should deliberately prioritize essential interactions, such as message delivery, rather than treating all events as equally important. Database sharding cannot scale effectively if queries lack the key needed to target a shard. GitHub’s scatter queries constrained shard count, while Rails abstractions made it harder to identify and remediate query behavior. AI-generated suggestions and tests require human verification, especially for foundational platform changes. LLMs may propose parallel work that adds cost without reducing the actual bottleneck, or tests that fail to cover meaningful edge cases. Product and platform teams should exchange people and context regularly: product engineers bring firsthand knowledge of recurring needs, while platform teams can build shared guardrails that support faster product development.

Data Points: Slack load-test target: 500,000 active WebSocket connections - The team needed to test a prospective large customer’s realistic client and server flows, not just API throughput. Headless Chrome load-test cost: $0.37 per instance per five-hour tranche; approximately $150,000 for the test - The test was also unreliable: pods crashed and consumed time that could otherwise have been used for testing. Slack channel audience in the example: 100,000 active users - A company-wide announcement could prompt simultaneous channel reads and emoji reactions, creating a thundering herd. Distinct emoji reactions permitted per message: 23 - Slack limited distinct custom emoji reactions, while allowing multiple users to react with the same emoji. GitHub pull request and issue shards: 16 - At the time Lemaire described, these shards covered pull requests and issues across GitHub; scatter queries were a constraint on adding more. Queries to render a GitHub repository page: More than 100 MySQL queries across at least three clusters - Lemaire cited the repository home/files page as an example of the query volume in the Rails monolith. Slack data-access call sites: More than 400 - Lemaire migrated existing calls to channel membership data into a clearer access layer rather than changing every query’s behavior at once. Cursor users doing certain parallelized tasks: About 1% - Lemaire said some proposed parallel work would benefit only a small fraction of users while adding resource use for everyone. Slack sidebar interruption during a migration: About 30 minutes - A mistaken internal flag rollout and data backfill temporarily left employees with blank sidebars.

Pivotal Quotes: "You can't go around thinking you're going to load test strictly from an engineering perspective. You have to be putting your product hat on." — Mode Lemaire: She emphasizes that load-testing priorities depend on product consequences, not just technical throughput. "The whole point is to solve a problem holistically." — Mode Lemaire: She explains why platform work requires a durable foundation rather than partial fixes that leave the rest of a system unstable. "The platform should stop them or warn them." — Mode Lemaire: She describes the role of platform guardrails as product teams ship more quickly with AI tools.

Implications: As AI increases code and system activity, teams will need realistic load tests, deliberate product-aware prioritization, and stronger platform guardrails. Human understanding remains essential for diagnosing bottlenecks, validating AI output, and keeping platform work connected to product needs.

🔓 Sign Up for Unlimited Episode Search

About The Pragmatic Engineer

View all episodes from The Pragmatic Engineer