Skip to content

SYSTEM Cited by 18 sources

Apache Kafka

Distributed, partitioned, replicated append-only log; the canonical open-source streaming-messaging substrate. Producers write keyed records to topics, which are split into partitions for horizontal scale; consumers read from partitions with at-least-once (default) or exactly-once semantics. Keyed records with the same key land on the same partition (hash-of-key ⇒ partition index), which is the foundation that higher layers (like systems/kafka-streams) build partition-local guarantees on top of.

Core primitives (referenced by Kafka Streams analyses)

  • Topic — named, append-only logical log.
  • Partition — unit of parallelism; each topic is split into N partitions; ordering is guaranteed within a partition only.
  • Record key — the hash of the key determines the partition. Identical keys land on the same partition of a single topic by construction.
  • Consumer group — set of consumers that cooperatively divide partitions of a topic; Kafka Streams is layered on top of this primitive.

Cross-topic keying (the Expedia sub-topology lesson)

Two topics with identical partition counts and similarly-keyed records do not by themselves guarantee that the same key lands on the same consumer instance across the two topics — that is a property of the consuming framework, not of Kafka itself. Kafka only guarantees same-key-to-same-partition per topic. When systems/kafka-streams is the consumer, the extra colocation guarantee is sub-topology-scoped — see concepts/partition-colocation and sources/2025-11-11-expedia-kafka-streams-sub-topology-partition-colocation.

Batching semantics — what Kafka does and doesn't do

Kafka's producer-side batching is byte-count + message-count + time-window within a partition:

  • batch.size — max bytes buffered per partition before dispatch.
  • linger.ms — max wait to accumulate a batch.
  • max.in.flight.requests.per.connection — pipeline depth.

These compose to a transport-economics batching primitive (saturate TCP, amortise broker bookkeeping) but don't express payload-attribute budgets"Kafka batches by bytes/messages within a partition; token count varies with text and tokenizer, so there is no efficient way to batch requests by Σ token_count_i" (2025-12-18 Voyage AI). For application-specific batching such as token-count batching for GPU inference, the pattern is to keep Kafka for durability / fan- out / delivery and insert a lightweight aggregator between Kafka and the workers that runs application batching logic.

Seen in

Origin + substrate (2024-05-09 Kozlovski Kafka-101)

Stanislav Kozlovski's Kafka-101 explainer on High Scalability (2024-05-09) is the wiki's canonical architectural tour of Kafka. Key framings this system inherits:

Log compaction correctness bug (Kafka 3.9–4.2)

A compaction–replication race disclosed by Redpanda (2026-06-25) demonstrates that Kafka's per-broker, uncoordinated log compaction can cause permanent replica divergence on compacted topics with transactional writes. If a broker is offline longer than delete.retention.ms (default 24 h), tombstones or transaction control batches may be compacted away before the broker replicates them, producing four distinct failure modes: deleted data reappears, aborted data served as committed, committed data hidden, or read_committed consumers frozen at a stale Last Stable Offset. The bug reproduces reliably; no parameter-tuning fix exists because no finite retention value guards against unbounded unavailability. (Source: sources/2026-06-25-redpanda-kafkas-log-compaction-corrupts-data)

Tiered Storage at 150B events/day (Atlassian StreamHub, 2026)

Atlassian's StreamHub runs Kafka via MSK at 150 billion events/day (3.2M events/sec peak). Their Tiered Storage deployment exposed critical operational lessons:

  • Local tier = 5 minutes on EBS (hot, real-time consumers); Remote tier = S3 with 7-day retention (historical reads, backfills).
  • Tiered Storage is a cost and retention strategy, not a capacity strategy: if brokers are saturated, the async remote-copy workers fall behind, causing linear local disk growth.
  • S3 delete storms: reducing retention triggers mass deletes that compete with regular remote writes, stalling offload and filling local disks. Treat retention changes as production risk operations.
  • Broker headroom is a reliability feature: replication, consumer fan-out, cross-region relay, retries, and tiered storage offload all compete for the same broker network/EBS budget. Plan around peak per-broker metrics, not cluster averages.

Key operational patterns: patterns/conservative-broker-headroom, patterns/failover-cluster-escape-hatch, patterns/cluster-sharding-for-blast-radius, patterns/ingress-rate-limiting-and-quarantine.

(Source: sources/2026-07-28-atlassian-scaling-streamhub-transitioning-from-kinesis-to-kafka)

Last updated · 608 distilled / 1,877 read