Skip to content

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

Slack Engineering 13 min read Case study mediumAdept

From SSH to REST: A Security-Driven Modernization of Slack’s EMR Data Pipelines

Slack replaced 700+ SSH-based Airflow operators that ran jobs directly on EMR master nodes with REST-based submission through Quarry, its internal job gateway. The migration covered 8 data regions over 3 quarters with zero downtime. The key enabler was YARN Distributed Shell, which runs arbitrary shell commands (aws s3 sync, distcp, Python scripts) in managed YARN containers via the standard ResourceManager REST API, while Spark and Hive moved to Livy and HiveServer2. Moving to real YARN submission exposed problems SSH had hidden: vmem check failures, fixed by disabling yarn.nodemanager.vmem-check-enabled, and network-segment dependencies on key-management endpoints. Multi-region rollout multiplied the testing and coordination effort.

Assumes: Apache AirflowHadoop YARNAWS EMRREST APIs

Related posts

  • Unlocking Efficiency and Performance: Navigating the Spark 3 and EMR 6 Upgrade Journey at Slack

    Slack Engineering mediumAdept

    Slack migrated 60+ EMR clusters serving 40+ teams from EMR 5 (Spark 2.4/Hive 2) to EMR 6 with Spark 3 as the single compute engine. Old and new clusters ran side by side during the year-long move. A shared Hive Metastore upgraded from 2.3 to 3.1 via Hive Schema Tool, parallel Bazel builds for Spark 2 and 3 JARs, and an Airflow operator flag to route jobs between cluster versions made that possible. Code changes covered replacing RAND()-based skew salting with AQE, setting storeAssignmentPolicy to Legacy, and disabling convertMetastoreParquet to avoid schema-merge StackOverflowErrors. Exact-match validation with Trino except/count queries preceded the switch, and most pipelines then ran 30–60% faster (some 90%), helped by AQE skew-join handling, shuffle partition coalescing and the EMRFS S3-optimized committer.

  • How Grab built Scarlet: the AI teammate that turns a Slack message into a production data pipeline

    Grab Engineering mediumAdept

    Grab's ADW team rebuilt Scarlet, its Slack-based data-pipeline agent, around a short core prompt plus a versioned library of Markdown skills (platform, routing, repository, workflow) loaded on demand, shrinking the prompt about 25x and letting new teams onboard by adding one reviewed repository skill. Platform tools sit behind two-tool MCP bridges, data-platform actions run under the requester's short-lived token, and sign-in pauses use LangGraph interrupts to resume runs. Scarlet now validates the data its changes produce by comparing CI candidate output against production (schema, counts, keys, nulls, stats, row diffs), with inconclusive treated as failure and verdicts bound to commits. Deterministic scaffolds replaced model guesses for predictable config, and after rollout the merge rate rose from about 50% to over 85% while repositories served grew about fourfold.

  • Data Lineage at Slack

    Slack Engineering mediumAdept

    Slack built a central Data Lineage Service that automatically captures table- and column-level lineage by hooking Airflow success callbacks and dashboard audit logs, then parsing the submitted SQL with ANTLR (backed by a large unit-test suite). Raw lineage lands in RDS MySQL, and a daily Spark job uses Pregel to traverse the dependency graph and write a flattened Hive table with a 'layer' column, so transitive downstream dependencies come back from a single query. A Data Portal notify feature uses this lineage to message downstream owners in Slack about deprecations and retention changes. Lineage for non-SQL Spark jobs, a graph database and automated schema-change alerts are listed as future work.

  • Remote Development at Slack

    Slack Engineering mediumAdept

    Slack moved webapp development off laptops (where Hack/HHVM, a 30-minute clone and Docker-based setups were slow and brittle) onto short-lived AWS EC2 remote environments accessed through VSCode Remote SSH. A warm pool kept in an Auto Scaling Group syncs with master periodically. A `slack remote-dev -b <branch>` CLI command reserves an instance, detaches it from the ASG, checks out the branch and syncs personal dotfiles from `~/.remote-dev-home`, producing a ready environment in under 90 seconds instead of roughly 12 minutes of bootstrap. Instances terminate on detach or when the branch merges. Upgrading from C5.2xlarge to C5.4xlarge took a single config change, and over 90% of webapp engineers adopted the workflow within months of its October 2021 GA.

  • Break Stuff on Purpose

    Slack Engineering mediumAdept

    Slack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application. The rebuild exposed a nearly two-year-old unmonitored backup that failed to restore and an outdated runbook, so users' dashboards and visualizations were lost. The team added scheduled backups, checked S3 retention, rewrote runbooks, and then deliberately filled the disks on a development cluster to rehearse recovery. The drill succeeded but missed the one-hour recovery goal and surfaced missing firewall rules in infrastructure as code. A later Kubernetes migration finished with about 30 minutes of downtime, and the backup script became a CLI that restores from cloud storage with a single command.

The quest for software engineering knowledge.

Look:
Layout: