Skip to content

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

Shopify Engineering 12 min read Case study mediumAdept

Lessons Learned From Running Apache Airflow at Scale

Shopify runs Airflow 2.2 on Kubernetes with the Celery executor and MySQL 8, and its largest environment handles over 10,000 DAGs and 150,000 runs per day. Running at that scale meant replacing GCSFuse with an in-cluster NFS server synced from GCS, enforcing a 28-day metadata retention policy, and tracking ownership through a per-environment namespace manifest. That manifest feeds a cluster DAG policy that restricts queues, pools and Kubernetes namespaces. To smooth load spikes, Shopify uses deterministically randomized crontab schedules hashed from dag_id and manages contention with pools synced from a ConfigMap, priority weights and isolated Celery queues.

Related posts

  • Why Astronomer chose ClickHouse to power its new data observability platform, Astro Observe

    ClickHouse easyNovice

    Astronomer built Astro Observe, an observability platform for Apache Airflow, on ClickHouse Cloud after a per-customer Amazon RDS Postgres setup degraded on large time-range aggregations and forced limits on retained data. Airflow DAG and task events flow through an ingestion API and Go enrichment services into Kafka for buffering and replay, then into ClickHouse, while low-volume deployment and GitHub change events are written directly. Tables share common keys such as org_id, run_id and asset_id; per-table TTLs handle retention, MergeTree engines deduplicate, and materialized views precompute aggregations at insert time. The motivating numbers: 100 million tasks a month with a 1.5% failure rate, each failure taking about 1.24 hours to resolve.

  • How to Reliably Scale Your Data Platform for High Volumes

    Shopify Engineering mediumAdept

    Shopify's Data Platform Engineering team prepared Tier 1 and Tier 2 ingestion and query services for a forecast near-doubling of BFCM 2020 traffic with a five-step reliability process. The steps were to define each service's primary objective (a freshness SLO for the Longboat batch ingester, a latency SLO for Reportify), identify tunable knobs such as job frequency, overlap interval, GKE CPU/memory, BigTable node pools and ProxySQL pools, and constrain those knobs to simulate N-times load. Teams then validated that every alert was actionable with simple runbooks and decided where to scale or tune. The exercise led to cluster scale-ups and job and query tuning, and BFCM ran with a 150% throughput increase and only minor self-healing incidents.

  • Accelerate testing in Apache Airflow through DAG versioning

    Zalando Engineering mediumAdept

    Zalando's Performance Marketing team runs multiple isolated versions of its Airflow-orchestrated marketing ROI pipeline on one shared test server, one per pull request. Each branch is deployed as a packaged DAG zip named after the branch. A patched Airflow DAG class reads the zip name to inject the environment into DAG ids and tags and to add unpacked folders to the Jinja template search path. A cron job tears environments down when PRs close. Matching data environments are created from stored DDLs as suffixed Spark databases on S3, using views over test tables instead of copying data, so new environments spin up in under a minute versus up to 30 minutes for a new MWAA server.

  • Evolving the Backend Storage for Platform Metrics

    Heroku Engineering mediumAdept

    Heroku migrated the time-series store behind MetaaS, its internal metrics service, from self-managed Apache Cassandra to AWS DynamoDB without user-visible impact. MetaaS ingests a couple hundred thousand observations per second into Kafka and aggregates them with stream-processing jobs, writing tens of thousands of points per second to the database. The migration used parallel dual-writes from Kafka and GitHub Scientist-style shadow reads, ramped to 100% of traffic, to catch edge cases. TTL-based retention meant no data backfill was needed: they waited for old Cassandra data to expire, then incrementally cut reads over. p99 query latency dropped from a variable 20–80 ms to a steady 15 ms, and costs fell.

  • How we scaled fast, reliable configuration distribution to thousands of workload containers

    Datadog Engineering mediumAdept

    Datadog replaced on-demand per-tenant config loading (database reads plus Kafka cache-invalidation messages) with a context-publisher that snapshots all tenants' configuration into RocksDB blobs in cloud storage and streams individual updates over Kafka. Because context data is only megabytes in total and changes thousands of times per day, every workload container can hold a full local replica. Containers download the blob at startup, apply streamed updates, and refresh the snapshot roughly every 10 minutes, so they keep working through a full outage of the central database. The design deliberately puts a tiny, externally unreachable service in charge and avoids bimodal fallback paths that would go untested and could overload the database.

The quest for software engineering knowledge.

Look:
Layout: