Technology

Data Backend Reliability

A data pipeline can retry every message, retain every event, and report successful worker executions—yet still fail to deliver complete, correct data to its consumers.

By Codality Admin•11/3/2026•9 min read

At-Least-Once Delivery Is Not an End-to-End Reliability Guarantee

A data pipeline can retry every message, retain every event, and report successful worker executions—yet still fail to deliver complete, correct data to its consumers.

That is because transport guarantees and business guarantees describe different things.

“At-least-once delivery” describes how a message moves between two components. It does not prove that the corresponding business record was successfully validated, normalized, published, cataloged, and made available for query.

If the actual requirement is that every accepted record reaches publication, then the architecture must protect that invariant across the entire workflow—not merely inside its queue.

Start with the promise, not the mechanism

Architecture discussions frequently begin with technology:

  • Which queue should we use?
  • How many retries should we configure?
  • Do we need a dead-letter queue?
  • Does the framework support exactly-once processing?
  • Should the pipeline be streaming or batch-oriented?

These questions matter, but they come after the system’s promise has been defined.

A stronger starting point is:

Every record accepted by the platform must reach a terminal, auditable outcome. If acceptance promises publication, every accepted record must eventually become part of the published dataset exactly once logically.

This statement is an invariant: a condition the system must preserve despite retries, crashes, duplicate delivery, partial writes, deployment failures, and downstream outages.

Once that invariant is explicit, the architecture becomes easier to evaluate. Every component must either help preserve the invariant or provide evidence that it remains intact.

At-least-once delivery solves only one part of the problem

At-least-once delivery generally means that a transport will redeliver a message when it cannot confirm successful processing. Duplicate delivery is therefore expected behavior.

Amazon SQS, for example, documents that a message copy can occasionally be delivered again and advises consumers to be idempotent. Apache Kafka similarly distinguishes among at-most-once, at-least-once, and exactly-once semantics, while emphasizing that the guarantees for publishing and consuming are separate concerns.

This protects against one failure mode: a message silently disappearing because a consumer failed before completing its work.

It does not automatically protect against:

  • A consumer acknowledging the message before its output is durable.
  • A transformation succeeding while publication fails.
  • A file being written while its catalog update fails.
  • A retry creating duplicate logical records.
  • A malformed record exhausting its retries and disappearing into a dead-letter queue.
  • A batch being published partially while the workflow reports success.
  • An orchestration database reporting completion when the queryable dataset is incomplete.
  • A repair operation overwriting or omitting previously published data.

A queue can truthfully say, “I delivered the message,” while the platform has still failed its customer.

That is not a defect in the queue. It is a mismatch between a component-level guarantee and an end-to-end requirement.

Define the acceptance boundary precisely

The word accepted carries substantial architectural weight.

Before acceptance, the platform may be allowed to reject a record because its format, identity, schema, or required fields are invalid. After acceptance, ownership transfers to the platform.

That boundary must be observable and durable.

For example, a provider submission might pass through these states:

  1. Received: Bytes arrived, but the platform has made no durability promise.
  2. Persisted: The original submission is durably stored.
  3. Validated: The record satisfies the contract required for processing.
  4. Accepted: The platform now guarantees eventual publication.
  5. Normalized: The record has been converted into the canonical representation.
  6. Published: The canonical record is durably present in the authoritative output.
  7. Available: Required metadata or catalog state makes the record accessible to consumers.
  8. Reconciled: The platform has verified that the accepted input corresponds to the published result.

This state model prevents a dangerous ambiguity: accepting data before determining whether the platform can honor its publication promise.

There are two defensible designs:

  • Validate before acceptance, so invalid records never enter the publication invariant.
  • Accept before full validation, but guarantee that rejected or quarantined records receive an explicit terminal disposition and, where required, a remediation path.

What is not defensible is allowing records to disappear between “received” and “published” without an auditable explanation.

Idempotency converts duplicate execution into one logical result

Retries are necessary in distributed systems because an operation can succeed even when its acknowledgement is lost.

A worker may write its output and then crash before recording completion. The orchestrator sees incomplete state and retries the operation. Without protection, the retry creates a duplicate.

The correct goal is not necessarily to execute the code only once. That is often impractical across multiple systems. The goal is to ensure that repeated execution produces one logical outcome.

That is idempotency.

An idempotent publication process usually requires a stable identity derived from the business record or ingestion context, such as:

provider_id + source_object_id + source_version

or:

submission_id + record_ordinal + transformation_version

The key must remain stable across retries. A new random identifier generated during each attempt cannot support reliable deduplication because every retry appears to be new work.

Depending on the destination, idempotency can be implemented through:

  • Unique database constraints.
  • Conditional writes.
  • Deterministic object keys.
  • Merge or upsert semantics.
  • Transactional manifests.
  • Versioned snapshots with atomic pointer changes.
  • A durable record of completed operations.

The important property is that processing the same accepted record twice cannot produce two logical publications.

“Exactly once” always has a boundary

Exactly-once terminology is useful only when its scope is explicit.

Kafka can coordinate consumed offsets with records produced to Kafka topics through transactions. However, its own design documentation notes that writing to an external destination requires cooperation from that destination or another strategy for coordinating input position with output state.

This distinction matters for pipelines that cross several technologies:

provider
  → object storage
  → event transport
  → transformation
  → published Parquet
  → metadata catalog
  → query engine

A transactional guarantee within the event transport cannot atomically cover every external side effect in this chain.

The architecture must therefore compose weaker local guarantees into a stronger end-to-end outcome. Common techniques include:

  • Durable source retention for replay.
  • Idempotent transformations and writes.
  • Transactional or versioned publication.
  • Explicit workflow state.
  • Output manifests.
  • Compensating repair operations.
  • End-to-end reconciliation.

This is a practical application of the end-to-end argument in system design: certain guarantees can only be completely established at the layer that understands the application’s real requirement. Lower-level mechanisms remain valuable, but they cannot independently prove application-level correctness.

Publication should be a deliberate commit point

Writing an output file is not necessarily the same as publishing data.

Suppose a transformation produces ten Parquet files. Seven become visible before the eighth write fails. If downstream consumers discover files by listing a directory, they may query an incomplete dataset.

A more reliable design separates staging from publication:

  1. Write all output into an isolated staging location.
  2. Validate file integrity, schema, partition structure, and expected record identity.
  3. Produce a manifest describing the completed output.
  4. Commit the dataset by atomically exposing the manifest, version, or snapshot pointer.
  5. Update the catalog or consumer-facing metadata.
  6. Verify that the committed version is queryable.
  7. Mark the accepted input as published.

The externally visible commit should occur only after the dataset satisfies the publication contract.

Where a truly atomic update across storage and catalog services is unavailable, workflow state must represent the intermediate condition honestly. The system should know the difference between “files written,” “catalog updated,” and “publication verified.”

Collapsing those states into a generic SUCCESS flag makes failures harder to detect and repair.

Dead-letter queues are evidence of unfinished work

Dead-letter queues are operationally useful. They prevent repeatedly failing messages from consuming unlimited processing capacity.

But moving a record into a dead-letter queue does not satisfy an eventual-publication guarantee.

It means the automated path has stopped making progress.

For every dead-lettered or quarantined record, the platform needs:

  • The original durable payload or a reference to it.
  • The reason processing failed.
  • The processing and schema versions involved.
  • The number and timing of attempts.
  • A documented remediation procedure.
  • A safe replay path.
  • An owner or escalation policy.
  • A service-level objective for resolution.

If the platform has accepted the record, the dead-letter queue is not its terminal destination. It is a visible exception state requiring resolution.

A useful operational metric is therefore not merely dead-letter queue depth. It is the age of the oldest accepted record that has not reached a valid terminal state.

Reconciliation provides proof

Logs show what individual components attempted. Metrics show aggregate behavior. Neither necessarily proves that every accepted record was published.

That proof requires reconciliation.

The simplest model compares counts:

accepted records = published records + unresolved records

Count reconciliation is helpful but insufficient on its own. One missing record and one duplicate can cancel each other numerically.

Stronger reconciliation uses record identities, manifests, sequence ranges, or cryptographic checksums to establish correspondence between input and output.

A reconciliation process should be able to answer:

  • Which accepted records have been published?
  • Which records remain in progress?
  • Which records are blocked, quarantined, or awaiting remediation?
  • Which published records lack a valid accepted source?
  • Were any logical records published more than once?
  • Is every published partition cataloged and queryable?
  • Can the platform replay a specific missing record without duplicating existing output?

This turns reliability from an assumption into something the platform can demonstrate.

Observability should follow the business invariant

Infrastructure telemetry remains essential: queue depth, error rate, Lambda duration, consumer lag, object-write failures, and catalog API latency all help operators diagnose the system.

But the highest-value measures should describe the business workflow:

  • Number of records received.
  • Number durably persisted.
  • Number accepted.
  • Number published.
  • Number available for query.
  • Number reconciled.
  • Number unresolved.
  • Age of the oldest unresolved accepted record.
  • Duplicate attempts suppressed.
  • Records recovered through replay.
  • End-to-end time from acceptance to availability.

A pipeline can have healthy CPU, low queue depth, and successful task executions while still violating its core data guarantee.

Operational health and business correctness overlap, but they are not interchangeable.

The architectural test

When evaluating a supposedly reliable pipeline, ask:

  1. At what exact point does the platform accept responsibility for a record?
  2. What durable evidence records that acceptance?
  3. Can any component acknowledge work before its output is durable?
  4. What identity remains stable across retries?
  5. Can repeated execution create duplicate logical output?
  6. What happens when publication succeeds but cataloging fails?
  7. Are dead-lettered records still considered unresolved obligations?
  8. Can the system identify every accepted record that has not been published?
  9. Can it prove that published output corresponds to accepted input?
  10. Can one record be replayed safely without rebuilding or duplicating the dataset?

If these questions do not have precise answers, the platform does not yet have an end-to-end guarantee. It has a collection of component behaviors from which reliability is being inferred.

Reliability is the Preservation of Business Truth

Queues, retries, transactions, durable storage, and orchestration engines are necessary tools. None of them independently establishes that a business record survived an entire distributed workflow.

The central architectural lesson is simple:

Delivery guarantees describe movement between components. Reliability guarantees describe preservation of business truth across the complete system.

A trustworthy data platform defines acceptance explicitly, assigns stable identities, makes operations idempotent, separates staging from publication, preserves failed work, and reconciles input against queryable output.

The system is not reliable because every component reported success.

It is reliable when it can prove that every promise made at the acceptance boundary was fulfilled.

Likes: 1


Comments (0)