Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 8 min read Case study mediumAdept

Slack’s Migration to a Cellular Architecture

Slack moved its critical user-facing services in us-east-1 to a cellular architecture where each availability zone is a cell that can be drained, after a 2021 gray-failure network outage in one AZ caused user-visible errors across all AZs. Services are "siloed": they receive traffic only from their own AZ and send traffic only to backends in that AZ. Draining therefore only requires redirecting user requests at the edge, not changing RPC clients written in Hack, Go, Java and C++. Edge Envoy load balancers use weighted clusters and RTDS weights pushed from Slack's xDS control plane, Rotor, so operators can shift traffic away from an AZ gracefully in seconds at 1% granularity, without depending on resources inside the failed AZ.

Related posts

  • Incident Report: October 16th, 2025

    Railway easyNovice

    A traffic spike on Railway's Edge Network coincided with a routine edge service upgrade and exhausted memory in an internal routing service that was already running at high utilization. New proxies could not initialize, failed health checks and were pulled by load balancers, causing 2-3 minutes of intermittent HTTP/TCP failures (404s, 522s) across all regions while private networking stayed unaffected. Recovery came as caching absorbed the load. Fixes include higher memory limits, tiered memory alerts and overload safeguards, with a memory-efficient rewrite and a multi-region architecture planned to isolate failures per region.

  • Migrating Millions of Concurrent Websockets to Envoy

    Slack Engineering mediumAdept

    Slack moved its websocket ingress tier, serving millions of concurrent connections, from HAProxy to Envoy Proxy. HAProxy reloads spawned long-lived draining processes that had to be reaped and rate-limited. Envoy's dynamic clusters, hot restarts and panic routing removed that operational overhead. Envoy config was generated through custom Chef resources with --mode validate checks, and traffic shifted region by region via NS1 weighted DNS in 10–100% steps on a parallel stack, completing in six months with no customer impact. Key lessons: the organically grown HAProxy config hid behaviours services depended on, a test suite for load balancer routing would have saved effort, and limiting Chef libraries to a subset of Envoy features kept them simple but made later additions like vhosts awkward.

  • Building Self-driving Kafka clusters using open source components

    Slack Engineering mediumAdept

    Slack standardized roughly 10 Kafka clusters (0.7 PB, 6.5 Gbps peak) onto Kafka 2.0.1 and automated their operation with Chef, Terraform ASGs, Consul-assigned Zookeeper IDs, Cruise Control, Kafka Manager and a Prometheus offset exporter. Hot spots were removed by making partition counts a multiple of broker count, balancing consumers, throttling replication bandwidth and moving partitions in small batches. Chaos testing with dark traffic showed recovery was limited by packets per second, which jumbo frames helped address. It also motivated a dedicated Zookeeper per Kafka cluster and a cut-over upgrade policy instead of in-place upgrades. Splitting the largest topics off a saturated 90-broker cluster onto d3en instances gave about 2.5x efficiency, cut worst-case log latency from about 1.5 hours to 3-4 minutes, and reduced monthly alerts from 71 to 9.

  • Traffic 101: Packets Mostly Flow

    Slack Engineering mediumAdept

    A Slack request reaches its main region in AWS us-east-1 through a chain of hops. DNS answers come from Route53, or from NS1 for websocket records, and use edns-client-subnet to pick the nearest edge PoP. From there, Layer 4 NLBs pass traffic to Envoy-based Layer 7 tiers (envoy-wss for websockets, envoy-edge for API traffic), which route to internal services like Gatewayserver, Applink, Flannel, Imgproxy and Supra/Miata. Traffic from a PoP to the main region rides the AWS backbone, encrypted by Nebula. Failure handling is layered: a backup websocket domain uses an NS1 filter chain that shuffles among the three nearest regions to avoid thundering herds, a Degraded Mode falls back to the HTTP API when websockets fail, an Edge Pop Drain tool flips DNS to drain unhealthy PoPs automatically, and CloudFront has a backup CDN domain with client-side failover.

  • Unified Grid: How We Re-Architected Slack for Our Largest Customers

    Slack Engineering mediumAdept

    Slack re-architected its backend and clients to replace the workspace-centric model, where session tokens carried a workspace ID used for shard routing and access control, with an org-wide Unified Grid view for Enterprise Grid customers. The work built on earlier Vitess resharding by channel ID and on RTM changes. APIs were fixed in one of three ways: allowing calls that no longer depended on workspace routing, prompting users to pick a workspace, or fanning queries out across the user's workspaces, capped at 50 relevant workspaces per user. The rollout used a "prototype the path" approach: dogfooding internally, two-pass API fixes, a parallel integration test suite run with org context, shared permission helpers and client data-store migrations, finishing in March 2024.

The quest for software engineering knowledge.

Look:
Layout: