Production checklist
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: 2or more,ha.mode: active-standby) for near-instant failover on large state / tight RTO. → High availability -
replicas: 1on 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 ofreplicas: 2or 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, orStoreLayoutMismatchExceptionsaying 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 understate.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
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
PersistentVolumeClaimretained 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 —WriteimpliesDescribe, so this matters only whenkafka.adminsets a principal of its own; an authorization error there fails the start at once, an unanswered read is retried for up tostate.restoration-metadata-timeout-ms. It also reads thecleanup.policyof each KTable source topic it may reuse (DescribeConfigs, unlessktable.auto-reuse-source-topicsis off or the table pins its source). When a table restores from its source topic, it also reads the consumer group's committed offsets (Describeon the group), the point that table is restored up to. An unreadable answer — a topic created moments ago included — is retried for up tostate.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 bystate.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 - The RocksDB native library is the one the StoatFlow BOM manages. An application with a RocksDB store logs the library's version at start (
RocksDB native library 11.8.1), and refuses to start on RocksDB older than 11.8.0: older libraries lack native functions StoatFlow uses, and on 11.1.0 to 11.5.x closing a read-only database can delete a live store's newest files, the look StoatFlow's start-up checks take at a state directory another pod may still hold. The error names the version found; nothing is opened. The fix is the dependency: let the BOM manageorg.rocksdb:rocksdbjni. With Maven, a nearerrocksdbjnideclaration — your own, or a library's — wins over the BOM;mvn dependency:tree -Dincludes=org.rocksdbshows which one did. → Installation - A table's restoration source is not flipped in place. Turning
ktable.auto-reuse-source-topicsoff, 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 withDescribeon 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-basedsuppress, stream-stream joins), one-emitfrontier-changelogperonWindowClose()aggregation,-timer-store-changelogwhen a processor declares timer types and the timer backend's changelog is on (every type,MEMORYincluded) — 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_committedisolation see no duplicates; under at-least-once, downstream must be idempotent or duplicate-tolerant. → Exactly-once
Licence
A production instance needs a valid runtime licence, injected as a secret — never baked into an image or committed.
- Licence injected from a Secret —
${secret:licence}from a volume at/run/secrets, orSTOATFLOW_LICENCE_KEY— not hardcoded. → Licence configuration - Licence health is wired into readiness. A missing licence flips
/health/readyto not-ready. An expired licence never stops a running instance, but after the 30-day restart grace no instance starts — thelicenceRenewalWarningliveness detail and thestoatflow_licence_days_remaininggauge warn from 30 days before expiry. → Licence configuration, Health checks - Licence registry ACLs granted. The application's principal has DESCRIBE, READ and WRITE (and CREATE) on
__stoatflow_licenceand__stoatflow_licence_history, or both topics are pre-created. Without them a paid licence runsUNVERIFIEDand a trial does not start. → Licence registry topics -
stoatflow_licence_registry_availableis watched. Alert on== 0, and onstoatflow_licence_services_registered > stoatflow_licence_services_capfor overage. → Observability
Probes
Readiness is the lever that keeps traffic off a process that hasn't caught up. Wire both probes.
-
/health/readywired 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/livewired 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.
-
/metricsscraped 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, and memory: a
stoatflow.memory.verdictat3(starved) outside the block cache, or a risingstoatflow.memory.valve.steps.total. → Observability, Right-sizing memory - 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 aTopicNameExtractorpicks 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 defaults, then tune against your workload rather than guessing.
- Defaults and the memory plan reviewed — you know which memory profile the image runs with (
balancedunlessSTOATFLOW_MEMORY_PROFILEor the build'smemoryProfilesays otherwise:state-heavyfor large state read heavily,heap-heavyfor in-memory stores and large suppress buffers,leanfor a small, low-throughput app in a small pod) and why, and you have read the start-upMemory plan: …line. → Defaults and the memory plan - Resources sized — CPU and a memory limit for the single process (the limit drives the memory plan; requests equal to limits), lane count for your core count. → Tuning, Kubernetes
- Memory verified under load — over the daily peak, a restart and a restore, the container verdict stays
comfortable, no pool isstarved(a starved block cache only as a choice you made), the native residue (stoatflow.memory.native.unaccounted.bytes) is no worse thantightand does not keep growing, and there is nomemory.highoroomevent. The start-up log carries no memory-plan WARN you have not decided to accept. → Right-sizing memory - 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 —
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 astoatflow.watermark.timer.heldthat stays at1withstoatflow.timer.fired.totalflat. → Tuning - Kafka client config reviewed — bootstrap servers, security, and any client overrides. → Kafka client configuration
-
-XX:+UseG1GCset 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.
Tuning under load
Practical tuning for StoatFlow under load — measured goal recipes, lane count, commit-cadence bounds, the memory and uncommitted-state knobs, how to size the container with the memory report, and small pods, each tied to the symptom that tells you to reach for it.
The licence tool
How to run stoatflow-licence-tool — verify a StoatFlow licence offline, apply a renewal to a Kafka cluster's licence registry without a restart, see what the registry counts, and produce the usage and fleet reports.