Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

0003. Redpanda over Apache Iggy or a home-made log

  • Status: Accepted
  • Date: 2026-11-19
  • Issue: #16

Context

The gateway reads frames off the serial link, and Spate loads them into ClickHouse. Something has to sit between them and hold every frame while the pipeline is down. The drills kill the pipeline, restart the log and drain data-1, so that buffer is where a lost frame would come from.

What the log has to do:

  1. Keep a frame once it acknowledges it, through a crash or a restart.
  2. Let a consumer replay from an offset. Spate commits an offset only after ClickHouse confirms the batch is durable, so a restart repeats work rather than skipping it.
  3. Split frames by key across partitions and share them out to a consumer group, so the drill that scales the pipeline to two replicas works.

The constraints:

  • Spate already has a Kafka source. It has no source for anything else I’d consider.
  • data-1 has 2 shared vCPUs, 4 GB and a 40 GB disk, and ClickHouse, Grafana and the pipeline run there too.
  • There’s one data node, so nothing can be replicated yet.
  • Leg 1 is due on 20 November.

Decision

  • One Redpanda v26.2.7 broker runs as a StatefulSet on data-1, on a 10 Gi local volume. The manifests are in deploy/redpanda/, and just redpanda applies them.
  • telemetry.raw has six partitions, one replica and 1 GiB of retention per partition.
  • The broker starts in dev mode with one core and 512 MB. Production mode expects a tuned host and 2 GB per core, which data-1 can’t spare. Write caching and the fsync bypass that dev mode turns on are both off, so an acks=all ack means the frame is on disk. The gateway’s idempotent producer will use acks=all (#19).
  • just redpanda-check proves a Pod restart loses nothing. Holding pattern has the detail.

Options I turned down

  • Apache Kafka. The reference implementation, with the same protocol. It runs on a JVM with a heap of its own, which competes with ClickHouse for data-1’s 4 GB. The clients wouldn’t notice the difference, so I can swap it in later.
  • Apache Iggy. Written in Rust and lighter still. It speaks its own protocol and Spate has no Iggy source yet, so choosing it would put a new connector on the critical path. That connector is stretch work in #32.
  • Redpanda’s Helm chart or Operator. Both default to three brokers with TLS from cert-manager, and I have one data node. A StatefulSet I wrote shows every setting, and the fsync flag is one line in it.
  • A home-made log. I’d be writing offsets, retention, consumer groups and fsync handling myself. Every bug in them would show up as a lost frame, and the drills would blame the pipeline for it.

Consequences

  • The Kafka protocol is the contract. Spate’s source, rpk and any Kafka client work against it, and the broker behind it can change.
  • One broker with one replica means a lost disk on data-1 loses every frame Spate hasn’t loaded. Draining data-1 stops Redpanda until the node is back. Meanwhile the gateway will hold frames in a bounded buffer and apply backpressure once it fills (#19). The drain drill in #27 proves none go missing.
  • Dev mode’s defaults are unsafe for this job. A restart check can’t catch the fsync bypass, because the page cache survives a Pod restart. The flag is explicit in the manifest, and stopping data-1 hard in #27 tests it.
  • Seastar claims its memory up front and wants a core of its own. The flags and a 1 GiB limit keep it to its share of data-1.
  • Redpanda is source-available under the Business Source License, not open source. That’s fine for running it myself.
  • I’d revisit this if Spate gained an Iggy source, or if the licence stopped me running it myself.

References