Checks service

Checks service: issues

Findings from running the daily checks job on the sample data, each with the standard ways teams solve it. Sources are graded A (official docs), B (engineering blogs and benchmarks) or C (community posts).

107alerts in one run
82of those were false
3real problems missed
570database commits to save 568 results
2xdata written if the job runs twice

Where each issue sits

Click a number to jump to that issue.

Datasets11 datasets, 599 record-and-check pairs a day, 4 owners.
→
12RulesCompleteness, accuracy, timeliness. Two do not follow their documented rules.
→
46Daily jobCommits per row. Keeps no record of earlier runs.
→
ResultsOne row per record and check, for that day's run.
→
3OwnersNotified per failure. Not told about affected downstream datasets.
57LineageWhich dataset is built from which. The job does not use it. New check kinds are added by hand in five places.
1
Correctness

Whitespace-only values pass the completeness check

The check only compares against an empty string, so spaces or a tab pass.

Found
Three blank values passed: two emails in raw_customers and one customer id in raw_orders. No alert was sent.
What the job says
What is true

How teams solve this

Make the written rule executable

Turn each sentence of the rule into table-driven tests, including the awkward values: empty string, spaces, a tab, null, field missing. Here the written rule and the code disagreed, and nothing compared them.

Breaks when: the tests are written from the code instead of from the rule text.

general practice

Normalise in one place

Decide once what counts as blank (trim whitespace, and say what happens to non-string values) and use that one definition everywhere the check reads a value.

Breaks when: each check re-implements its own idea of blank.

general practice

Shadow mode before enforcing a changed rule

Run the corrected rule next to the old one without alerting. Compare how often each fires. Turn it on only when the difference is understood. Compliance and fraud-rule tools build this in: a shadow rule shows up in reports but does not affect decisions.

Breaks when: the switch from shadow to live is hidden in code, or the baseline is a single quiet hour.

AModern Treasury docsALithic docsCshadow-mode runbook

Why it matters: A silent false pass is worse than a false alarm. Nobody investigates a check that reports green, so the bad data keeps flowing.

What I chose, and why

Built in the repo

Choice. A value is blank when it is null, or a string that is empty once trimmed. Other types (0, False, a list) count as present. The tests come from the written rule, with one case for each awkward value. To check the change I compared the job's output on the sample data before and after, instead of building shadow-mode tooling.

Why this one

  • The rule text already said "neither null nor blank". The code only had to match it, so this is the smallest change that makes the code equal the spec.
  • Trimming a string is one line, easy to read, and adds nothing to run or maintain.
  • Non-strings stay present because a zero or False is real data. Flagging them would create new false alarms, which is issue 2 again.

Why not the others

  • Shadow mode. It earns its cost when there are many rules and live consequences. One rule changed once. The before-and-after diff showed exactly 3 records flipping, all expected, which gave the same assurance.
  • A shared normalise helper. No other check needs one yet. I would add it when a fifth check wants the same definition.

What I accept

  • A field where spaces are legitimate (a padding column) would be flagged as blank. A per-check option can be added if that case appears.
2
Correctness

Timeliness measures age from the wrong time

Age should be counted from 00:00 UTC on the run date. The job counts from the end of that day, so records look almost 24 hours older.

Found
One run raised 107 failures. 25 were real. The other 82 were timeliness failures on data that was fine. The 3 blank values from issue 1 were missed.

Record age

How teams solve this

Half-open windows, UTC-anchored

Use [start, end) ranges and anchor the boundary explicitly in UTC with typed timestamps. SQL BETWEEN is closed on both ends. Mixing a date with a datetime gives windows of 23 or 25 hours. Adding a fixed 24 hours also breaks across daylight-saving changes.

Breaks when: the rule says "no more than" and the code says "less than" at the exact limit. Pick one and test the exact boundary.

ADuckDB docsCtime-window guide

Fixed windows tied to the run date, not "now"

A window anchored to the run date gives the same answer when you rerun the job. A rolling "last 24 hours from now" gives a different answer every run. Airflow's guidance is the same: read and write a specific partition and never read the latest data.

Breaks when: someone passes the wall-clock time into the check instead of the run date.

AAirflow best practices

Judge by the record's own time, allow some lag

Freshness should use the timestamp inside the record, not the time it arrived. Some ingest tools also lag the "now" edge by a few minutes so they do not read a window the source is still writing.

Breaks when: event time and arrival time differ a lot (late data).

Cquelch window.rs

Why it matters: In this data 82 of 107 alerts were false. Once owners learn that, they stop reading the real ones.

What I chose, and why

Built in the repo

Choice. Age is counted back from 00:00 UTC on the run date. Exactly at the limit passes. A timestamp with no timezone is read as UTC. A value that is not a valid timestamp fails that one record with a reason, instead of stopping the run.

Why this one

  • This is what the written rule says, so the code and the docs agree again.
  • The answer depends only on the record and the run date, so a rerun gives the same result. That matters for issue 6.
  • Failing one record rather than the run means one odd cell cannot stop the whole morning.

Why not the others

  • Rolling "last 24 hours from now". It gives a different answer on every run and breaks reruns and backfills.
  • Counting from the end of the day. That was the bug: it takes almost 24 hours off every record's allowance.
  • Lagging the "now" edge. It helps streaming sources that are still being written. This job reads stored data for a day that has already ended.

What I accept

  • Reading a timezone-less timestamp as UTC is wrong for a source that writes local time. I would note the timezone per source and revisit.
3
Notifications

One notification per failing record

Each failure is sent to the owner separately, so a bad batch produces hundreds of messages.

Found
One run, four owners: 107 messages. With correct rules it would still be 28. Each square is one message.

How teams solve this

Group and batch per recipient

This is the digest. Alertmanager's three timers are the usual model: group_wait buffers before the first message so related alerts join it, group_interval spaces follow-ups, repeat_interval limits re-sending unchanged alerts. Pick the wait from how far apart related alerts really arrive.

Breaks when: urgent alerts sit behind a digest. Critical routes usually get a much shorter wait (10 to 15 seconds in common examples).

BBetter StackBSysdig

Severity tiers and count thresholds

dbt tests are error by default, can be warn, and take warn_if and error_if thresholds such as more than 10 or more than 1000 failures. Datadog's guidance separates checks that block a pipeline from checks that only notify. dbt Labs says over-testing is a common cause of alert fatigue.

Breaks when: a fixed threshold misfires on normal variation (a weekend dip) or hides a real rise under the threshold. Atlan suggests baselines that follow seasonality.

Adbt severity docsAdbt: test smarterBDatadogBAtlan

De-duplicate and inhibit

Do not resend an alert that has not changed. Suppress alerts that are only a consequence of another one already firing. That maps straight onto lineage: if a source dataset fails, its children should not each raise their own alert.

Breaks when: the suppression rule is wrong and hides an independent failure. Keep the suppressed alerts visible somewhere.

BBetter Stack: alert fatigue

Why it matters: Alert fatigue is a trust problem. The first ignored alert costs nothing. The ignored real one costs a bad dashboard.

What I chose, and why

Built (digest). Severity tiers and suppression not built

Choice. One digest per owner per run, sent after every dataset has been evaluated, listing every failure in the datasets that owner owns. Owners with no failures get nothing.

Why this one

  • A batch job has a natural end. The end of the run is the right place to group, so no timers are needed.
  • One message per owner per day is predictable. Sending after evaluation means the digest is complete.
  • It was the smallest change: collect failures per owner in the loop, send once at the end.

Why not the others

  • Alertmanager-style timers (group_wait and friends). They solve a problem where alerts arrive continuously. Here the arrival ends when the run ends.
  • Severity tiers and thresholds. Checks have no criticality field yet. Adding tiers now would be guessing. I would add them once owners say which checks matter.
  • Suppressing child alerts. It needs the impact lookup from issue 5. Rather than build suppression, the digest would carry an "affected downstream" line.

What I accept

  • Owners wait until the run finishes, so an urgent failure is not faster than a minor one.
  • If a digest is lost after a crash, nothing resends it. The outbox in issue 6 closes that.
4
Performance

One database commit per result

Each result is saved in its own transaction, the owner is looked up again for every failure, and a dataset's records are re-read for every check.

Measured
One run on the sample data: 714 queries and 570 commits to store 568 results. After the rule fixes and a cleanup of the loop, the same run took 28 queries and 13 commits.
570 commits

■ one commit per result today   ■ one commit per dataset (13 in this run)

If it checks this many records a day

The time uses an assumed 2 ms for each round trip to the database. It is an assumption, not a measurement. Change the number to fit your setup: ms

How teams solve this

One transaction per batch

Commit per chunk (here, per dataset), not per row. Network round trips and per-transaction overhead dominate. In one benchmark, single inserts each in their own transaction took 8,954 s against 52 s for bulk insert and 14 s for COPY. In an EnterpriseDB test at about 320 ms latency, 500 inserts took 167 s unbatched and 1.2 s batched. These come from single vendor tests, so read the ordering, not the numbers.

Breaks when: the batch is so large that a failure loses a lot of work or holds locks for long. Size it to your checkpoint (see issue 6).

BCybertec benchmarkBEnterpriseDBBTiger Data

Multi-row insert or COPY, not a loop of single inserts

A driver's executemany often still sends one execute per row and came out slowest in one benchmark. COPY is fastest but does not do upserts directly. When reruns must be safe, use batched INSERT ... ON CONFLICT.

Breaks when: you need conflict handling and reach for COPY anyway.

BTowards Data ScienceBCybertec

Read once, look up once

Load a dataset's records once, not once per check. Take the owner from the dataset row already in memory, not one query per failure. This is the classic N+1 pattern. In this job: 714 queries before, 28 after.

Breaks when: a cache hides a change that happened mid-run. Fine for a daily batch, not for live data.

general practice

Why it matters: Cost grows with data, not with value. The job that takes seconds today takes hours at a million results, and that is when it starts failing partway.

What I chose, and why

Built in the repo

Choice. Load all checks once and each dataset's records once. Add a dataset's results in one bulk operation and commit once per dataset. Take the owner from the dataset row already loaded.

Why this one

  • Measured on the sample data: 714 queries became 28 and 570 commits became 13.
  • A commit per dataset is the same size as the checkpoint issue 6 needs, so a crash loses at most one dataset's work.
  • It stays in the ORM and left the existing tests alone.

Why not the others

  • COPY. Fastest, but it cannot do the ON CONFLICT DO NOTHING that rerun safety needs.
  • One commit per run. Fewer commits, but a crash loses everything and there is nothing to resume from.
  • One commit per row. That was the old behaviour.
  • Raw multi-row SQL. Worth it only if profiling shows ORM overhead. At this size the round trips were the cost.

What I accept

  • A dataset with millions of records would be one large transaction. At that size the unit becomes a chunk of records, and the checkpoint moves to the chunk.
5
Impact

Downstream owners are not notified

The lineage is stored but not used. Only the owner of the failing dataset is told.

Found
raw_customers had 10 failures in one run. Six datasets are built from it, directly or indirectly. Two of those owners were never told.

Click a dataset to see what depends on it. Drag a card to move it, drag the background to pan, and use the buttons to zoom. The number on each card is its failure count in the sample run. churn_scores and customer_segments feed each other, so a walk of the graph must handle loops. At millions of datasets, walking the graph on every request would not scale.

How teams solve this

Impact analysis from lineage

List everything downstream of the failing asset before anyone consumes it. Data catalogues and lineage tools ship this as a feature: downstream consumers of an asset, with multi-hop traversal and cycle detection.

Breaks when: the lineage itself is incomplete or stale. Show when it was last updated.

AAtlan lineage impact docsAAtlan lineage docsBDataHub

Walk at read time, or store the closure

Walking at request time (a recursive query, or a breadth-first walk) is always fresh and stores nothing, but its cost grows with depth and breadth. A stored transitive closure gives fast lookups regardless of depth, but costs storage and write-time maintenance, can go stale, and is much harder to maintain for graphs with cycles.

Breaks when: the graph has cycles. You need a visited set or a depth guard either way.

BAiiDA paper (arXiv)ALibkin, closure in SQLCpg_trickle notes

Do the walk once per run

Lineage changes rarely and few datasets fail on a given day. When the run finishes, work out the downstream set for each failed dataset and store it with the run. The endpoint then becomes a lookup.

Breaks when: you also need answers outside a run. Then you need the closure or a cache keyed on a lineage version.

design suggestion

A graph database is not a free fix

The one paper in the results says few incremental property-graph engines exist, and the one it names lacks transitive closure. Check that a graph store really maintains the query you need before moving to one.

Breaks when: you assume native traversal means cheap incremental closure.

BarXiv 1806.07344

Why it matters: Bad data keeps flowing into dashboards and models while their owners have no idea. The cost shows up later as a wrong decision.

What I chose, and why

Walk on request: built. Per-run store and digest line: designed

Choice. A breadth-first walk in Python, one query per level, with a visited set. At run end, store each failed dataset's downstream set with the run, so the endpoint becomes a lookup. Put the affected downstream datasets in the owner's digest.

Why this one

  • The lineage is small today (11 datasets, depth 4), so a lookup costs 4 queries. It is always fresh and easy to test, including a diamond and the loop in the sample data.
  • Few datasets fail on any one day, so computing downstream for only those is cheap.
  • Storing it with the run freezes the answer as of that run. A later lineage change does not rewrite history.

Why not the others

  • Recursive SQL query. With UNION a loop keeps producing new rows because the depth changes, so it needs a path or depth guard. Harder to read and test.
  • Stored transitive closure. Needs maintenance on every edge change and is hardest on graphs with cycles, which the sample data has.
  • A graph database. A new system to run, and the one paper I found says incremental closure is not something you can assume there.
  • Precompute for every dataset. Worst case grows with the square of the dataset count.

What I accept

  • Latency grows with the depth of the lineage, one query per level. Fine now. When the graph gets deep or wide, move to the per-run store.
6
Reliability

Reruns duplicate data; a crash leaves partial data

Each run starts from scratch. A crash leaves partial results and a run stuck as running. A rerun writes everything again and notifies owners again.

Measured
I ran the job twice for the same date: 1,198 results where there should be 599, and every owner got two digests.

How teams solve this

Idempotent writes

A rerun must have the same effect as one run. Rebuild a date partition by replacing it, or upsert on a stable business key, or put a unique constraint on the operation id. Prefer writes that set absolute values over increments or appends. A plain "check, then insert" is not enough because two workers can both pass the check; the constraint is what blocks the second insert.

Breaks when: the write is an append, or the check and the insert are separate steps.

ADatabricks docsBAWS Builder CenterCdev.to: batch jobsCdev.to: check vs guarantee

One run per logical date

Scope every read and write to the run's date, and make each run independent of the others. Astronomer's Airflow guide says any run can be rerun by hand or backfilled, so tasks must be idempotent. Here that means a unique key on the run date, so a rerun reuses the run instead of creating another.

Breaks when: a task reads "the latest" data, which can change between reruns.

AAirflow best practicesBAstronomer

Checkpoint and restart

Commit in chunks and record progress, so a restart resumes at the failure point. Spring Batch restarts as a new execution of the same job instance and skips completed work. Retry and restart are different tools: retry handles transient errors inside a step, restart handles an execution that already failed. Retrying a permanent error only repeats it.

Breaks when: the unit of work is too big to checkpoint, or a restart would reprocess data it should not.

ASpring Batch referenceBBaeldung

One runner at a time

A Postgres advisory lock keyed by job and date stops two instances running the same day. Use a session-level lock for a job made of several transactions, and keep using that one connection. Behind a connection pooler you can end up with duplicate runs or locks that never release.

Breaks when: you treat the lock as exactly-once. It coordinates workers; it does not make outside actions atomic. A timeout that is too short double-runs, too long leaves a stuck lock. Leases with heartbeats are the usual answer (not in the sources I found).

Cdev.to: advisory locksCAppMasterBNetguru

Outbox for digests

Write the digest as a row in the same transaction as the results. A separate relay sends committed rows afterwards. Delivery is at-least-once, never zero, so the receiver dedupes on a stable id, for example a processed-messages table with the id as primary key. SQS FIFO only remembers a dedup id for five minutes, so treat it as extra protection, not the guarantee.

Breaks when: the send happens inside the transaction, or the id changes on retry.

AAWS Prescriptive GuidanceBEncoreCOneUptime

Make "stuck" visible

Run state is a small state machine: running, then succeeded or failed. A run that has been "running" for too long without progress is itself an alert. A separate heartbeat (a ping on success, an alert on silence) also catches a job that never started.

Breaks when: the only signal is an error message, and a hung or missing job sends none.

BHealthchecks docs

Why it matters: This is the one that corrupts data. Duplicate results make counts wrong, and the half-finished run is invisible until someone asks why numbers differ.

What I chose, and why

Designed, not built

Choice. Six small pieces, each covering a failure the others miss. Together they make the job safe to rerun and able to resume:

  1. A unique constraint on results (run_id, check_id, record_id), written with ON CONFLICT DO NOTHING. Duplicates become impossible, not just unlikely.
  2. One run per date. A unique run_date with get-or-create, so a rerun reuses the run. Status moves from running to succeeded or failed.
  3. A run_datasets table (run, dataset, status, finished time). A rerun skips datasets already done.
  4. A Postgres advisory lock keyed on the run date, at session level, so only one runner works on a date.
  5. Digests through an outbox. A row per run and owner with a sent time, built from the stored results after the last dataset, with run and owner as the dedup key.
  6. A heartbeat ping on success, an alert on silence, and a check for runs stuck in "running".

Why this one

  • Each piece covers something the others cannot. The constraint still stops duplicate rows if the lock fails. The lock stops two runners. The per-dataset status gives resume. The outbox stops duplicate digests. The heartbeat finds what none of them can see.
  • It needs nothing new to run. Postgres, Celery and Redis are already there.
  • Resume works at the same grain as the commits in issue 4, one dataset.

Why not the others

  • Delete and rewrite the day's results. The simplest idempotent approach. But it throws away datasets that already finished, so it cannot resume, and it leaves a window where results are missing.
  • A workflow engine (Airflow, Dagster, Temporal). Gives retries, resume and backfill, but it is a new system to run for one job. Worth revisiting if there are several jobs.
  • A Redis lock. A second system to do what Postgres already does.
  • Exactly-once messaging. Heavy. The receiver can dedupe on a key, which is enough here.
  • Retrying the whole job. That is how the duplicates and the wasted hours happen.

What I accept

  • An advisory lock belongs to a connection, so the job needs a direct connection, not a transaction-pooling pooler.
  • Two more tables to maintain.
  • A deploy in the middle of a run means one run can mix two versions of the code. I would record the code version on the run.
7
Maintainability

Adding a check kind means editing five places

Each new kind must be declared, evaluated, added to the sample data, tested and documented. Missing one does not stop the service from starting.

1 Declarationapp/declarations.py the parameters, and the list of kinds.
2 Evaluationjobs/run_checks.py how a record passes or fails.
3 Sample datafixtures/datasets.json a check with passes and failures.
4 Teststests/ a pass, a fail and each edge case.
5 Docsdocs/checks.md the rule in one sentence.

Some rules judge one record at a time. Others, such as no duplicates in a dataset, need the whole dataset, which the job's check interface could not express.

How teams solve this

A registry, not branching

Each kind is one entry in one table. Adding a kind adds a function and an entry, and nothing else in the loop changes. This is how the job's evaluators are registered now.

Breaks when: the interface cannot express the new rule. Uniqueness needed the whole dataset, so evaluators now receive all records.

general practice

Guard tests, also called fitness functions

An architecture fitness function is an automated check of a structural property, run in CI like a unit test. Here: every declared kind must have an evaluator, a fixture check and a docs section, or the build fails.

Breaks when: the guard checks that something exists but not that it works. Pair it with real tests per kind.

BO'Reilly, Building Evolutionary ArchitecturesBThoughtworksBInfoQ

One checklist, followed by a skill

The checklist lives in CONTRIBUTING.md. A skill walks an AI assistant through it and ends by running the tests. Two other agents ran it in clean clones of the repo: a Sonnet agent added pattern (47 to 62 tests) and a Haiku agent added length (47 to 64 tests).

Breaks when: the skill and the code drift apart. The guard test plus an occasional fresh-clone run catch that.

done in this repo

Why it matters: New check kinds are requested often. When each one is a careful six-file edit, they get done wrong or late.

What I chose, and why

Built in the repo

Choice. A table of evaluators, a guard test, one checklist in CONTRIBUTING.md, and a skill that follows the checklist. Evaluators receive a dataset's whole records so a kind can compare records.

Why this one

  • There are four kinds and a new one comes along now and then. A table entry is the smallest structure that removes the branching.
  • The guard test turns a forgotten place into a failing build instead of a silent gap.
  • The skill removes the repeated work. Two other agents, a Sonnet and the smaller Haiku, each added a new kind in a clean clone with all tests passing.

Why not the others

  • Plugin discovery (entry points). Built for third-party extensions. All kinds live in this repo.
  • A scaffold or code-generation tool. One more thing to maintain. A skill is plain text anyone can read and edit.
  • Documentation alone. The checklist existing was the original situation, and it still relied on someone remembering every place.

What I accept

  • The skill can drift away from the code. The guard test and an occasional fresh-clone run are the defence, not a guarantee.
+
Across all issues

Failure handling: what to do when something goes wrong

The fixes above prevent bad states. These are the strategies for the failures that still happen, and what each one costs.

What failsStrategyWatch for
A short-lived error (a network blip, the notifier times out)Retry with exponential backoff and jitter. Limit the number of retries. Retry only errors a retry can fix. Make sure the operation is safe to repeat first. AAWS Builders' LibraryAAWS Well-ArchitectedRetry storms: many clients retrying at the same moments.
A slow dependencyA timeout based on the dependency's measured latency, then a circuit breaker so you stop calling something that is down. AAWS Builders' LibraryBRed HatTimeouts set too high make the caller as slow as the dependency.
A bad recordDo not retry it. Quarantine it with the reason, keep the rest flowing, alert on the quarantine, fix, then replay. A dead-letter queue is the same idea for messages. AAWS SQS docsBBigeyeBLakehouse PlumberA quarantine that grows unnoticed. Silently dropping rows is worse; the counts stop matching with no clue why.
Too many bad recordsGive the run a failure budget. When quarantined rows pass a set share, fail the run instead of reporting success. Cfaucet-coreA bad source passing quietly as a success.
The process dies midwayCheckpoint per chunk and restart from the last commit. Keep a run state so a hung run is visible. ASpring BatchA run stuck as "running" forever.
The job never startsA dead man's switch: the job pings on success, and silence past the expected time plus a grace period raises the alert. It catches both a crash and a scheduler that stopped. BHealthchecks docsThe alert threshold should come from how stale the data may be, not only from the schedule.
A trigger fires twice, or someone reruns itIdempotent writes, a single-runner lock, an outbox with a dedup id on the receiver. ADatabricksAAWS outboxA lock mistaken for exactly-once.
A dependency is down (the notifier, say)Degrade instead of failing: keep the results, queue the digest, deliver later. AWS calls this turning a hard dependency into a soft one. AAWS Well-ArchitectedDeciding in advance whether the run counts as succeeded.
A rule change breaks alertingShadow mode, a backfill against history, a promotion gate with explicit numbers, then enforce. AModern TreasuryALithicA backfill run long before the cutover goes stale.

The sources did not cover fail-open versus fail-closed. Whether a check that cannot run should pass or fail the dataset is a decision to make per check, not something to copy.

What I chose for failure handling, and why

Mostly designed
FailureChoiceWhy
The notifier call failsRetry a few times with exponential backoff and jitter, through Celery's retry. Do not retry errors that retrying cannot fix.Celery is already here, and a short retry covers a short outage. The digest is idempotent by design (issue 6), so a retry cannot double-send.
A bad recordFail that record with a reason and keep going. This is built.The result table already is the quarantine: every failure is stored with a reason, so there is no queue to drain and no separate dead-letter system.
A check cannot run (unknown kind)Stop the run before any result is written. This is built.A check that cannot run should not quietly pass. Stopping early leaves nothing half-written.
The notifier is downKeep the results, leave the digest rows unsent, and send them on the next pass.Losing results because an email failed would be the wrong trade. The outbox makes this cheap.
The job never starts or hangsA heartbeat on success, an alert on silence, and a check for stale "running" runs.Cheap, and it is the only thing that sees a failure that produces no error.
A rule changeA before-and-after diff on the sample data, run once.Proportionate for a few rules. A real shadow mode comes if rules start changing often.
A circuit breakerNot now.The only outside call is a log-only notifier. There is no slow dependency to protect yet.
A failure budget for bad recordsNot now.Failing records are the product here, not an error. It would matter for a source that sends junk.

Retries: backoff and jitter

Many clients fail at the same moment and retry on the same schedule. Without jitter they all come back together. AWS found that backoff without jitter is the clear loser. Bars show how many retries land in each second.

No jitter
Full jitter

All clients fail at time zero and retry at doubling delays (4, 8, 16, 32 s). Full jitter waits a random time between 0 and the delay. AAWS Architecture Blog

Circuit breaker

Stop calling a dependency that is failing. Closed lets calls through. Open rejects them at once. Half-open lets a few through to test recovery. Try the events.

    Pair it with a timeout, a limit on concurrent calls (a bulkhead) and a fallback for when it is open. BRed HatAAWS Well-Architected

    Delivery guarantees

    At most onceSend, never retry.May lose a message. No duplicates.
    At least onceRetry until acknowledged. The outbox gives this.Never lost. Can arrive twice.
    Effectively onceAt least once, plus a receiver that ignores repeats using a stable id.What the digest needs.

    Even with change-data-capture the rule holds: connectors and consumers can replay, so a stable id and an idempotent receiver are still required. AAWS outboxCOneUptime

    +
    Summary

    Which pattern answers which issue

    A pattern that appears against several issues is worth building first.

    1 Blank2 Stale3 Flood4 Commits5 Downstream6 Reruns7 New kinds
    Executable rule tests●●●
    Shadow mode for rule changes●●●
    Half-open UTC windows, fixed to run date●●
    Grouping, severity, inhibition●●
    Batch per chunk●●
    Lineage walk or stored closure●
    Idempotent writes and one run per date●●
    Checkpoint and restart●●
    Outbox and receiver dedup●●
    Run lock, run state, heartbeat●
    Guard tests and a followed checklist●

    Idempotent writes with one run per date, and batching per chunk, each answer two issues and are prerequisites for checkpointing and the outbox. They are the sensible place to start.

    +
    Sources

    Where this comes from

    Web searches, run on the day this page was made. Each source is graded by how much to trust it.

    AOfficial documentation, or the maker's own docs for their product.BEngineering blogs, vendor guides, benchmarks and papers. Useful, but single tests and opinions.CCommunity posts and small projects. Use for ideas, not as proof.

    What the research did not settle

    • Benchmark numbers (Cybertec, EnterpriseDB) are single vendor tests on their own setups. The ordering is consistent across sources; the absolute figures are not portable.
    • Nothing found on lease and heartbeat design for a job lock, or on how to detect a stuck run by a stale heartbeat. That part is general practice, not sourced.
    • Nothing found comparing a stored closure, a recursive query and a graph database on large lineage graphs. The trade-offs above come from two papers on related graphs.
    • Fail-open versus fail-closed was not covered.
    • The Airflow guidance cited is from the 2.6 docs. I did not check Airflow 3.