Unlocking Efficiency and Performance: Navigating the Spark 3 and EMR 6 Upgrade Journey at Slack
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.
Related posts
- From SSH to REST: A Security-Driven Modernization of Slack’s EMR Data Pipelines
Slack Engineering mediumAdeptSlack 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.
- Data Lineage at Slack
Slack Engineering mediumAdeptSlack 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.
- Tulip: Modernizing Meta’s data platform
Meta Engineering mediumAdeptMeta migrated its exabyte-scale analytics logging platform from legacy Hive Text Delimited and JSON serialization to the Tulip format across more than 30,000 logging schemas, sharply cutting bytes logged per second while schema counts stayed flat. The migration relied on a mixed-mode wire format, where Tulip payloads are prefixed with the invalid UTF-8 bytes 0x80 0x00 so old and new formats can coexist on one Scribe stream. Supporting tools included format-agnostic Reader libraries and legacy-format converters in consumers, shadow loggers verified by a Spark job comparing rows by ID, a loggertail CLI for decoding streams, and rate-limited rollouts. Scaling to the long tail depended on daily automated targeting of schemas whose consumers were all ready, plus a live migration guide, support group and office hours.
- From Spreadsheets to DuckLake: A Data Engineer's Road to DuckDB
DuckDB mediumAdeptData engineer Matt Martin traces his path from copy-pasting Excel reports through Teradata, BigQuery and heavyweight Spark clusters to DuckDB, which let him query local CSVs, S3 Parquet files and Iceberg tables in a few lines of SQL with no JVM or cluster. He favours DuckLake over Iceberg because it keeps lakehouse metadata in a SQL database. In his experience, catalog operations that take seconds with Iceberg's metadata files resolve in under a millisecond, and the setup is two statements instead of a 20-plus-line Spark configuration. In DuckDB 2.0 alpha, asynchronous I/O cut his S3 read times for 1,000–10,000 files by 67–70%, and ATTACH now accepts expressions such as getenv. The Quack protocol can also serve a DuckLake over HTTP without handing out AWS credentials.
- Scaling SaaS security: Reco’s migration from Postgres to ClickHouse Cloud
ClickHouse mediumAdept
Reco, a SaaS security platform ingesting 10-12 billion JSON events weekly, moved over 90% of its workload from Postgres to ClickHouse Cloud. Running both databases synced via CDC had made schema migrations, updates, deletes and VACUUM painful. Reco replaced RDBMS features with ReplacingMergeTree and CollapsingMergeTree for upserts and deletes, idempotency and eventual consistency instead of transactions, and tenant-level atomic materialized view refreshes via REPLACE PARTITION. Further gains came from compute-compute separation, spill-to-disk settings, parallel_distributed_insert_select=2 (cutting resource needs by a third) and data-skipping indexes, plus using the EmbeddedRocksDB engine as a streaming state store in place of Spark state and Redis.