{
  "id": 3829023,
  "title": "You Can Retry a Write. You Cannot Retry an Email.",
  "url": "https://urgent.news/2026/08/27/you-can-retry-a-write-you-cannot-retry-an-email",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-27T21:47:25.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/nabeelbaghoor/you-can-retry-a-write-you-cannot-retry-an-email-lfo"
  },
  "original_language": "en",
  "account": "The article discusses the difference between retrying a write operation and retrying an email. It uses the example of an SaaS product called Upwork Scout, which sends emails based on matching job offers to users.\n\nThe core difficulty lies in making the scanning process safe to run multiple times, as the email sending is a side effect that leaves the system and lands in a human's inbox. Unlike database writes, which can be easily overwritten, email delivery is irreversible and can cause users to unsubscribe.\n\nThe author implements an idempotency system using deterministic ids derived from user and job data. This allows the system to track whether a delivery has already been made, preventing duplicate emails. However, this approach does not protect against multiple full scans occurring simultaneously, which could double the scraping bill.\n\nTo address this, the author introduces a lock mechanism that expires after 10 minutes. If a scan is in progress when a new request arrives, it returns a response indicating a previous run is in flight. This lock is a trade-off between correctness and cost optimization, ensuring users see the intended email content while being mindful of resource usage.",
  "summary": "I run Upwork Scout , a small SaaS that watches Upwork and emails you only the jobs that fit you. The whole product is one cron endpoint. It wakes up every fifteen minutes, fetches new jobs, matches them against every active user, and sends mail. The interesting engineering in that sentence is not the matching. It is the sending. A scheduled job that only writes to a database is easy to get right,…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}