Skip to content

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

Lyft Engineering 12 min read Case study mediumAdept

Rerouting the Stream: How Lyft Moved to the Apache Flink Kubernetes Operator

Lyft retired its homegrown Flink Kubernetes operator and moved hundreds of streaming jobs to the open-source Apache Flink Kubernetes Operator. To avoid rewriting every config, a translation layer in the deploy API converts the legacy FlinkApplication CRD into a FlinkDeployment, and dynamic config allows per-app migration and instant rollback. Getting the full benefit took follow-on work. Deploys caused 3–20 minutes of downtime until FlinkBlueGreenDeployments was adopted. Upgrading to Flink 1.19 enabled in-place autoscaling and Kinesis backlog metrics. Autotuning reclaimed memory that Beam Python harnesses had been hiding in JVM overhead, which OOM-killed TaskManagers until the harness moved to a sidecar. Because autotuning requires restarts, critical jobs use in-place autoscaling only, while other jobs use both features. Variable pod sizes then pushed Lyft to Karpenter and most-allocated scheduling to cut unused spend.

Related posts

  • From Homegrown to Flink: Migrating a Stateful Ad Event Join at Scale

    Zalando Engineering hardMaster

    Zalando's Ad Platform team replaced a 7-year-old homegrown Java service that joins ad auction (bid) events with user interaction events within a 15-minute window with an Apache Flink pipeline using RocksDB state and incremental checkpoints. Flink's built-in interval join spent 15-30% of CPU on RocksDB seeks and maintained a ~70M-entry timer queue, so the team wrote a KeyedCoProcessFunction with two ValueStates keyed by unique bid ID and TTL-based compaction cleanup, cutting the join operator from 30-60 subtasks and 150-300GB memory to 10 subtasks and 50GB. The post also covers RocksDB compaction tuning to stop state growth, a custom Kinesis deaggregation layer, Enhanced Fan-Out throttling issues, Karpenter evicting pods during Flink rescales, kernel OOM kills fixed by raising JVM overhead and lowering managed memory, and a four-week shadow pipeline plus A/B test before cutover.

  • 7 Tips For Optimizing Apache Flink Applications

    Shopify Engineering mediumAdept

    Lessons from running large stateful Apache Flink jobs (up to 13 TB of state) on GKE with the RocksDB state backend and checkpoints on GCS. Disabling Kryo fallback and fixing the serialization failures it exposed, such as Scala BigDecimal and sealed-trait ADTs, raised throughput by 20%. Keying records by partition before the File Sink cut active buckets per Task Manager by 90% and ended heap OOMs, and local SSDs for RocksDB gave about a 10x processing speedup over NFS. Further tips cover separate config profiles for backfill and steady state (partitions, network buffers, checkpoint intervals), avoiding dynamic classloading to stop Metaspace leaks on restart, and profiling with async-profiler, VisualVM, jemalloc/jeprof and Eclipse MAT.

  • 3 (More) Tips for Optimizing Apache Flink Applications

    Shopify Engineering mediumAdept

    Three practices for tuning large stateful Apache Flink jobs, drawn from Shopify's streaming platform. Size parallelism so task managers × slots per task manager is equal to or slightly above the highest operator parallelism (e.g. 25 TMs × 4 slots for parallelism 100), starting with a single environment-level value. Prevent sink backpressure with batched writes (Kafka batch.size, Bigtable bulk mutations) and fix keyBy skew by appending a random bucket to hot or low-cardinality keys, then re-aggregating. Use HybridSource to present archived object-storage data and live Kafka topics as one ordered DataStream, which also speeds backfills because the archives have far more partitions.

  • Scaling Shopify's BFCM Live Map: An Apache Flink Redesign

    Shopify Engineering mediumAdept

    Shopify scaled its Black Friday/Cyber Monday live sales map by putting Apache Flink in front of Cricket, its home-grown Go stateful streaming service. Flink filtered the checkout Kafka stream so Cricket processed only about one percent of the events, and Flink also computed new metrics such as product trends and unique shoppers. The Flink jobs used cross-region sharding and active-active deployment, handled load tests of 1M events/sec and ran with 100% uptime through BFCM, with Spark batch jobs as a fallback. Redis used for broadcasting to browsers still became a bottleneck and briefly clogged in production, so the planned redesign moves all metrics into Flink and snapshots them to a store that a web tier serves from an in-memory cache.

  • Achieving relentless Kafka reliability at scale with the Streaming Platform

    Datadog Engineering mediumAdept

    Datadog runs hundreds of Kafka clusters with millions of partitions and built the Streaming Platform, a control layer that decouples producers and consumers from specific clusters through "Streams" spanning clusters, AZs and Kubernetes environments. A custom coordinator, the Assigner, replaces Kafka's timeout-based group coordination with metric-driven, seconds-scale rebalancing and live failovers that create a new topic and drain the old one. Head-of-line blocking is removed with priority lanes, a dead-letter lane for poison pills, and multi-range offset tracking stored in commit metadata, which also carries ingestion timestamps to compute real-time time lag from __consumer_offsets. After zstd decompression bombs crashed consumers, the team built libstreaming, a Rust Kafka client with bindings for other languages, and rejected a gRPC proxy because of throughput and latency costs.

The quest for software engineering knowledge.

Look:
Layout: