Unified Grid: How We Re-Architected Slack for Our Largest Customers
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.
Related posts
- Role Management at Slack
Slack Engineering mediumAdeptSlack replaced its coarse guest/member/admin/owner hierarchy with a role-based access control system that grants granular permissions such as ARCHIVE_CHANNEL scoped to an enterprise or workspace entity. Authorization runs as ordered policy rules in the Hack monolith: deny restricted users, then check legacy preferences, then call a containerized Go permissions service over gRPC. That service reads from the same user_id-sharded Vitess store as the monolith. Clients get non-authoritative permissions via the Flannel edge cache and real-time updates in Redux. Rollout went from a loopback service to dark-mode dual reads compared in Prometheus, then light mode, and a codegen CLI built on HHAST lets other teams add roles without touching framework internals.
- Slack’s Migration to a Cellular Architecture
Slack Engineering mediumAdeptSlack 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.
- How Meta built the infrastructure for Threads
Meta Engineering mediumAdeptThreads reached 100 million sign-ups in five days on existing shared Meta infrastructure rather than purpose-built systems, illustrated through two components: ZippyDB and Async. ZippyDB, a multi-tenant key/value store, absorbs sudden demand by shifting unused allocations and slack between keyspaces via config changes. It scales out with a zero-downtime resharding protocol that remaps logical shards to new physical shards, which let the team proactively prepare Threads keyspaces for 100x growth just before launch. Async (XFaaS), a serverless deferred-execution platform, queued the far-higher-than-expected follow-graph imports and notification jobs and rate-limited their execution to protect downstream services such as the social graph database.
- Managing Slack Connect
Slack Engineering mediumAdeptSlack built per-connection configuration for Slack Connect using a single MySQL table keyed by source and target team ID, with org-level defaults modeled as target team 0 and settings stored as a Protobuf blob to avoid per-setting columns and tables. The application-layer store first grew into a tightly coupled monolith of per-pref logic, so it was refactored into a container that delegates to per-pref wrapper classes implementing transform, isValid and migrate, with exceptions isolated per pref. Wrapper classes won over code generation because each pref differed too much to template. For admin dashboards, multi-table reads over partitioned data caused latency and timeouts, so Slack denormalized connection data into Solr instead of MySQL, accepting a roughly five-second indexing delay in exchange for full indexing, array-field queries and dynamic fields that scale to millions of connections.
- Introducing Warehouses: Compute-compute separation in ClickHouse Cloud
ClickHouse mediumAdept
ClickHouse Cloud Warehouses let multiple services, each with its own endpoint, compute nodes, sizing, idling and network access rules, read and write the same data, isolating workloads such as ingestion, BI dashboards and ad-hoc analysis. Data sharing rests on storage-compute separation over object storage, SharedMergeTree metadata kept in a shared Keeper cluster, and replica groups in the Replicated database that keep distributed queries inside each service. Read-only services skip background merges, so they are fully isolated from write load, while multiple read-write services can still affect each other through merges. The recommended setup is a single read-write service for ingestion with read-only services for everything else. Current limits include a primary service that cannot be idled and DDL that idle services can block (worked around with distributed_ddl_task_timeout=0).