Spillway (Experimental Alpha)
Experimental Alpha
Spillway is an experimental alpha. Its configuration, behavior and storage formats may change in future releases.
Spillway (deltafi-spillway) is DeltaFi's egress buffer. It is a Go service between DeltaFi data sinks and the downstream consumers they deliver to, and it absorbs the rate mismatch between them.
A slow, intermittent or dead consumer normally makes DeltaFi egress back up: egress errors, retries, and content held on DeltaFi nodes until disk pressure triggers DeltaFi's disk-space delete and ingress shutoff. With Spillway in front of the consumer, DeltaFi always sends at local-disk speed, each consumer receives at its own capacity, and Spillway holds the difference:
- Pass-through. When the consumer answers within 50 ms, each file streams straight through to it, with no committed disk write and no S3 call on the path. DeltaFi gets the consumer's own answer.
- Spill. When the consumer falls behind, is down or is paused, files are committed to a large local disk, and DeltaFi gets
200 {"status":"buffered","did":"<did>"}as soon as the file is synced. Spillway delivers them later, oldest first. - Demote. When the local disk passes its soft limit, the oldest data moves to S3, and it comes back to local disk ahead of delivery.
Nothing Spillway accepts is dropped without an audit record.
A channel is one path from DeltaFi to one consumer. A DeltaFi data sink sends to a channel by URL path, /c/<channel>, and Spillway delivers that channel's files to the channel's outbound.url.
Assumptions
Spillway rests on these accepted trade-offs. Each has a consequence an operator must plan for.
| # | Assumption | Consequence |
|---|---|---|
| A1 | Pass-through audit is best-effort on host failure. A pass-through file's audit row is appended with a plain write() before the consumer's 2xx is returned to DeltaFi, and is synced by the next group commit without delaying the response. | A process crash cannot lose the row. A kernel panic or host power loss can lose rows from the last few milliseconds. That loses an audit row only, never a transmission: a pass-through success means the consumer already returned 2xx, and DeltaFi's own DeltaFile records the egress completing. |
| A2 | Local-tier files are as durable as the local volume. | Losing an unmirrored volume loses everything held on it: its local backlog (up to the hard limit), its DLQ entries and its unshipped audit journal. Sites that must survive disk or host loss use a mirrored disk or a reattachable network volume (see Durability profiles). |
| A3 | Consumers dedupe on (DID, data sink) for at least retentionHours. DIDs are UUIDs. | Every crash window and budget expiry in Spillway resolves to a duplicate delivery, never a loss. A consumer that cannot dedupe will see duplicates. |
| A4 | DeltaFi's auto-resume is configured with Spillway's resume policies for every Spillway-backed data sink. | A 503 from Spillway, or a Spillway restart, becomes a DeltaFi retry instead of a permanent error. Without the policies those files stay errored in DeltaFi. See Resume Policies. |
| A5 | Hosts run NTP. | Ages and S3 segment keys use wall-clock time. Spillway suspends age-off and the audit sweeper's deletes while its clock is more than 60 s off from the object store's. |
| A6 | The filesystem honors fsync (ext4 or XFS, barriers on) and no write-back cache ignores flushes. | Required for the 200 guarantee on every durability profile. |
Guarantees
| Event | Guarantee |
|---|---|
| DeltaFi receives 2xx from a pass-through | The consumer returned that 2xx. |
DeltaFi receives 200 {"status":"buffered","did":"<did>"} | The file is fdatasynced on Spillway's local volume. |
| Power loss of the Spillway host, process crash | No loss of any 200'd file. |
| Node loss with a reattachable volume | No loss; files are unavailable until the volume reattaches. |
| Local volume loss | Files only on that volume are lost (A2). |
| Spillway cannot persist a file | DeltaFi receives 503 and keeps the file through its error and auto-resume path (A4). |
File undelivered after retentionHours | Aged off with an audit record; never silently dropped. |
Custody. DeltaFi marks a DeltaFile COMPLETE when Spillway returns 2xx. From then on Spillway is the system of record. DeltaFi sends a DeltaFile to each of its data sinks separately, so the same DID can reach Spillway once per sink; each is a file of its own, identified by DID and data sink together (the audit row's data_sink: the sink that sent it, or the channel's dataSink when its metadata names none). Every file Spillway accepts gets at least one terminal audit row (delivered, aged_off, purged, quarantined or lost). Crash windows can produce two terminal rows for one file, so readers of the audit group rows by did and data_sink and take each group's outcome as delivered if the group has any delivered row, else its last terminal row. Grouping by DID alone lets one sink's delivery hide another sink's age-off.
A terminal row with an empty data_sink, such as a lost row for a file Spillway listed from disk rather than committed or promoted since it started, or an aged_off row for an entry whose header could not be read, is the outcome for every file of its DID on its channel, since the row cannot say which data sink the entry was for. A reader that groups by did and data_sink sees it as a group of its own and must apply it to that DID's other groups itself.
To read the outcomes from the shipped audit files, for example with DuckDB, run it where the bucket's a/ prefix is copied locally, or read s3://<bucket>/a/**/*.jsonl.gz in its place with DuckDB's httpfs extension:
SELECT did, data_sink,
CASE WHEN bool_or(event = 'delivered') THEN 'delivered' ELSE arg_max(event, ts) END AS outcome
FROM read_json_auto('a/**/*.jsonl.gz')
WHERE event IN ('delivered', 'aged_off', 'purged', 'quarantined', 'lost')
GROUP BY did, data_sink;Data demoted to S3 is as durable as the object store. Spillway's own s3proxy does not fsync, so see Choosing an object store for what that means on power loss of the s3proxy host.
Supported Egress Formats
Spillway discovers each upload's format from the request itself, so a channel accepts all three DeltaFi egress actions and needs no setting for them. It checks, in order:
| DeltaFi action | Recognized by | DID | Data sink | Size |
|---|---|---|---|---|
| HttpEgress | A JSON metadata header named by the channel's metadataKey, which must match the sink's metadataKey parameter | did in that header | flow in that header | Content-Length |
| DeltaFiEgress | A Metadata header whose JSON holds originalDid | originalDid | The channel's dataSink | Content-Length |
| FlowfileEgress, FlowFile v3 | A body starting NiFiFF3 | The did attribute | The flow attribute | Computed from the package's headers |
| FlowfileEgress, FlowFile v1 | A tar body whose first entry is flowfile.attributes | The did attribute | The flow attribute | Computed from the package's headers |
DeltaFiEgress sends no data sink. Its uploads are recorded at the channel's dataSink, so give each DeltaFiEgress data sink a channel of its own: two sinks sending one DID to one channel would be one custody, and the second would look like a duplicate of the first.
FlowFiles. FlowfileEgress always sends chunked, without a Content-Length; Spillway reads a FlowFile's attributes, at most 64 KiB, and computes its size from them before reserving anything. Each request carries exactly one FlowFile: a body that goes on past it is refused with 400 one FlowFile per request, and nothing of it is stored or delivered. A FlowFile is stored and delivered byte for byte, with a Content-Length of its computed size.
Methods. POST and PUT are supported. HttpEgress also offers PATCH and DELETE; Spillway answers every other method with 405 and Allow: POST, PUT, so PATCH and DELETE are unsupported for Spillway-backed sinks.
Protocol. HTTP/1.1 only, inbound and outbound. Spillway disables HTTP/2 on its listeners and on its outbound transport.
Other inbound answers. Every refusal has a short text body beginning spillway: .
| Status | When |
|---|---|
404 unknown channel | The path is not /c/<channel> for a configured channel |
403 source not allowed | mtls mode: the client certificate names no source the channel allows |
400 missing did | No format above matches, or the upload's DID is absent or not a UUID. A metadataKey that differs between the sink and the channel shows up as this |
400 bad metadata | The metadata header is not a JSON object of the expected fields |
400 malformed FlowFile | The body starts as a FlowFile but its headers are malformed, or its attributes are above 64 KiB |
400 Content-Length does not match the FlowFile | A FlowFile sent with a Content-Length shorter than the FlowFile's computed size |
400 one FlowFile per request | The body goes on past one FlowFile |
411 content length required | A request that is not a FlowFile has no Content-Length (HttpEgress and DeltaFiEgress always send one) |
413 file too large | The file is larger than the channel's maxFileSize |
413 file larger than the volume can hold | The file alone would take the local volume past its hard limit |
| 431 | Request headers above 64 KiB. These are not counted in any metric or audited |
503 spillway: <reason> | Spillway could not take the file now; DeltaFi retries it through its resume policies. The reasons are listed under Monitoring |
Spillway closes each inbound connection after 1,000 requests or 5 minutes, so DeltaFi's pooled connections spread again across instances.
What Is in This Release
This release is an experimental alpha. It runs one Spillway instance, in DeltaFi's Compose stack or in a standalone Compose stack with its own object store, metrics and Grafana. That instance's target is about 965 files/s normal and 4,847 burst on one c8gn.4xlarge, about 16.7 TB/day at a 200 KB mean (see Single-Instance Target). Kubernetes deployment, several instances sharing one bucket, adoption of a lost instance's S3 backlog (instance.adoptAfter, /admin/instances, spillway adopt-local), and duplicate identity detection are planned for V1, as is a standard DID header from DeltaFi's egress actions that Spillway reads before discovering the format.
Spillway Documentation
- Deployment: running Spillway inside DeltaFi or standalone, durability, security and sizing
- Configuration Guide: step-by-step recipes for the common setups and changes
- Configuration: every setting, reloads, and the
spillwaycommand line - Resume Policies: the DeltaFi auto-resume policies each Spillway-backed sink needs
- Monitoring: the dashboard, the alert rules and every metric
- SOPs: what to do for each alert and planned change
- Admin API: channel status, controls and recovery endpoints
- Capabilities and Limitations: what this release does, what is planned, its limits and defaults, and Gate 1 status

