Skip to main content
José David Baena
Tools and working references

Background jobs / Compatibility lab

Job Payloads & Rolling Deployments

Can every worker that might receive a queued job still understand its shape and preserve its business intent?

Interactive calculations run in your browser; the initial example is pre-rendered. There are no accounts, uploads, or live queue connections. Inputs stay in page memory; the site does not persist them, put them in URLs, or send them to analytics. A worksheet download includes only what you explicitly export.

Choose a rollout and an independent business intent

Choose a rollout and an independent business intent

1: legacy cents; 2: explicit currency; 3: nested amount.

New payloads remain durable even if the deployment rolls back.

Still reachable during a mixed rollout and after rollback.

A strict new shape can strand older queued messages.

V1 cannot encode EUR; a loose reader may silently assume USD.

An integer fixture, not a payment or exchange-rate conversion.

Compatibility across the queue's lifetime

At least one reachable reader/payload pair rejects or changes intent

PHASE 01

Before deployment

0 incompatible / 1 reachable pairs

  • V1 + v2: preserves-intent

PHASE 02

Mixed rolling pool

2 incompatible / 4 reachable pairs

  • V1 + v2: preserves-intent
  • V1 + v3-strict: rejected
  • V3 + v2: rejected
  • V3 + v3-strict: preserves-intent

PHASE 03

New workers, delayed old jobs

1 incompatible / 2 reachable pairs

  • V1 + v3-strict: rejected
  • V3 + v3-strict: preserves-intent

PHASE 04

Rollback with new payloads still queued

1 incompatible / 2 reachable pairs

  • V1 + v2: preserves-intent
  • V3 + v2: rejected

PHASE 05

Replay after rollout

1 incompatible / 2 reachable pairs

  • V1 + v3-strict: rejected
  • V3 + v3-strict: preserves-intent

A successful parse can still change a charge's currency. Check the independent expected intent, not only the JSON shape. The dual-reader example assumes that compatible reader was already deployed to the entire previous pool before emitting V3 payloads; rollback must retain it too.

All twelve fixed producer/reader pairs, including those outside the selected rollout
ProducerReaderContract outcomeInterpretation
V1Legacy reader: cents, assumes USDpreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V1V2 reader: legacy + explicit currencypreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V1V3 reader: nested amount onlyrejectedReader rejects this shape/version; no effect is applied.
V1V3 dual reader: all three profilespreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V2Legacy reader: cents, assumes USDpreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V2V2 reader: legacy + explicit currencypreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V2V3 reader: nested amount onlyrejectedReader rejects this shape/version; no effect is applied.
V2V3 dual reader: all three profilespreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V3Legacy reader: cents, assumes USDrejectedReader rejects this shape/version; no effect is applied.
V3V2 reader: legacy + explicit currencyrejectedReader rejects this shape/version; no effect is applied.
V3V3 reader: nested amount onlypreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
V3V3 dual reader: all three profilespreserves-intentReader interprets 1200 USD minor units; intended 1200 USD.
Versioned JSON fixtures and expected intent

The queue outlives the deployment

A rename can break parsing; an optional currency field can be worse if a loose reader accepts it and silently assumes another currency. Deploy compatible readers before new producers, preserve delayed payload support, and include rollback and replay in the fixture set. Passing these small example profiles is not a certificate for your schema migration or business rules.

Assumptions and limits

  • These fixed charge-job profiles exercise structural and semantic compatibility. They do not inspect your schemas, workers, database migrations, or real customer payloads.
  • V1 has amountCents and no currency; legacy readers assume USD. V2 adds currency. V3 moves the amount and currency into a nested object.
  • The legacy reader ignores unknown fields and version values. It may accept a V2 EUR payload but interpret it as USD. Structural acceptance is not preservation of intent.
  • The V2 reader supports V1 as USD and V2 with explicit currency. The strict V3 reader only accepts V3; the dual reader preserves all three supported profiles.
  • A mixed pool can hand any queued job to either reader. The lab reports reachable incompatibilities, not failure percentages or an assumed routing distribution.
  • Old and new payloads remain queued through deploy, delayed delivery, rollback, and replay. Rolling back code does not rewrite durable payloads.
  • The expected intent is independently supplied by the example. V1 cannot faithfully encode a non-USD intent. Real migrations also need authorization, idempotency, retention, and business-invariant checks.