Home / Cloud architecture · Technical demonstration

Cloud architecture · Technical demonstration

Two workers finish. Which report should the user see?

A report takes longer to build than a browser request should wait. Checkout of the job by a worker can also fail halfway through. Follow the export from submission to a single published result.

BROWSER SIMULATION

Recover a report export.

Start the job, let its worker stall, then retry. Watch which worker can publish the result. All actions use fictional records in this browser.

Export job
—
Attempt
0
Job status
Ready
Published reports
0

Submit an export to receive a job reference.

Separate the job from its attempts.

The browser keeps one job reference. Each worker claim receives a new attempt number and a time-limited lease. If a worker stops checking in, another worker can claim the same job after the lease expires.

Check ownership when publishing.

In this design, each attempt writes to its own temporary file. To publish that file, the worker must update the job record while its attempt number matches and its lease is valid. The ownership check and update happen atomically. An old worker can finish computing, but it cannot overwrite the result selected by the current attempt.

This rule protects the published file reference. Other effects, such as sending a completion email or deleting temporary files, need their own retry and cleanup rules.

Explore cloud and enterprise architecture →