Production checklist

A go-live checklist for StoatFlow — replica count, license, probes, metrics, error policies, tuning, and thread safety — each item linking to the canonical page that covers it in full.

Before you put a StoatFlow application in front of production traffic, walk this list. Each item is a decision or a wiring step you can verify, and each links to the page that covers it in full — this page is the index, not the explanation.

Deployment and the HA tier

The one rule an operator must not break: run exactly one active instance. Two active instances pointed at the same source topics corrupt state. Then choose your HA tier — fast restart (default) or the opt-in hot-standby cluster — deliberately.

  • HA tier chosen deliberately. Fast restart (default, replicas: 1) for most workloads, or the opt-in hot-standby cluster (replicas: 2 or more, ha.mode: active-standby) for near-instant failover on large state / tight RTO. → High availability
  • replicas: 1 on the workload (default mode), with a rollout strategy that tears the old pod down before the new one starts processing — never two active concurrently. Hot standby is the exception: a readiness-gated cluster of replicas: 2 or more. → Kubernetes, High availability
  • Failure mode of two active instances understood, and why the standby is passive. → Architecture, Deploying and operating
  • Stable application-id. It is the application's identity — the consumer group and changelog topics derive from it. Two active processes sharing it collide. → Core configuration
  • Upgrades roll forward. A normal rolling update needs no upgrade ordering. A rollback is bounded by the newest build whose records a store holds, not by the last build that ran: a build that cannot read a store's changelog records or layout-stamp schema refuses to start (ChangelogFormatException, or StoreLayoutMismatchException saying the build is older than the data), keeps local state, and stays down until a build that reads them runs. A local-only format change is rebuilt from the changelog instead, and a store with no changelog or source topic can start empty under state.layout-mismatch: wipe-and-restore. → High availability
  • Graceful shutdown on SIGTERM. The runtime drains in-flight records and commits a final barrier before exiting; give the orchestrator's termination grace period enough headroom (and, under hot standby, room for the handoff). → Kubernetes
Never run two active replicas of the same StoatFlow application against the same source topics. This is the single most important item on the list. The supported way to run more than one replica is the passive hot-standby cluster. → Deploying and operating

State persistence and restart

Fast restart — the default HA tier — depends on whether the new pod starts with a warm local store or rebuilds state from the changelog cold. (Hot standby sidesteps the restore entirely by keeping one or more warm standbys ready — see High availability.)

  • Persistent volume for warm restart. A PersistentVolumeClaim retained across restarts means restoration only reads the changelog gap since the last commit, not the whole topic. → Kubernetes
  • Restart window understood. Cold-start time scales with state size; the levers are state size, disk persistence, and broker read throughput. → Tuning, Benchmarks
  • The application can read its topics' metadata at startup. Before a restore, StoatFlow describes every changelog and source topic (Describe) and reads their end offsets. Before that, it describes every sink topic and every declared dead-letter topic to check they exist — Write implies Describe, so this matters only when kafka.admin sets a principal of its own; an authorization error there fails the start at once, an unanswered read is retried for up to state.restoration-metadata-timeout-ms. It also reads the cleanup.policy of each KTable source topic it may reuse (DescribeConfigs, unless ktable.auto-reuse-source-topics is off or the table pins its source). An unreadable answer — a topic created moments ago included — is retried for up to state.restoration-metadata-timeout-ms (30 s), then the start fails and names the store; an authorization error fails it at once. A store is never rebuilt from metadata StoatFlow could not read, and each store's local check — a read-only look at its metadata, no data file opened — is bounded by state.restoration-validation-timeout-ms (30 s) from its own start, as is each other startup probe of a store directory. Both are short on purpose: the failed start stops the application and the pod restart recovers it. → State stores
  • One instance per state directory. A store directory another open still holds fails the start, naming the store and the likely holder; nothing is deleted. Never point two instances at the same state-dir. → State stores
  • A table's restoration source is not flipped in place. Turning ktable.auto-reuse-source-topics off, or pinning a table that restores from its source topic to a changelog, fails the start when the table's local state shows it restored from its source: the change needs the table rebuilt — reset the group on the source topic to the earliest offset, delete the store's local state, start. An in-memory table, or one on a fresh disk, has no such state: the start goes on with a WARN naming the table when its changelog topic is absent while the group has consumed the source (read with Describe on the group; without it, no warning). Treat that WARN as the same rebuild. → State stores
  • Recovery semantics confirmed for your chosen processing guarantee — the last successful commit barrier is the recovery point. → Exactly-once
  • Changelog topics provisioned, if you pre-create topics. With changelog.create-topics-if-not-exist: false, create every store's changelog and the engine's own — <application.id>-stoatflow-watermark-changelog (windowed aggregations, time-based suppress, stream-stream joins), one -emitfrontier-changelog per onWindowClose() aggregation, -timer-store-changelog when a processor declares timer types on a persistent timer backend with its changelog on — and grant the application access. describe() does not list the engine's. → Which changelog topics an application creates
  • Changelog topics replicated with their record headers, if you mirror them to another cluster. A changelog record's format version travels in a native record header, so a replicator that drops headers would make every record read as version 1. MirrorMaker 2 keeps them. → High availability

Processing guarantee

Pick exactly-once or at-least-once deliberately — it is the central reliability decision and it shapes your latency floor.

  • Exactly-once vs at-least-once chosen on purpose, not by default. Exactly-once commits state, output, and offsets atomically on a barrier; at-least-once trades possible duplicates for a lower commit-cadence floor on latency. → Exactly-once
  • Downstream consumers match the mode. Under exactly-once, downstream reads with read_committed isolation see no duplicates; under at-least-once, downstream must be idempotent or duplicate-tolerant. → Exactly-once

License

A production instance needs a valid runtime license, injected as a secret — never baked into an image or committed.

  • License key injected as an environment variable / secret, not hardcoded. → License configuration
  • License health is wired into readiness. An expired, revoked, or missing license flips /health/ready to not-ready; the renewal window surfaces a warning before it bites. Note the timing: a missing key fails at boot, but invalid/expired keys surface at the deferred validation ~5 minutes after start (the pod runs PENDING-and-ready until then). → License configuration, Health checks

Probes

Readiness is the lever that keeps traffic off a process that hasn't caught up. Wire both probes.

  • /health/ready wired as the readiness probe. It returns 503 throughout state restoration, so nothing routes to a process that isn't caught up. → Probes, Health checks
  • /health/live wired as the liveness probe. Lets the orchestrator restart a genuinely stuck process. → Probes
  • Probe timing tuned so a long but legitimate restoration isn't killed by an aggressive liveness deadline. → Probes

Observability

You operate one process, so its metrics and introspection endpoints are your whole picture.

  • /metrics scraped into your monitoring stack — JVM, Kafka-client, and StoatFlow internal counters in Prometheus format. → Metrics, Observability
  • Alerts set for the signals that matter on a single-instance app — consumer lag, commit stalls, error rates, restoration progress. → Observability
  • Logs collected — plain text by default; add a JSON encoder to your Logback config for structured ingestion, and enable MDC to correlate by lane and barrier. → Observability
  • Introspection endpoints reachable for diagnosis — /topology, /state, /watermarks, and the /debug/* views. → REST API, Observability

Error handling

Decide what happens to a bad record before one arrives — silent skipping should be a choice, not a default.

  • Processing-exception handler chosen — log-and-continue, log-and-fail, or route to a dead-letter queue. → Error handling (DLQ), Error-handling model
  • Deserialization-error handler chosen for malformed source records, with its own policy. → Error handling (DLQ)
  • Output topics provisioned before the start — every sink topic and every dead-letter topic you route to, sized for what they receive. A missing one refuses the start, naming it (MissingOutputTopicException), once a few seconds of re-reads have not found it (a topic created just before the start may take a moment to show); StoatFlow never creates them. Topics a TopicNameExtractor picks per record are not checked: create those too. → Writing a sink, Error handling (DLQ)
  • DLQ monitored if you route to one — a filling DLQ is a signal. → Observability

Configuration and tuning

Start from the presets, then tune against your workload rather than guessing.

  • Defaults and presets reviewed — you know which preset you're running and why. → Defaults and presets
  • Resources sized — CPU and memory for the single process, lane count for your core count. → Tuning
  • Commit-cadence bounds set appropriately for your latency-vs-throughput target. The cadence self-tunes within the configured bounds; you set the bounds. → Tuning, Configuration model
  • Timer cache sized, if processors declare event-time timers on a persistent timer backend — timer-backend.max-cached-timers (default 100 000 per time domain) fits the memory budget (about twice that many entries, each a timer key plus up to 1 KiB of its headers) and the backlog you expect after downtime; alert on a stoatflow.watermark.timer.held that stays at 1 with stoatflow.timer.fired.total flat. → Tuning
  • Kafka client config reviewed — bootstrap servers, security, and any client overrides. → Kafka client configuration
  • -XX:+UseG1GC set so GC pauses stay short and predictable (the Gradle plugin applies it to the Docker image; set it explicitly otherwise). → Installation, Docker

Custom processor correctness

If you wrote custom Processor code, make sure it holds under concurrent lane execution.

  • Thread safety understood — key affinity makes per-key updates serial, but custom processors that read-modify-write across multiple keys need the runtime's key-lock utility. → State and thread safety
  • No cross-lane state assumptions in custom code. → State and thread safety, Processor API
  • Topology tested with the in-memory test driver before deploying. → Testing

Where to go next

  • Kubernetes — the manifest that satisfies the deployment and persistence rows above.
  • Observability — what to scrape and what to alert on once you're live.
  • Tuning — turn the sizing and cadence rows into concrete numbers for your workload.
  • High availability — the opt-in hot-standby cluster, if fast restart isn't fast enough.
  • Deploying and operating — the operating section overview, including both HA tiers in full.