DataLane
← All stacks

Kafka

Partitions, consumer groups, and the streaming trade you can defend

10 questions with solutions

  1. Q1LinkedInConfluentUber

    Why can two consumers in the same group not share one partition?

    Solution

    A partition has a single offset per group. Throughput scales with partitions, not with extra consumers parked on the same partition. To add parallelism, add partitions (and accept the rebalance) or split topics by domain.

  2. Q2AmazonNetflixTwilio

    Kafka vs Kinesis — what is the real trade?

    Solution

    Kafka: you own brokers, retention, and ops (or pay for a managed cluster). Kinesis: less ops, shard math, AWS lock-in, 24h–365d retention knobs. Pick from ops budget and existing cloud, not a blog benchmark.

  3. Q3StripePayPalSquare

    at-least-once vs exactly-once. What do you actually promise a downstream table?

    Solution

    Most pipelines are at-least-once plus an idempotent sink (MERGE on event_id, or Kafka transactions into a compacted topic). Exactly-once is a property of a specific producer–broker–consumer setup, not a checkbox on the resume. Say what happens on a retry.

  4. Q4SlackDatadogConfluent

    A consumer lag spike at 09:00. How do you debug in order?

    Solution

    Is production up (messages/sec)? Is the consumer crashed or stuck in a rebalance? Is a hot partition (key skew) starving others? Is the sink slow (warehouse credits, rate limits)? Lag alone is not a root cause. Show consumer-lag by partition, not a single number.

  5. Q5LinkedInShopifyRobinhood

    Compaction vs deletion retention. When do you use a compacted topic?

    Solution

    Compacted topics keep the latest value per key (CDC changelog, config, ktables). Time retention drops old messages regardless of key (raw events). Using compaction on a clickstream deletes history you still need for sessionization.

  6. Q6AirbnbLyftDoorDash

    What is a poison pill, and how do you not stall the whole partition?

    Solution

    A record that always fails deserialization or sink validation. A naive retry loop blocks that partition forever. Dead-letter the record (with the offset), alert, keep consuming. Know the difference between retryable sink errors and bad payloads.

  7. Q7ConfluentLinkedInUber

    max.poll.interval vs a slow sink.

    Solution

    If processing exceeds the interval, the member is kicked and the group rebalances. Shrink the work per poll, speed the sink, or raise the interval with eyes open.

  8. Q8DebeziumConfluentShopify

    Tombstones — what do you produce for a CDC delete?

    Solution

    A null value for that key on a compacted topic. Downstream must apply deletes. A random new key is not a delete.

  9. Q9LinkedInUberConfluent

    linger.ms and batch.size — what are you trading?

    Solution

    Latency for throughput. A firehose with linger 0 wastes RPCs. Correctness is acks/ISR, not linger.

  10. Q10ConfluentLinkedInStripe

    Schema registry compatibility in CI.

    Solution

    A producer adding a required field will kill old consumers. Fail the PR on a BACKWARD/FORWARD break you did not mean.

↑↓ navigate openesc close