Case study · Stack

How Slack grew from a PHP app into a cellular platform on AWS

Slack is a messaging app for work, used by teams of every size. Its backend is a Hack monolith on HHVM with Java real-time servers, MySQL scaled through Vitess and a Kubernetes platform on AWS, while the desktop client is React and TypeScript inside Electron.
Copy this stackslack.com Team messaging and collaboration · United States · founded 2009

Language

  • Hackslack.engineering

    Is the language of Webapp, the monolith that hosts every API Slack clients call.

    Why: Its type checker catches errors while developers type, making refactors safer.

  • TypeScriptslack.engineering

    Types the desktop app's JavaScript codebase.

    Why: They needed a guarantee that the individual pieces fit together, which JSDoc comments couldn't give.

UI library

  • Reactslack.engineering

    Builds every UI component of the desktop client.

    Why: It updates the UI automatically when data changes, ending the sync bugs of hand-updated templates.

Full-stack framework

  • Electronslack.engineering

    Packages the desktop app, now with all workspaces in one process.

Hosting

  • AWSslack.engineering

    Hosts the core infrastructure across availability zones in us-east-1, each treated as a cell.

  • Kubernetesslack.engineering

    Runs services through Bedrock, Slack's internal compute platform.

    Why: Bedrock aims to make launching production-grade services simpler and hides the infrastructure's complexity.

  • Envoyslack.engineering

    Load balances traffic at the edge, replacing HAProxy, and drains bad zones.

Database

  • MySQLslack.engineering

    Stores Slack's data, from messages and channels to app directory info.

  • Vitessslack.engineering

    Shards MySQL and serves nearly all of Slack's database traffic.

    Why: They needed a flexible sharding model for new product features, plus built-in failover and backups.

Data fetching

  • Apache Kafkaslack.engineering

    Buffers jobs durably in front of the Redis job queue.

    Why: With Redis alone they couldn't guarantee write availability when the queue backed up.

  • Redisslack.engineering

    Runs the job queue for message posts, push notifications and billing.

  • Reduxslack.engineering

    Keeps one store per workspace with its data, connection status and WebSocket.

Backend framework

AI model

  • Amazon Bedrockslack.engineering

    Serves the LLMs behind Slack AI since mid-2024.

    Why: New models arrived there first, giving immediate access instead of catching up on SageMaker.

  • Vertex AIslack.engineering

    Adds Google Cloud as a second LLM platform for Slack AI.

    Why: It brings redundancy and a wider model catalog.

How they built it

From PHP to Hack

Slack launched in 2014 on PHP 5. In 2016 it moved to HHVM because it ran their PHP code faster, and then adopted Hack, which adds a static type system on top. Hack's partial mode let them add types file by file, so refactoring got safer without a big-bang rewrite.

When HHVM 4.0 dropped PHP support, Slack removed all its remaining PHP. The trade-off was losing access to most of the PHP package ecosystem.

Sources:slack.engineering

Outgrowing workspace shards with Vitess

From the start Slack stored data in MySQL, sharded by workspace, with the monolith deciding where every query went. That model created hot spots, shard-wide outages and a rigid data model as customers and features grew.

In 2017 Slack started moving to Vitess, which adds flexible sharding, automatic failover and backups on top of MySQL. By late 2020 Vitess served 99% of Slack's MySQL traffic, about 2.3 million queries per second at peak.

Sources:slack.engineering

Rewriting the desktop app with React

Slack's desktop app ran each signed-in workspace as its own Electron process, built on 2012-era jQuery and manually updated HTML templates. Memory grew with every workspace, and large workspaces downloaded far too much data up front.

The 2019 rewrite required every UI component to be built in React, gave each workspace its own Redux store inside a single Electron process, and cut memory use substantially. The desktop codebase had already moved to TypeScript in 2017 to make sure its many pieces fit together.

Sources:slack.engineering slack.engineering

Reliability: Kafka, cells and Bedrock

Slack's job queue ran on Redis until a database slowdown filled Redis memory and caused a major outage. In 2017 they put Kafka in front of Redis as a durable buffer, with two small Go services moving jobs in and out.

After a 2021 incident where one AWS availability zone degraded, Slack spent about 18 months turning its critical services into cells, one per zone, so traffic can be drained from a bad zone without user-visible errors. Services run on Bedrock, an internal Kubernetes platform that cuts service config from hundreds of lines to tens.

Sources:slack.engineering slack.engineering slack.engineering

Slack AI goes multi-cloud

Slack AI launched in 2023 on AWS SageMaker, chosen for security, FedRAMP compliance and model control, with LLMs running in an escrow VPC so the model provider never sees customer data.

New models kept reaching Amazon Bedrock first, so in mid-2024 Slack moved there for immediate model access. In early 2026 it added Google Cloud's Vertex AI for redundancy and a wider model catalog.

Sources:slack.engineering slack.engineering

Also detected on their website

Found on the homepage with the open Wappalyzer rules (HTML, scripts and headers). It shows what runs in the browser, not the whole backend.

  • Apache HTTP Server
  • Clearbit Reveal
  • HSTS
  • HTTP/3
  • OneTrust