[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trigger-dev-staff-engineering-skills-object-store-as-database":3,"mdc-1fnb0u-key":34,"related-repo-trigger-dev-staff-engineering-skills-object-store-as-database":3412,"related-org-trigger-dev-staff-engineering-skills-object-store-as-database":3497},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"staff-engineering-skills-object-store-as-database","implement object storage as database","Use object storage (S3, GCS, Azure Blob) correctly as a database layer. Use when writing code that stores state in object storage, builds transaction logs on S3, implements coordination primitives on object stores, or designs data systems with S3 as primary storage. Activates on patterns like writing metadata or state to S3, concurrent writers to the same S3 key, append-only logs in object storage, or any system using S3 as more than a simple blob store.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trigger-dev","Trigger.dev","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrigger-dev.jpg","triggerdotdev",[13,17,20],{"name":14,"slug":15,"type":16},"Architecture","architecture","tag",{"name":18,"slug":19,"type":16},"File Storage","file-storage",{"name":21,"slug":22,"type":16},"Database","database",3,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fstaff-engineering-skills","2026-06-17T08:40:56.292489",null,1,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"Skills that give AI   coding agents staff-engineer instincts: recognizing and avoiding production failure modes like cardinality, idempotency, and race conditions.","https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fstaff-engineering-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fstaff-engineering-skills-object-store-as-database","---\nname: staff-engineering-skills-object-store-as-database\ndescription: Use object storage (S3, GCS, Azure Blob) correctly as a database layer. Use when writing code that stores state in object storage, builds transaction logs on S3, implements coordination primitives on object stores, or designs data systems with S3 as primary storage. Activates on patterns like writing metadata or state to S3, concurrent writers to the same S3 key, append-only logs in object storage, or any system using S3 as more than a simple blob store.\n---\n\n# Object Store as Database\n\nS3 is no longer just a blob store. With strong read-after-write consistency (2020) and conditional writes (2024), S3 is a **linearizable key-value store** for single-key operations. The trap is not \"don't use S3 as a database\" -- it's using S3 as a database **without using conditional writes for correctness**.\n\n## What Changed\n\n| Year | Change | Impact |\n|------|--------|--------|\n| 2020 | Strong read-after-write consistency | Read after write returns latest; LIST reflects current state. |\n| Aug 2024 | `If-None-Match: *` (put-if-absent) | Atomic create-if-not-exists. Enables append-only logs, idempotent writes. |\n| Nov 2024 | `If-Match: \u003Cetag>` (compare-and-swap) | True CAS on objects. Enables optimistic concurrency, leader election, metadata catalogs. |\n\nTogether these give **linearizable single-key operations**: read an object (get its ETag), compute a new value, write it back with `If-Match`. This is the building block under Delta Lake, Iceberg, SlateDB, WarpStream, Chroma, and dozens of others.\n\n## The Fundamental Pattern\n\nAlmost every system using S3 as a database follows the same architecture:\n\n1. **Write immutable data files** to S3 (Parquet, JSON, binary blobs).\n2. **Maintain a mutable metadata pointer** using conditional writes for atomic commits.\n3. **Readers follow the pointer** to find the current set of data files.\n\nThis is how Delta Lake's transaction log, Iceberg's catalog, SlateDB's manifest, and Chroma's wal3 all work.\n\n## The Conditional Write Primitives\n\n### Put-If-Absent: `If-None-Match: *`\n\nWrite succeeds only if no object with this key exists; returns `412 Precondition Failed` if it does. Use for: transaction log entries, idempotent event writes, one-time initialization, append-only streams.\n\n```typescript\n\u002F\u002F Claim the next sequence number atomically\ntry {\n  await s3.putObject({\n    Bucket: \"my-log\",\n    Key: `_log\u002F${String(nextSeqNum).padStart(10, \"0\")}.json`,\n    Body: JSON.stringify(commitEntry),\n    IfNoneMatch: \"*\", \u002F\u002F Fails if another writer already claimed this key\n  });\n} catch (err) {\n  if (err.$metadata?.httpStatusCode === 412) {\n    \u002F\u002F Another writer got there first. Re-read state and retry.\n    throw new ConflictError(\"Sequence number already claimed\");\n  }\n  throw err;\n}\n```\n\n### Compare-and-Swap: `If-Match: \u003Cetag>`\n\nWrite succeeds only if the object's current ETag matches; returns `412` if another writer changed it. Use for: metadata pointers, shared configuration, counters, leader election, any mutable state.\n\n```typescript\n\u002F\u002F Read-modify-write with optimistic concurrency\nasync function updateState\u003CT>(\n  bucket: string,\n  key: string,\n  modify: (current: T) => T,\n  maxRetries = 5\n): Promise\u003CT> {\n  for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n    const response = await s3.getObject({ Bucket: bucket, Key: key });\n    const etag = response.ETag;\n    const current = JSON.parse(await response.Body.transformToString()) as T;\n    const next = modify(current);\n    try {\n      await s3.putObject({\n        Bucket: bucket,\n        Key: key,\n        Body: JSON.stringify(next),\n        IfMatch: etag, \u002F\u002F Fails if someone wrote between our read and write\n      });\n      return next;\n    } catch (err) {\n      if (err.$metadata?.httpStatusCode === 412) continue; \u002F\u002F Conflict -- retry with fresh read\n      throw err;\n    }\n  }\n  throw new Error(`CAS failed after ${maxRetries} retries`);\n}\n```\n\n## Detection: When You're Using S3 as a Database\n\n**Stop and assess if you see:**\n\n1. **GET → modify → PUT without `If-Match`** -- a race condition. Two concurrent writers silently clobber each other. Always use conditional writes for mutable state.\n2. **Sequential log entries without `If-None-Match`** -- two writers can claim the same sequence number. Use put-if-absent to atomically claim entries.\n3. **S3 LIST as a query mechanism** -- LIST returns 1,000 objects per page and is not a query. To find objects by field values, store metadata in a database or use a table format (Iceberg, Delta Lake) with a catalog.\n4. **Mutable state without a retry loop** -- conditional writes are optimistic and can fail with `412`. You must read, modify, write, and retry on conflict.\n5. **Missing the 412 handler** -- a PutObject that doesn't handle `412 Precondition Failed` makes the conditional write useless; the whole point is detecting conflicts.\n\n## Patterns in the Wild\n\n### Transaction log (Delta Lake pattern)\n\n```\n_delta_log\u002F0000000001.json   ← each commit claims the next seq number with If-None-Match: *\ndata\u002Fpart-00001.parquet      ← immutable data files referenced by commits\n```\n\nReaders find the latest commit number, read that commit's JSON to learn which data files are current.\n\n### Metadata pointer (Iceberg pattern)\n\n```\nmetadata\u002Fv3-uuid.metadata.json   ← immutable metadata snapshots\nmetadata\u002Fcurrent.json            ← mutable pointer, updated with If-Match\ndata\u002Fdata-00001.parquet          ← immutable data files\n```\n\nWriters create a new immutable metadata file, then CAS `current.json` from the old metadata to the new. On conflict, re-read the pointer, check for data conflicts, and retry.\n\n### Leader election \u002F append-only event store\n\nBoth are put-if-absent: claim an epoch-numbered lock or a version-numbered event key with `If-None-Match: *`; a `412` means someone else claimed it.\n\n```typescript\n\u002F\u002F Append an immutable, version-numbered event; 412 = version already exists\nasync function appendEvent(streamId: string, expectedVersion: number, event: Event) {\n  const key = `streams\u002F${streamId}\u002F${String(expectedVersion + 1).padStart(10, \"0\")}.json`;\n  try {\n    await s3.putObject({\n      Bucket: \"event-store\",\n      Key: key,\n      Body: JSON.stringify({ ...event, version: expectedVersion + 1, timestamp: new Date() }),\n      IfNoneMatch: \"*\",\n    });\n  } catch (err) {\n    if (err.$metadata?.httpStatusCode === 412) {\n      throw new ConcurrencyError(`Version ${expectedVersion + 1} already exists`);\n    }\n    throw err;\n  }\n}\n```\n\n## Performance and Cost Reality\n\n| | S3 Standard | S3 Express One Zone | PostgreSQL (RDS) |\n|---|---|---|---|\n| CAS latency | 50-70ms | 14-26ms | \u003C1ms |\n| CAS throughput (per key) | ~15 op\u002Fs | ~75 op\u002Fs | thousands op\u002Fs |\n| Storage | $0.023\u002FGB\u002Fmo | $0.16\u002FGB\u002Fmo | ~$0.10\u002FGB\u002Fmo (EBS) |\n| Durability | 11 nines, multi-AZ | Single AZ | Manual replication |\n| Operational overhead | Zero | Zero | Backups, patching, failover |\n| Capacity limit | Unlimited | Unlimited | Requires resharding |\n\n**S3-as-database fits when:** 20-200ms write latency is acceptable, data is large (TB+), reads are sequential scans (not point lookups), durability matters more than latency, or you want zero ops overhead.\n\n**Use a traditional database when:** you need sub-ms latency, high-frequency point reads\u002Fwrites on one key, complex indexed queries, or CAS throughput above ~75 op\u002Fs per key.\n\n## Anti-Patterns\n\n```typescript\n\u002F\u002F Dangerous: read-modify-write WITHOUT IfMatch -- concurrent writers clobber each other\nconst data = await s3.getObject({ Bucket: \"state\", Key: \"config.json\" });\nconst config = JSON.parse(await data.Body.transformToString());\nconfig.setting = \"new-value\";\nawait s3.putObject({ Bucket: \"state\", Key: \"config.json\", Body: JSON.stringify(config) });\n\n\u002F\u002F Dangerous: log append WITHOUT IfNoneMatch -- two writers claim the same sequence number\nawait s3.putObject({ Bucket: \"log\", Key: `_log\u002F0000000005.json`, Body: JSON.stringify(entry) });\n\n\u002F\u002F Dangerous: conditional write WITHOUT retry -- throwing on 412 is not handling it; re-read and retry\ntry {\n  await s3.putObject({ Bucket: \"state\", Key: \"config.json\", Body: newConfig, IfMatch: etag });\n} catch (err) {\n  if (err.$metadata?.httpStatusCode === 412) throw err; \u002F\u002F wrong: must re-read and retry\n}\n```\n\n## Related Traps\n\n- **Race Conditions** -- S3 without conditional writes is a race condition factory. With `If-Match` and `If-None-Match`, S3 provides the same optimistic concurrency as database version columns.\n- **Idempotency** -- `If-None-Match: *` is a natural idempotency primitive. Writing an event with a deterministic key and put-if-absent guarantees exactly-once creation.\n- **Consistency Models** -- S3 is strongly consistent for reads-after-writes, but LIST can lag. To \"read your writes\" immediately after a PUT, use GET (strongly consistent), not LIST.\n- **Cardinality** -- S3 LIST is still O(n) on the prefix. For high-cardinality key spaces, maintain a metadata index rather than listing objects.\n",{"data":35,"body":36},{"name":4,"description":6},{"type":37,"children":38},"root",[39,48,69,76,176,196,202,207,242,247,253,265,278,750,761,774,1642,1648,1656,1734,1740,1746,1756,1761,1767,1776,1789,1795,1814,2444,2450,2616,2626,2636,2642,3335,3341,3406],{"type":40,"tag":41,"props":42,"children":44},"element","h1",{"id":43},"object-store-as-database",[45],{"type":46,"value":47},"text","Object Store as Database",{"type":40,"tag":49,"props":50,"children":51},"p",{},[52,54,60,62,67],{"type":46,"value":53},"S3 is no longer just a blob store. With strong read-after-write consistency (2020) and conditional writes (2024), S3 is a ",{"type":40,"tag":55,"props":56,"children":57},"strong",{},[58],{"type":46,"value":59},"linearizable key-value store",{"type":46,"value":61}," for single-key operations. The trap is not \"don't use S3 as a database\" -- it's using S3 as a database ",{"type":40,"tag":55,"props":63,"children":64},{},[65],{"type":46,"value":66},"without using conditional writes for correctness",{"type":46,"value":68},".",{"type":40,"tag":70,"props":71,"children":73},"h2",{"id":72},"what-changed",[74],{"type":46,"value":75},"What Changed",{"type":40,"tag":77,"props":78,"children":79},"table",{},[80,104],{"type":40,"tag":81,"props":82,"children":83},"thead",{},[84],{"type":40,"tag":85,"props":86,"children":87},"tr",{},[88,94,99],{"type":40,"tag":89,"props":90,"children":91},"th",{},[92],{"type":46,"value":93},"Year",{"type":40,"tag":89,"props":95,"children":96},{},[97],{"type":46,"value":98},"Change",{"type":40,"tag":89,"props":100,"children":101},{},[102],{"type":46,"value":103},"Impact",{"type":40,"tag":105,"props":106,"children":107},"tbody",{},[108,127,152],{"type":40,"tag":85,"props":109,"children":110},{},[111,117,122],{"type":40,"tag":112,"props":113,"children":114},"td",{},[115],{"type":46,"value":116},"2020",{"type":40,"tag":112,"props":118,"children":119},{},[120],{"type":46,"value":121},"Strong read-after-write consistency",{"type":40,"tag":112,"props":123,"children":124},{},[125],{"type":46,"value":126},"Read after write returns latest; LIST reflects current state.",{"type":40,"tag":85,"props":128,"children":129},{},[130,135,147],{"type":40,"tag":112,"props":131,"children":132},{},[133],{"type":46,"value":134},"Aug 2024",{"type":40,"tag":112,"props":136,"children":137},{},[138,145],{"type":40,"tag":139,"props":140,"children":142},"code",{"className":141},[],[143],{"type":46,"value":144},"If-None-Match: *",{"type":46,"value":146}," (put-if-absent)",{"type":40,"tag":112,"props":148,"children":149},{},[150],{"type":46,"value":151},"Atomic create-if-not-exists. Enables append-only logs, idempotent writes.",{"type":40,"tag":85,"props":153,"children":154},{},[155,160,171],{"type":40,"tag":112,"props":156,"children":157},{},[158],{"type":46,"value":159},"Nov 2024",{"type":40,"tag":112,"props":161,"children":162},{},[163,169],{"type":40,"tag":139,"props":164,"children":166},{"className":165},[],[167],{"type":46,"value":168},"If-Match: \u003Cetag>",{"type":46,"value":170}," (compare-and-swap)",{"type":40,"tag":112,"props":172,"children":173},{},[174],{"type":46,"value":175},"True CAS on objects. Enables optimistic concurrency, leader election, metadata catalogs.",{"type":40,"tag":49,"props":177,"children":178},{},[179,181,186,188,194],{"type":46,"value":180},"Together these give ",{"type":40,"tag":55,"props":182,"children":183},{},[184],{"type":46,"value":185},"linearizable single-key operations",{"type":46,"value":187},": read an object (get its ETag), compute a new value, write it back with ",{"type":40,"tag":139,"props":189,"children":191},{"className":190},[],[192],{"type":46,"value":193},"If-Match",{"type":46,"value":195},". This is the building block under Delta Lake, Iceberg, SlateDB, WarpStream, Chroma, and dozens of others.",{"type":40,"tag":70,"props":197,"children":199},{"id":198},"the-fundamental-pattern",[200],{"type":46,"value":201},"The Fundamental Pattern",{"type":40,"tag":49,"props":203,"children":204},{},[205],{"type":46,"value":206},"Almost every system using S3 as a database follows the same architecture:",{"type":40,"tag":208,"props":209,"children":210},"ol",{},[211,222,232],{"type":40,"tag":212,"props":213,"children":214},"li",{},[215,220],{"type":40,"tag":55,"props":216,"children":217},{},[218],{"type":46,"value":219},"Write immutable data files",{"type":46,"value":221}," to S3 (Parquet, JSON, binary blobs).",{"type":40,"tag":212,"props":223,"children":224},{},[225,230],{"type":40,"tag":55,"props":226,"children":227},{},[228],{"type":46,"value":229},"Maintain a mutable metadata pointer",{"type":46,"value":231}," using conditional writes for atomic commits.",{"type":40,"tag":212,"props":233,"children":234},{},[235,240],{"type":40,"tag":55,"props":236,"children":237},{},[238],{"type":46,"value":239},"Readers follow the pointer",{"type":46,"value":241}," to find the current set of data files.",{"type":40,"tag":49,"props":243,"children":244},{},[245],{"type":46,"value":246},"This is how Delta Lake's transaction log, Iceberg's catalog, SlateDB's manifest, and Chroma's wal3 all work.",{"type":40,"tag":70,"props":248,"children":250},{"id":249},"the-conditional-write-primitives",[251],{"type":46,"value":252},"The Conditional Write Primitives",{"type":40,"tag":254,"props":255,"children":257},"h3",{"id":256},"put-if-absent-if-none-match",[258,260],{"type":46,"value":259},"Put-If-Absent: ",{"type":40,"tag":139,"props":261,"children":263},{"className":262},[],[264],{"type":46,"value":144},{"type":40,"tag":49,"props":266,"children":267},{},[268,270,276],{"type":46,"value":269},"Write succeeds only if no object with this key exists; returns ",{"type":40,"tag":139,"props":271,"children":273},{"className":272},[],[274],{"type":46,"value":275},"412 Precondition Failed",{"type":46,"value":277}," if it does. Use for: transaction log entries, idempotent event writes, one-time initialization, append-only streams.",{"type":40,"tag":279,"props":280,"children":285},"pre",{"className":281,"code":282,"language":283,"meta":284,"style":284},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Claim the next sequence number atomically\ntry {\n  await s3.putObject({\n    Bucket: \"my-log\",\n    Key: `_log\u002F${String(nextSeqNum).padStart(10, \"0\")}.json`,\n    Body: JSON.stringify(commitEntry),\n    IfNoneMatch: \"*\", \u002F\u002F Fails if another writer already claimed this key\n  });\n} catch (err) {\n  if (err.$metadata?.httpStatusCode === 412) {\n    \u002F\u002F Another writer got there first. Re-read state and retry.\n    throw new ConflictError(\"Sequence number already claimed\");\n  }\n  throw err;\n}\n","typescript","",[286],{"type":40,"tag":139,"props":287,"children":288},{"__ignoreMap":284},[289,300,316,351,386,485,529,564,582,604,661,670,714,723,741],{"type":40,"tag":290,"props":291,"children":293},"span",{"class":292,"line":27},"line",[294],{"type":40,"tag":290,"props":295,"children":297},{"style":296},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[298],{"type":46,"value":299},"\u002F\u002F Claim the next sequence number atomically\n",{"type":40,"tag":290,"props":301,"children":303},{"class":292,"line":302},2,[304,310],{"type":40,"tag":290,"props":305,"children":307},{"style":306},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[308],{"type":46,"value":309},"try",{"type":40,"tag":290,"props":311,"children":313},{"style":312},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[314],{"type":46,"value":315}," {\n",{"type":40,"tag":290,"props":317,"children":318},{"class":292,"line":23},[319,324,330,334,340,346],{"type":40,"tag":290,"props":320,"children":321},{"style":306},[322],{"type":46,"value":323},"  await",{"type":40,"tag":290,"props":325,"children":327},{"style":326},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[328],{"type":46,"value":329}," s3",{"type":40,"tag":290,"props":331,"children":332},{"style":312},[333],{"type":46,"value":68},{"type":40,"tag":290,"props":335,"children":337},{"style":336},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[338],{"type":46,"value":339},"putObject",{"type":40,"tag":290,"props":341,"children":343},{"style":342},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[344],{"type":46,"value":345},"(",{"type":40,"tag":290,"props":347,"children":348},{"style":312},[349],{"type":46,"value":350},"{\n",{"type":40,"tag":290,"props":352,"children":354},{"class":292,"line":353},4,[355,360,365,370,376,381],{"type":40,"tag":290,"props":356,"children":357},{"style":342},[358],{"type":46,"value":359},"    Bucket",{"type":40,"tag":290,"props":361,"children":362},{"style":312},[363],{"type":46,"value":364},":",{"type":40,"tag":290,"props":366,"children":367},{"style":312},[368],{"type":46,"value":369}," \"",{"type":40,"tag":290,"props":371,"children":373},{"style":372},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[374],{"type":46,"value":375},"my-log",{"type":40,"tag":290,"props":377,"children":378},{"style":312},[379],{"type":46,"value":380},"\"",{"type":40,"tag":290,"props":382,"children":383},{"style":312},[384],{"type":46,"value":385},",\n",{"type":40,"tag":290,"props":387,"children":389},{"class":292,"line":388},5,[390,395,399,404,409,414,419,424,428,433,437,443,448,452,457,461,466,471,476,481],{"type":40,"tag":290,"props":391,"children":392},{"style":342},[393],{"type":46,"value":394},"    Key",{"type":40,"tag":290,"props":396,"children":397},{"style":312},[398],{"type":46,"value":364},{"type":40,"tag":290,"props":400,"children":401},{"style":312},[402],{"type":46,"value":403}," `",{"type":40,"tag":290,"props":405,"children":406},{"style":372},[407],{"type":46,"value":408},"_log\u002F",{"type":40,"tag":290,"props":410,"children":411},{"style":312},[412],{"type":46,"value":413},"${",{"type":40,"tag":290,"props":415,"children":416},{"style":336},[417],{"type":46,"value":418},"String",{"type":40,"tag":290,"props":420,"children":421},{"style":326},[422],{"type":46,"value":423},"(nextSeqNum)",{"type":40,"tag":290,"props":425,"children":426},{"style":312},[427],{"type":46,"value":68},{"type":40,"tag":290,"props":429,"children":430},{"style":336},[431],{"type":46,"value":432},"padStart",{"type":40,"tag":290,"props":434,"children":435},{"style":326},[436],{"type":46,"value":345},{"type":40,"tag":290,"props":438,"children":440},{"style":439},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[441],{"type":46,"value":442},"10",{"type":40,"tag":290,"props":444,"children":445},{"style":312},[446],{"type":46,"value":447},",",{"type":40,"tag":290,"props":449,"children":450},{"style":312},[451],{"type":46,"value":369},{"type":40,"tag":290,"props":453,"children":454},{"style":372},[455],{"type":46,"value":456},"0",{"type":40,"tag":290,"props":458,"children":459},{"style":312},[460],{"type":46,"value":380},{"type":40,"tag":290,"props":462,"children":463},{"style":326},[464],{"type":46,"value":465},")",{"type":40,"tag":290,"props":467,"children":468},{"style":312},[469],{"type":46,"value":470},"}",{"type":40,"tag":290,"props":472,"children":473},{"style":372},[474],{"type":46,"value":475},".json",{"type":40,"tag":290,"props":477,"children":478},{"style":312},[479],{"type":46,"value":480},"`",{"type":40,"tag":290,"props":482,"children":483},{"style":312},[484],{"type":46,"value":385},{"type":40,"tag":290,"props":486,"children":488},{"class":292,"line":487},6,[489,494,498,503,507,512,516,521,525],{"type":40,"tag":290,"props":490,"children":491},{"style":342},[492],{"type":46,"value":493},"    Body",{"type":40,"tag":290,"props":495,"children":496},{"style":312},[497],{"type":46,"value":364},{"type":40,"tag":290,"props":499,"children":500},{"style":326},[501],{"type":46,"value":502}," JSON",{"type":40,"tag":290,"props":504,"children":505},{"style":312},[506],{"type":46,"value":68},{"type":40,"tag":290,"props":508,"children":509},{"style":336},[510],{"type":46,"value":511},"stringify",{"type":40,"tag":290,"props":513,"children":514},{"style":342},[515],{"type":46,"value":345},{"type":40,"tag":290,"props":517,"children":518},{"style":326},[519],{"type":46,"value":520},"commitEntry",{"type":40,"tag":290,"props":522,"children":523},{"style":342},[524],{"type":46,"value":465},{"type":40,"tag":290,"props":526,"children":527},{"style":312},[528],{"type":46,"value":385},{"type":40,"tag":290,"props":530,"children":532},{"class":292,"line":531},7,[533,538,542,546,551,555,559],{"type":40,"tag":290,"props":534,"children":535},{"style":342},[536],{"type":46,"value":537},"    IfNoneMatch",{"type":40,"tag":290,"props":539,"children":540},{"style":312},[541],{"type":46,"value":364},{"type":40,"tag":290,"props":543,"children":544},{"style":312},[545],{"type":46,"value":369},{"type":40,"tag":290,"props":547,"children":548},{"style":372},[549],{"type":46,"value":550},"*",{"type":40,"tag":290,"props":552,"children":553},{"style":312},[554],{"type":46,"value":380},{"type":40,"tag":290,"props":556,"children":557},{"style":312},[558],{"type":46,"value":447},{"type":40,"tag":290,"props":560,"children":561},{"style":296},[562],{"type":46,"value":563}," \u002F\u002F Fails if another writer already claimed this key\n",{"type":40,"tag":290,"props":565,"children":567},{"class":292,"line":566},8,[568,573,577],{"type":40,"tag":290,"props":569,"children":570},{"style":312},[571],{"type":46,"value":572},"  }",{"type":40,"tag":290,"props":574,"children":575},{"style":342},[576],{"type":46,"value":465},{"type":40,"tag":290,"props":578,"children":579},{"style":312},[580],{"type":46,"value":581},";\n",{"type":40,"tag":290,"props":583,"children":585},{"class":292,"line":584},9,[586,590,595,600],{"type":40,"tag":290,"props":587,"children":588},{"style":312},[589],{"type":46,"value":470},{"type":40,"tag":290,"props":591,"children":592},{"style":306},[593],{"type":46,"value":594}," catch",{"type":40,"tag":290,"props":596,"children":597},{"style":326},[598],{"type":46,"value":599}," (err) ",{"type":40,"tag":290,"props":601,"children":602},{"style":312},[603],{"type":46,"value":350},{"type":40,"tag":290,"props":605,"children":607},{"class":292,"line":606},10,[608,613,618,623,627,632,637,642,647,652,657],{"type":40,"tag":290,"props":609,"children":610},{"style":306},[611],{"type":46,"value":612},"  if",{"type":40,"tag":290,"props":614,"children":615},{"style":342},[616],{"type":46,"value":617}," (",{"type":40,"tag":290,"props":619,"children":620},{"style":326},[621],{"type":46,"value":622},"err",{"type":40,"tag":290,"props":624,"children":625},{"style":312},[626],{"type":46,"value":68},{"type":40,"tag":290,"props":628,"children":629},{"style":326},[630],{"type":46,"value":631},"$metadata",{"type":40,"tag":290,"props":633,"children":634},{"style":312},[635],{"type":46,"value":636},"?.",{"type":40,"tag":290,"props":638,"children":639},{"style":326},[640],{"type":46,"value":641},"httpStatusCode",{"type":40,"tag":290,"props":643,"children":644},{"style":312},[645],{"type":46,"value":646}," ===",{"type":40,"tag":290,"props":648,"children":649},{"style":439},[650],{"type":46,"value":651}," 412",{"type":40,"tag":290,"props":653,"children":654},{"style":342},[655],{"type":46,"value":656},") ",{"type":40,"tag":290,"props":658,"children":659},{"style":312},[660],{"type":46,"value":350},{"type":40,"tag":290,"props":662,"children":664},{"class":292,"line":663},11,[665],{"type":40,"tag":290,"props":666,"children":667},{"style":296},[668],{"type":46,"value":669},"    \u002F\u002F Another writer got there first. Re-read state and retry.\n",{"type":40,"tag":290,"props":671,"children":673},{"class":292,"line":672},12,[674,679,684,689,693,697,702,706,710],{"type":40,"tag":290,"props":675,"children":676},{"style":306},[677],{"type":46,"value":678},"    throw",{"type":40,"tag":290,"props":680,"children":681},{"style":312},[682],{"type":46,"value":683}," new",{"type":40,"tag":290,"props":685,"children":686},{"style":336},[687],{"type":46,"value":688}," ConflictError",{"type":40,"tag":290,"props":690,"children":691},{"style":342},[692],{"type":46,"value":345},{"type":40,"tag":290,"props":694,"children":695},{"style":312},[696],{"type":46,"value":380},{"type":40,"tag":290,"props":698,"children":699},{"style":372},[700],{"type":46,"value":701},"Sequence number already claimed",{"type":40,"tag":290,"props":703,"children":704},{"style":312},[705],{"type":46,"value":380},{"type":40,"tag":290,"props":707,"children":708},{"style":342},[709],{"type":46,"value":465},{"type":40,"tag":290,"props":711,"children":712},{"style":312},[713],{"type":46,"value":581},{"type":40,"tag":290,"props":715,"children":717},{"class":292,"line":716},13,[718],{"type":40,"tag":290,"props":719,"children":720},{"style":312},[721],{"type":46,"value":722},"  }\n",{"type":40,"tag":290,"props":724,"children":726},{"class":292,"line":725},14,[727,732,737],{"type":40,"tag":290,"props":728,"children":729},{"style":306},[730],{"type":46,"value":731},"  throw",{"type":40,"tag":290,"props":733,"children":734},{"style":326},[735],{"type":46,"value":736}," err",{"type":40,"tag":290,"props":738,"children":739},{"style":312},[740],{"type":46,"value":581},{"type":40,"tag":290,"props":742,"children":744},{"class":292,"line":743},15,[745],{"type":40,"tag":290,"props":746,"children":747},{"style":312},[748],{"type":46,"value":749},"}\n",{"type":40,"tag":254,"props":751,"children":753},{"id":752},"compare-and-swap-if-match-etag",[754,756],{"type":46,"value":755},"Compare-and-Swap: ",{"type":40,"tag":139,"props":757,"children":759},{"className":758},[],[760],{"type":46,"value":168},{"type":40,"tag":49,"props":762,"children":763},{},[764,766,772],{"type":46,"value":765},"Write succeeds only if the object's current ETag matches; returns ",{"type":40,"tag":139,"props":767,"children":769},{"className":768},[],[770],{"type":46,"value":771},"412",{"type":46,"value":773}," if another writer changed it. Use for: metadata pointers, shared configuration, counters, leader election, any mutable state.",{"type":40,"tag":279,"props":775,"children":777},{"className":281,"code":776,"language":283,"meta":284,"style":284},"\u002F\u002F Read-modify-write with optimistic concurrency\nasync function updateState\u003CT>(\n  bucket: string,\n  key: string,\n  modify: (current: T) => T,\n  maxRetries = 5\n): Promise\u003CT> {\n  for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n    const response = await s3.getObject({ Bucket: bucket, Key: key });\n    const etag = response.ETag;\n    const current = JSON.parse(await response.Body.transformToString()) as T;\n    const next = modify(current);\n    try {\n      await s3.putObject({\n        Bucket: bucket,\n        Key: key,\n        Body: JSON.stringify(next),\n        IfMatch: etag, \u002F\u002F Fails if someone wrote between our read and write\n      });\n      return next;\n    } catch (err) {\n      if (err.$metadata?.httpStatusCode === 412) continue; \u002F\u002F Conflict -- retry with fresh read\n      throw err;\n    }\n  }\n  throw new Error(`CAS failed after ${maxRetries} retries`);\n}\n",[778],{"type":40,"tag":139,"props":779,"children":780},{"__ignoreMap":284},[781,789,824,846,866,913,931,961,1032,1121,1154,1232,1269,1281,1309,1329,1350,1392,1418,1435,1452,1481,1540,1557,1566,1574,1634],{"type":40,"tag":290,"props":782,"children":783},{"class":292,"line":27},[784],{"type":40,"tag":290,"props":785,"children":786},{"style":296},[787],{"type":46,"value":788},"\u002F\u002F Read-modify-write with optimistic concurrency\n",{"type":40,"tag":290,"props":790,"children":791},{"class":292,"line":302},[792,798,803,808,813,819],{"type":40,"tag":290,"props":793,"children":795},{"style":794},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[796],{"type":46,"value":797},"async",{"type":40,"tag":290,"props":799,"children":800},{"style":794},[801],{"type":46,"value":802}," function",{"type":40,"tag":290,"props":804,"children":805},{"style":336},[806],{"type":46,"value":807}," updateState",{"type":40,"tag":290,"props":809,"children":810},{"style":312},[811],{"type":46,"value":812},"\u003C",{"type":40,"tag":290,"props":814,"children":816},{"style":815},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[817],{"type":46,"value":818},"T",{"type":40,"tag":290,"props":820,"children":821},{"style":312},[822],{"type":46,"value":823},">(\n",{"type":40,"tag":290,"props":825,"children":826},{"class":292,"line":23},[827,833,837,842],{"type":40,"tag":290,"props":828,"children":830},{"style":829},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[831],{"type":46,"value":832},"  bucket",{"type":40,"tag":290,"props":834,"children":835},{"style":312},[836],{"type":46,"value":364},{"type":40,"tag":290,"props":838,"children":839},{"style":815},[840],{"type":46,"value":841}," string",{"type":40,"tag":290,"props":843,"children":844},{"style":312},[845],{"type":46,"value":385},{"type":40,"tag":290,"props":847,"children":848},{"class":292,"line":353},[849,854,858,862],{"type":40,"tag":290,"props":850,"children":851},{"style":829},[852],{"type":46,"value":853},"  key",{"type":40,"tag":290,"props":855,"children":856},{"style":312},[857],{"type":46,"value":364},{"type":40,"tag":290,"props":859,"children":860},{"style":815},[861],{"type":46,"value":841},{"type":40,"tag":290,"props":863,"children":864},{"style":312},[865],{"type":46,"value":385},{"type":40,"tag":290,"props":867,"children":868},{"class":292,"line":388},[869,874,878,882,887,891,896,900,905,909],{"type":40,"tag":290,"props":870,"children":871},{"style":336},[872],{"type":46,"value":873},"  modify",{"type":40,"tag":290,"props":875,"children":876},{"style":312},[877],{"type":46,"value":364},{"type":40,"tag":290,"props":879,"children":880},{"style":312},[881],{"type":46,"value":617},{"type":40,"tag":290,"props":883,"children":884},{"style":829},[885],{"type":46,"value":886},"current",{"type":40,"tag":290,"props":888,"children":889},{"style":312},[890],{"type":46,"value":364},{"type":40,"tag":290,"props":892,"children":893},{"style":815},[894],{"type":46,"value":895}," T",{"type":40,"tag":290,"props":897,"children":898},{"style":312},[899],{"type":46,"value":465},{"type":40,"tag":290,"props":901,"children":902},{"style":794},[903],{"type":46,"value":904}," =>",{"type":40,"tag":290,"props":906,"children":907},{"style":815},[908],{"type":46,"value":895},{"type":40,"tag":290,"props":910,"children":911},{"style":312},[912],{"type":46,"value":385},{"type":40,"tag":290,"props":914,"children":915},{"class":292,"line":487},[916,921,926],{"type":40,"tag":290,"props":917,"children":918},{"style":829},[919],{"type":46,"value":920},"  maxRetries",{"type":40,"tag":290,"props":922,"children":923},{"style":312},[924],{"type":46,"value":925}," =",{"type":40,"tag":290,"props":927,"children":928},{"style":439},[929],{"type":46,"value":930}," 5\n",{"type":40,"tag":290,"props":932,"children":933},{"class":292,"line":531},[934,939,944,948,952,957],{"type":40,"tag":290,"props":935,"children":936},{"style":312},[937],{"type":46,"value":938},"):",{"type":40,"tag":290,"props":940,"children":941},{"style":815},[942],{"type":46,"value":943}," Promise",{"type":40,"tag":290,"props":945,"children":946},{"style":312},[947],{"type":46,"value":812},{"type":40,"tag":290,"props":949,"children":950},{"style":815},[951],{"type":46,"value":818},{"type":40,"tag":290,"props":953,"children":954},{"style":312},[955],{"type":46,"value":956},">",{"type":40,"tag":290,"props":958,"children":959},{"style":312},[960],{"type":46,"value":315},{"type":40,"tag":290,"props":962,"children":963},{"class":292,"line":566},[964,969,973,978,983,987,992,997,1001,1006,1011,1015,1019,1024,1028],{"type":40,"tag":290,"props":965,"children":966},{"style":306},[967],{"type":46,"value":968},"  for",{"type":40,"tag":290,"props":970,"children":971},{"style":342},[972],{"type":46,"value":617},{"type":40,"tag":290,"props":974,"children":975},{"style":794},[976],{"type":46,"value":977},"let",{"type":40,"tag":290,"props":979,"children":980},{"style":326},[981],{"type":46,"value":982}," attempt",{"type":40,"tag":290,"props":984,"children":985},{"style":312},[986],{"type":46,"value":925},{"type":40,"tag":290,"props":988,"children":989},{"style":439},[990],{"type":46,"value":991}," 0",{"type":40,"tag":290,"props":993,"children":994},{"style":312},[995],{"type":46,"value":996},";",{"type":40,"tag":290,"props":998,"children":999},{"style":326},[1000],{"type":46,"value":982},{"type":40,"tag":290,"props":1002,"children":1003},{"style":312},[1004],{"type":46,"value":1005}," \u003C",{"type":40,"tag":290,"props":1007,"children":1008},{"style":326},[1009],{"type":46,"value":1010}," maxRetries",{"type":40,"tag":290,"props":1012,"children":1013},{"style":312},[1014],{"type":46,"value":996},{"type":40,"tag":290,"props":1016,"children":1017},{"style":326},[1018],{"type":46,"value":982},{"type":40,"tag":290,"props":1020,"children":1021},{"style":312},[1022],{"type":46,"value":1023},"++",{"type":40,"tag":290,"props":1025,"children":1026},{"style":342},[1027],{"type":46,"value":656},{"type":40,"tag":290,"props":1029,"children":1030},{"style":312},[1031],{"type":46,"value":350},{"type":40,"tag":290,"props":1033,"children":1034},{"class":292,"line":584},[1035,1040,1045,1049,1054,1058,1062,1067,1071,1076,1081,1085,1090,1094,1099,1103,1108,1113,1117],{"type":40,"tag":290,"props":1036,"children":1037},{"style":794},[1038],{"type":46,"value":1039},"    const",{"type":40,"tag":290,"props":1041,"children":1042},{"style":326},[1043],{"type":46,"value":1044}," response",{"type":40,"tag":290,"props":1046,"children":1047},{"style":312},[1048],{"type":46,"value":925},{"type":40,"tag":290,"props":1050,"children":1051},{"style":306},[1052],{"type":46,"value":1053}," await",{"type":40,"tag":290,"props":1055,"children":1056},{"style":326},[1057],{"type":46,"value":329},{"type":40,"tag":290,"props":1059,"children":1060},{"style":312},[1061],{"type":46,"value":68},{"type":40,"tag":290,"props":1063,"children":1064},{"style":336},[1065],{"type":46,"value":1066},"getObject",{"type":40,"tag":290,"props":1068,"children":1069},{"style":342},[1070],{"type":46,"value":345},{"type":40,"tag":290,"props":1072,"children":1073},{"style":312},[1074],{"type":46,"value":1075},"{",{"type":40,"tag":290,"props":1077,"children":1078},{"style":342},[1079],{"type":46,"value":1080}," Bucket",{"type":40,"tag":290,"props":1082,"children":1083},{"style":312},[1084],{"type":46,"value":364},{"type":40,"tag":290,"props":1086,"children":1087},{"style":326},[1088],{"type":46,"value":1089}," bucket",{"type":40,"tag":290,"props":1091,"children":1092},{"style":312},[1093],{"type":46,"value":447},{"type":40,"tag":290,"props":1095,"children":1096},{"style":342},[1097],{"type":46,"value":1098}," Key",{"type":40,"tag":290,"props":1100,"children":1101},{"style":312},[1102],{"type":46,"value":364},{"type":40,"tag":290,"props":1104,"children":1105},{"style":326},[1106],{"type":46,"value":1107}," key",{"type":40,"tag":290,"props":1109,"children":1110},{"style":312},[1111],{"type":46,"value":1112}," }",{"type":40,"tag":290,"props":1114,"children":1115},{"style":342},[1116],{"type":46,"value":465},{"type":40,"tag":290,"props":1118,"children":1119},{"style":312},[1120],{"type":46,"value":581},{"type":40,"tag":290,"props":1122,"children":1123},{"class":292,"line":606},[1124,1128,1133,1137,1141,1145,1150],{"type":40,"tag":290,"props":1125,"children":1126},{"style":794},[1127],{"type":46,"value":1039},{"type":40,"tag":290,"props":1129,"children":1130},{"style":326},[1131],{"type":46,"value":1132}," etag",{"type":40,"tag":290,"props":1134,"children":1135},{"style":312},[1136],{"type":46,"value":925},{"type":40,"tag":290,"props":1138,"children":1139},{"style":326},[1140],{"type":46,"value":1044},{"type":40,"tag":290,"props":1142,"children":1143},{"style":312},[1144],{"type":46,"value":68},{"type":40,"tag":290,"props":1146,"children":1147},{"style":326},[1148],{"type":46,"value":1149},"ETag",{"type":40,"tag":290,"props":1151,"children":1152},{"style":312},[1153],{"type":46,"value":581},{"type":40,"tag":290,"props":1155,"children":1156},{"class":292,"line":663},[1157,1161,1166,1170,1174,1178,1183,1187,1192,1196,1200,1205,1209,1214,1219,1224,1228],{"type":40,"tag":290,"props":1158,"children":1159},{"style":794},[1160],{"type":46,"value":1039},{"type":40,"tag":290,"props":1162,"children":1163},{"style":326},[1164],{"type":46,"value":1165}," current",{"type":40,"tag":290,"props":1167,"children":1168},{"style":312},[1169],{"type":46,"value":925},{"type":40,"tag":290,"props":1171,"children":1172},{"style":326},[1173],{"type":46,"value":502},{"type":40,"tag":290,"props":1175,"children":1176},{"style":312},[1177],{"type":46,"value":68},{"type":40,"tag":290,"props":1179,"children":1180},{"style":336},[1181],{"type":46,"value":1182},"parse",{"type":40,"tag":290,"props":1184,"children":1185},{"style":342},[1186],{"type":46,"value":345},{"type":40,"tag":290,"props":1188,"children":1189},{"style":306},[1190],{"type":46,"value":1191},"await",{"type":40,"tag":290,"props":1193,"children":1194},{"style":326},[1195],{"type":46,"value":1044},{"type":40,"tag":290,"props":1197,"children":1198},{"style":312},[1199],{"type":46,"value":68},{"type":40,"tag":290,"props":1201,"children":1202},{"style":326},[1203],{"type":46,"value":1204},"Body",{"type":40,"tag":290,"props":1206,"children":1207},{"style":312},[1208],{"type":46,"value":68},{"type":40,"tag":290,"props":1210,"children":1211},{"style":336},[1212],{"type":46,"value":1213},"transformToString",{"type":40,"tag":290,"props":1215,"children":1216},{"style":342},[1217],{"type":46,"value":1218},"()) ",{"type":40,"tag":290,"props":1220,"children":1221},{"style":306},[1222],{"type":46,"value":1223},"as",{"type":40,"tag":290,"props":1225,"children":1226},{"style":815},[1227],{"type":46,"value":895},{"type":40,"tag":290,"props":1229,"children":1230},{"style":312},[1231],{"type":46,"value":581},{"type":40,"tag":290,"props":1233,"children":1234},{"class":292,"line":672},[1235,1239,1244,1248,1253,1257,1261,1265],{"type":40,"tag":290,"props":1236,"children":1237},{"style":794},[1238],{"type":46,"value":1039},{"type":40,"tag":290,"props":1240,"children":1241},{"style":326},[1242],{"type":46,"value":1243}," next",{"type":40,"tag":290,"props":1245,"children":1246},{"style":312},[1247],{"type":46,"value":925},{"type":40,"tag":290,"props":1249,"children":1250},{"style":336},[1251],{"type":46,"value":1252}," modify",{"type":40,"tag":290,"props":1254,"children":1255},{"style":342},[1256],{"type":46,"value":345},{"type":40,"tag":290,"props":1258,"children":1259},{"style":326},[1260],{"type":46,"value":886},{"type":40,"tag":290,"props":1262,"children":1263},{"style":342},[1264],{"type":46,"value":465},{"type":40,"tag":290,"props":1266,"children":1267},{"style":312},[1268],{"type":46,"value":581},{"type":40,"tag":290,"props":1270,"children":1271},{"class":292,"line":716},[1272,1277],{"type":40,"tag":290,"props":1273,"children":1274},{"style":306},[1275],{"type":46,"value":1276},"    try",{"type":40,"tag":290,"props":1278,"children":1279},{"style":312},[1280],{"type":46,"value":315},{"type":40,"tag":290,"props":1282,"children":1283},{"class":292,"line":725},[1284,1289,1293,1297,1301,1305],{"type":40,"tag":290,"props":1285,"children":1286},{"style":306},[1287],{"type":46,"value":1288},"      await",{"type":40,"tag":290,"props":1290,"children":1291},{"style":326},[1292],{"type":46,"value":329},{"type":40,"tag":290,"props":1294,"children":1295},{"style":312},[1296],{"type":46,"value":68},{"type":40,"tag":290,"props":1298,"children":1299},{"style":336},[1300],{"type":46,"value":339},{"type":40,"tag":290,"props":1302,"children":1303},{"style":342},[1304],{"type":46,"value":345},{"type":40,"tag":290,"props":1306,"children":1307},{"style":312},[1308],{"type":46,"value":350},{"type":40,"tag":290,"props":1310,"children":1311},{"class":292,"line":743},[1312,1317,1321,1325],{"type":40,"tag":290,"props":1313,"children":1314},{"style":342},[1315],{"type":46,"value":1316},"        Bucket",{"type":40,"tag":290,"props":1318,"children":1319},{"style":312},[1320],{"type":46,"value":364},{"type":40,"tag":290,"props":1322,"children":1323},{"style":326},[1324],{"type":46,"value":1089},{"type":40,"tag":290,"props":1326,"children":1327},{"style":312},[1328],{"type":46,"value":385},{"type":40,"tag":290,"props":1330,"children":1332},{"class":292,"line":1331},16,[1333,1338,1342,1346],{"type":40,"tag":290,"props":1334,"children":1335},{"style":342},[1336],{"type":46,"value":1337},"        Key",{"type":40,"tag":290,"props":1339,"children":1340},{"style":312},[1341],{"type":46,"value":364},{"type":40,"tag":290,"props":1343,"children":1344},{"style":326},[1345],{"type":46,"value":1107},{"type":40,"tag":290,"props":1347,"children":1348},{"style":312},[1349],{"type":46,"value":385},{"type":40,"tag":290,"props":1351,"children":1353},{"class":292,"line":1352},17,[1354,1359,1363,1367,1371,1375,1379,1384,1388],{"type":40,"tag":290,"props":1355,"children":1356},{"style":342},[1357],{"type":46,"value":1358},"        Body",{"type":40,"tag":290,"props":1360,"children":1361},{"style":312},[1362],{"type":46,"value":364},{"type":40,"tag":290,"props":1364,"children":1365},{"style":326},[1366],{"type":46,"value":502},{"type":40,"tag":290,"props":1368,"children":1369},{"style":312},[1370],{"type":46,"value":68},{"type":40,"tag":290,"props":1372,"children":1373},{"style":336},[1374],{"type":46,"value":511},{"type":40,"tag":290,"props":1376,"children":1377},{"style":342},[1378],{"type":46,"value":345},{"type":40,"tag":290,"props":1380,"children":1381},{"style":326},[1382],{"type":46,"value":1383},"next",{"type":40,"tag":290,"props":1385,"children":1386},{"style":342},[1387],{"type":46,"value":465},{"type":40,"tag":290,"props":1389,"children":1390},{"style":312},[1391],{"type":46,"value":385},{"type":40,"tag":290,"props":1393,"children":1395},{"class":292,"line":1394},18,[1396,1401,1405,1409,1413],{"type":40,"tag":290,"props":1397,"children":1398},{"style":342},[1399],{"type":46,"value":1400},"        IfMatch",{"type":40,"tag":290,"props":1402,"children":1403},{"style":312},[1404],{"type":46,"value":364},{"type":40,"tag":290,"props":1406,"children":1407},{"style":326},[1408],{"type":46,"value":1132},{"type":40,"tag":290,"props":1410,"children":1411},{"style":312},[1412],{"type":46,"value":447},{"type":40,"tag":290,"props":1414,"children":1415},{"style":296},[1416],{"type":46,"value":1417}," \u002F\u002F Fails if someone wrote between our read and write\n",{"type":40,"tag":290,"props":1419,"children":1421},{"class":292,"line":1420},19,[1422,1427,1431],{"type":40,"tag":290,"props":1423,"children":1424},{"style":312},[1425],{"type":46,"value":1426},"      }",{"type":40,"tag":290,"props":1428,"children":1429},{"style":342},[1430],{"type":46,"value":465},{"type":40,"tag":290,"props":1432,"children":1433},{"style":312},[1434],{"type":46,"value":581},{"type":40,"tag":290,"props":1436,"children":1438},{"class":292,"line":1437},20,[1439,1444,1448],{"type":40,"tag":290,"props":1440,"children":1441},{"style":306},[1442],{"type":46,"value":1443},"      return",{"type":40,"tag":290,"props":1445,"children":1446},{"style":326},[1447],{"type":46,"value":1243},{"type":40,"tag":290,"props":1449,"children":1450},{"style":312},[1451],{"type":46,"value":581},{"type":40,"tag":290,"props":1453,"children":1455},{"class":292,"line":1454},21,[1456,1461,1465,1469,1473,1477],{"type":40,"tag":290,"props":1457,"children":1458},{"style":312},[1459],{"type":46,"value":1460},"    }",{"type":40,"tag":290,"props":1462,"children":1463},{"style":306},[1464],{"type":46,"value":594},{"type":40,"tag":290,"props":1466,"children":1467},{"style":342},[1468],{"type":46,"value":617},{"type":40,"tag":290,"props":1470,"children":1471},{"style":326},[1472],{"type":46,"value":622},{"type":40,"tag":290,"props":1474,"children":1475},{"style":342},[1476],{"type":46,"value":656},{"type":40,"tag":290,"props":1478,"children":1479},{"style":312},[1480],{"type":46,"value":350},{"type":40,"tag":290,"props":1482,"children":1484},{"class":292,"line":1483},22,[1485,1490,1494,1498,1502,1506,1510,1514,1518,1522,1526,1531,1535],{"type":40,"tag":290,"props":1486,"children":1487},{"style":306},[1488],{"type":46,"value":1489},"      if",{"type":40,"tag":290,"props":1491,"children":1492},{"style":342},[1493],{"type":46,"value":617},{"type":40,"tag":290,"props":1495,"children":1496},{"style":326},[1497],{"type":46,"value":622},{"type":40,"tag":290,"props":1499,"children":1500},{"style":312},[1501],{"type":46,"value":68},{"type":40,"tag":290,"props":1503,"children":1504},{"style":326},[1505],{"type":46,"value":631},{"type":40,"tag":290,"props":1507,"children":1508},{"style":312},[1509],{"type":46,"value":636},{"type":40,"tag":290,"props":1511,"children":1512},{"style":326},[1513],{"type":46,"value":641},{"type":40,"tag":290,"props":1515,"children":1516},{"style":312},[1517],{"type":46,"value":646},{"type":40,"tag":290,"props":1519,"children":1520},{"style":439},[1521],{"type":46,"value":651},{"type":40,"tag":290,"props":1523,"children":1524},{"style":342},[1525],{"type":46,"value":656},{"type":40,"tag":290,"props":1527,"children":1528},{"style":306},[1529],{"type":46,"value":1530},"continue",{"type":40,"tag":290,"props":1532,"children":1533},{"style":312},[1534],{"type":46,"value":996},{"type":40,"tag":290,"props":1536,"children":1537},{"style":296},[1538],{"type":46,"value":1539}," \u002F\u002F Conflict -- retry with fresh read\n",{"type":40,"tag":290,"props":1541,"children":1543},{"class":292,"line":1542},23,[1544,1549,1553],{"type":40,"tag":290,"props":1545,"children":1546},{"style":306},[1547],{"type":46,"value":1548},"      throw",{"type":40,"tag":290,"props":1550,"children":1551},{"style":326},[1552],{"type":46,"value":736},{"type":40,"tag":290,"props":1554,"children":1555},{"style":312},[1556],{"type":46,"value":581},{"type":40,"tag":290,"props":1558,"children":1560},{"class":292,"line":1559},24,[1561],{"type":40,"tag":290,"props":1562,"children":1563},{"style":312},[1564],{"type":46,"value":1565},"    }\n",{"type":40,"tag":290,"props":1567,"children":1569},{"class":292,"line":1568},25,[1570],{"type":40,"tag":290,"props":1571,"children":1572},{"style":312},[1573],{"type":46,"value":722},{"type":40,"tag":290,"props":1575,"children":1577},{"class":292,"line":1576},26,[1578,1582,1586,1591,1595,1599,1604,1608,1613,1617,1622,1626,1630],{"type":40,"tag":290,"props":1579,"children":1580},{"style":306},[1581],{"type":46,"value":731},{"type":40,"tag":290,"props":1583,"children":1584},{"style":312},[1585],{"type":46,"value":683},{"type":40,"tag":290,"props":1587,"children":1588},{"style":336},[1589],{"type":46,"value":1590}," Error",{"type":40,"tag":290,"props":1592,"children":1593},{"style":342},[1594],{"type":46,"value":345},{"type":40,"tag":290,"props":1596,"children":1597},{"style":312},[1598],{"type":46,"value":480},{"type":40,"tag":290,"props":1600,"children":1601},{"style":372},[1602],{"type":46,"value":1603},"CAS failed after ",{"type":40,"tag":290,"props":1605,"children":1606},{"style":312},[1607],{"type":46,"value":413},{"type":40,"tag":290,"props":1609,"children":1610},{"style":326},[1611],{"type":46,"value":1612},"maxRetries",{"type":40,"tag":290,"props":1614,"children":1615},{"style":312},[1616],{"type":46,"value":470},{"type":40,"tag":290,"props":1618,"children":1619},{"style":372},[1620],{"type":46,"value":1621}," retries",{"type":40,"tag":290,"props":1623,"children":1624},{"style":312},[1625],{"type":46,"value":480},{"type":40,"tag":290,"props":1627,"children":1628},{"style":342},[1629],{"type":46,"value":465},{"type":40,"tag":290,"props":1631,"children":1632},{"style":312},[1633],{"type":46,"value":581},{"type":40,"tag":290,"props":1635,"children":1637},{"class":292,"line":1636},27,[1638],{"type":40,"tag":290,"props":1639,"children":1640},{"style":312},[1641],{"type":46,"value":749},{"type":40,"tag":70,"props":1643,"children":1645},{"id":1644},"detection-when-youre-using-s3-as-a-database",[1646],{"type":46,"value":1647},"Detection: When You're Using S3 as a Database",{"type":40,"tag":49,"props":1649,"children":1650},{},[1651],{"type":40,"tag":55,"props":1652,"children":1653},{},[1654],{"type":46,"value":1655},"Stop and assess if you see:",{"type":40,"tag":208,"props":1657,"children":1658},{},[1659,1674,1690,1700,1717],{"type":40,"tag":212,"props":1660,"children":1661},{},[1662,1672],{"type":40,"tag":55,"props":1663,"children":1664},{},[1665,1667],{"type":46,"value":1666},"GET → modify → PUT without ",{"type":40,"tag":139,"props":1668,"children":1670},{"className":1669},[],[1671],{"type":46,"value":193},{"type":46,"value":1673}," -- a race condition. Two concurrent writers silently clobber each other. Always use conditional writes for mutable state.",{"type":40,"tag":212,"props":1675,"children":1676},{},[1677,1688],{"type":40,"tag":55,"props":1678,"children":1679},{},[1680,1682],{"type":46,"value":1681},"Sequential log entries without ",{"type":40,"tag":139,"props":1683,"children":1685},{"className":1684},[],[1686],{"type":46,"value":1687},"If-None-Match",{"type":46,"value":1689}," -- two writers can claim the same sequence number. Use put-if-absent to atomically claim entries.",{"type":40,"tag":212,"props":1691,"children":1692},{},[1693,1698],{"type":40,"tag":55,"props":1694,"children":1695},{},[1696],{"type":46,"value":1697},"S3 LIST as a query mechanism",{"type":46,"value":1699}," -- LIST returns 1,000 objects per page and is not a query. To find objects by field values, store metadata in a database or use a table format (Iceberg, Delta Lake) with a catalog.",{"type":40,"tag":212,"props":1701,"children":1702},{},[1703,1708,1710,1715],{"type":40,"tag":55,"props":1704,"children":1705},{},[1706],{"type":46,"value":1707},"Mutable state without a retry loop",{"type":46,"value":1709}," -- conditional writes are optimistic and can fail with ",{"type":40,"tag":139,"props":1711,"children":1713},{"className":1712},[],[1714],{"type":46,"value":771},{"type":46,"value":1716},". You must read, modify, write, and retry on conflict.",{"type":40,"tag":212,"props":1718,"children":1719},{},[1720,1725,1727,1732],{"type":40,"tag":55,"props":1721,"children":1722},{},[1723],{"type":46,"value":1724},"Missing the 412 handler",{"type":46,"value":1726}," -- a PutObject that doesn't handle ",{"type":40,"tag":139,"props":1728,"children":1730},{"className":1729},[],[1731],{"type":46,"value":275},{"type":46,"value":1733}," makes the conditional write useless; the whole point is detecting conflicts.",{"type":40,"tag":70,"props":1735,"children":1737},{"id":1736},"patterns-in-the-wild",[1738],{"type":46,"value":1739},"Patterns in the Wild",{"type":40,"tag":254,"props":1741,"children":1743},{"id":1742},"transaction-log-delta-lake-pattern",[1744],{"type":46,"value":1745},"Transaction log (Delta Lake pattern)",{"type":40,"tag":279,"props":1747,"children":1751},{"className":1748,"code":1750,"language":46},[1749],"language-text","_delta_log\u002F0000000001.json   ← each commit claims the next seq number with If-None-Match: *\ndata\u002Fpart-00001.parquet      ← immutable data files referenced by commits\n",[1752],{"type":40,"tag":139,"props":1753,"children":1754},{"__ignoreMap":284},[1755],{"type":46,"value":1750},{"type":40,"tag":49,"props":1757,"children":1758},{},[1759],{"type":46,"value":1760},"Readers find the latest commit number, read that commit's JSON to learn which data files are current.",{"type":40,"tag":254,"props":1762,"children":1764},{"id":1763},"metadata-pointer-iceberg-pattern",[1765],{"type":46,"value":1766},"Metadata pointer (Iceberg pattern)",{"type":40,"tag":279,"props":1768,"children":1771},{"className":1769,"code":1770,"language":46},[1749],"metadata\u002Fv3-uuid.metadata.json   ← immutable metadata snapshots\nmetadata\u002Fcurrent.json            ← mutable pointer, updated with If-Match\ndata\u002Fdata-00001.parquet          ← immutable data files\n",[1772],{"type":40,"tag":139,"props":1773,"children":1774},{"__ignoreMap":284},[1775],{"type":46,"value":1770},{"type":40,"tag":49,"props":1777,"children":1778},{},[1779,1781,1787],{"type":46,"value":1780},"Writers create a new immutable metadata file, then CAS ",{"type":40,"tag":139,"props":1782,"children":1784},{"className":1783},[],[1785],{"type":46,"value":1786},"current.json",{"type":46,"value":1788}," from the old metadata to the new. On conflict, re-read the pointer, check for data conflicts, and retry.",{"type":40,"tag":254,"props":1790,"children":1792},{"id":1791},"leader-election-append-only-event-store",[1793],{"type":46,"value":1794},"Leader election \u002F append-only event store",{"type":40,"tag":49,"props":1796,"children":1797},{},[1798,1800,1805,1807,1812],{"type":46,"value":1799},"Both are put-if-absent: claim an epoch-numbered lock or a version-numbered event key with ",{"type":40,"tag":139,"props":1801,"children":1803},{"className":1802},[],[1804],{"type":46,"value":144},{"type":46,"value":1806},"; a ",{"type":40,"tag":139,"props":1808,"children":1810},{"className":1809},[],[1811],{"type":46,"value":771},{"type":46,"value":1813}," means someone else claimed it.",{"type":40,"tag":279,"props":1815,"children":1817},{"className":281,"code":1816,"language":283,"meta":284,"style":284},"\u002F\u002F Append an immutable, version-numbered event; 412 = version already exists\nasync function appendEvent(streamId: string, expectedVersion: number, event: Event) {\n  const key = `streams\u002F${streamId}\u002F${String(expectedVersion + 1).padStart(10, \"0\")}.json`;\n  try {\n    await s3.putObject({\n      Bucket: \"event-store\",\n      Key: key,\n      Body: JSON.stringify({ ...event, version: expectedVersion + 1, timestamp: new Date() }),\n      IfNoneMatch: \"*\",\n    });\n  } catch (err) {\n    if (err.$metadata?.httpStatusCode === 412) {\n      throw new ConcurrencyError(`Version ${expectedVersion + 1} already exists`);\n    }\n    throw err;\n  }\n}\n",[1818],{"type":40,"tag":139,"props":1819,"children":1820},{"__ignoreMap":284},[1821,1829,1906,2027,2039,2067,2096,2116,2223,2251,2266,2293,2341,2408,2415,2430,2437],{"type":40,"tag":290,"props":1822,"children":1823},{"class":292,"line":27},[1824],{"type":40,"tag":290,"props":1825,"children":1826},{"style":296},[1827],{"type":46,"value":1828},"\u002F\u002F Append an immutable, version-numbered event; 412 = version already exists\n",{"type":40,"tag":290,"props":1830,"children":1831},{"class":292,"line":302},[1832,1836,1840,1845,1849,1854,1858,1862,1866,1871,1875,1880,1884,1889,1893,1898,1902],{"type":40,"tag":290,"props":1833,"children":1834},{"style":794},[1835],{"type":46,"value":797},{"type":40,"tag":290,"props":1837,"children":1838},{"style":794},[1839],{"type":46,"value":802},{"type":40,"tag":290,"props":1841,"children":1842},{"style":336},[1843],{"type":46,"value":1844}," appendEvent",{"type":40,"tag":290,"props":1846,"children":1847},{"style":312},[1848],{"type":46,"value":345},{"type":40,"tag":290,"props":1850,"children":1851},{"style":829},[1852],{"type":46,"value":1853},"streamId",{"type":40,"tag":290,"props":1855,"children":1856},{"style":312},[1857],{"type":46,"value":364},{"type":40,"tag":290,"props":1859,"children":1860},{"style":815},[1861],{"type":46,"value":841},{"type":40,"tag":290,"props":1863,"children":1864},{"style":312},[1865],{"type":46,"value":447},{"type":40,"tag":290,"props":1867,"children":1868},{"style":829},[1869],{"type":46,"value":1870}," expectedVersion",{"type":40,"tag":290,"props":1872,"children":1873},{"style":312},[1874],{"type":46,"value":364},{"type":40,"tag":290,"props":1876,"children":1877},{"style":815},[1878],{"type":46,"value":1879}," number",{"type":40,"tag":290,"props":1881,"children":1882},{"style":312},[1883],{"type":46,"value":447},{"type":40,"tag":290,"props":1885,"children":1886},{"style":829},[1887],{"type":46,"value":1888}," event",{"type":40,"tag":290,"props":1890,"children":1891},{"style":312},[1892],{"type":46,"value":364},{"type":40,"tag":290,"props":1894,"children":1895},{"style":815},[1896],{"type":46,"value":1897}," Event",{"type":40,"tag":290,"props":1899,"children":1900},{"style":312},[1901],{"type":46,"value":465},{"type":40,"tag":290,"props":1903,"children":1904},{"style":312},[1905],{"type":46,"value":315},{"type":40,"tag":290,"props":1907,"children":1908},{"class":292,"line":23},[1909,1914,1918,1922,1926,1931,1935,1939,1943,1948,1952,1956,1961,1966,1971,1975,1979,1983,1987,1991,1995,1999,2003,2007,2011,2015,2019,2023],{"type":40,"tag":290,"props":1910,"children":1911},{"style":794},[1912],{"type":46,"value":1913},"  const",{"type":40,"tag":290,"props":1915,"children":1916},{"style":326},[1917],{"type":46,"value":1107},{"type":40,"tag":290,"props":1919,"children":1920},{"style":312},[1921],{"type":46,"value":925},{"type":40,"tag":290,"props":1923,"children":1924},{"style":312},[1925],{"type":46,"value":403},{"type":40,"tag":290,"props":1927,"children":1928},{"style":372},[1929],{"type":46,"value":1930},"streams\u002F",{"type":40,"tag":290,"props":1932,"children":1933},{"style":312},[1934],{"type":46,"value":413},{"type":40,"tag":290,"props":1936,"children":1937},{"style":326},[1938],{"type":46,"value":1853},{"type":40,"tag":290,"props":1940,"children":1941},{"style":312},[1942],{"type":46,"value":470},{"type":40,"tag":290,"props":1944,"children":1945},{"style":372},[1946],{"type":46,"value":1947},"\u002F",{"type":40,"tag":290,"props":1949,"children":1950},{"style":312},[1951],{"type":46,"value":413},{"type":40,"tag":290,"props":1953,"children":1954},{"style":336},[1955],{"type":46,"value":418},{"type":40,"tag":290,"props":1957,"children":1958},{"style":326},[1959],{"type":46,"value":1960},"(expectedVersion ",{"type":40,"tag":290,"props":1962,"children":1963},{"style":312},[1964],{"type":46,"value":1965},"+",{"type":40,"tag":290,"props":1967,"children":1968},{"style":439},[1969],{"type":46,"value":1970}," 1",{"type":40,"tag":290,"props":1972,"children":1973},{"style":326},[1974],{"type":46,"value":465},{"type":40,"tag":290,"props":1976,"children":1977},{"style":312},[1978],{"type":46,"value":68},{"type":40,"tag":290,"props":1980,"children":1981},{"style":336},[1982],{"type":46,"value":432},{"type":40,"tag":290,"props":1984,"children":1985},{"style":326},[1986],{"type":46,"value":345},{"type":40,"tag":290,"props":1988,"children":1989},{"style":439},[1990],{"type":46,"value":442},{"type":40,"tag":290,"props":1992,"children":1993},{"style":312},[1994],{"type":46,"value":447},{"type":40,"tag":290,"props":1996,"children":1997},{"style":312},[1998],{"type":46,"value":369},{"type":40,"tag":290,"props":2000,"children":2001},{"style":372},[2002],{"type":46,"value":456},{"type":40,"tag":290,"props":2004,"children":2005},{"style":312},[2006],{"type":46,"value":380},{"type":40,"tag":290,"props":2008,"children":2009},{"style":326},[2010],{"type":46,"value":465},{"type":40,"tag":290,"props":2012,"children":2013},{"style":312},[2014],{"type":46,"value":470},{"type":40,"tag":290,"props":2016,"children":2017},{"style":372},[2018],{"type":46,"value":475},{"type":40,"tag":290,"props":2020,"children":2021},{"style":312},[2022],{"type":46,"value":480},{"type":40,"tag":290,"props":2024,"children":2025},{"style":312},[2026],{"type":46,"value":581},{"type":40,"tag":290,"props":2028,"children":2029},{"class":292,"line":353},[2030,2035],{"type":40,"tag":290,"props":2031,"children":2032},{"style":306},[2033],{"type":46,"value":2034},"  try",{"type":40,"tag":290,"props":2036,"children":2037},{"style":312},[2038],{"type":46,"value":315},{"type":40,"tag":290,"props":2040,"children":2041},{"class":292,"line":388},[2042,2047,2051,2055,2059,2063],{"type":40,"tag":290,"props":2043,"children":2044},{"style":306},[2045],{"type":46,"value":2046},"    await",{"type":40,"tag":290,"props":2048,"children":2049},{"style":326},[2050],{"type":46,"value":329},{"type":40,"tag":290,"props":2052,"children":2053},{"style":312},[2054],{"type":46,"value":68},{"type":40,"tag":290,"props":2056,"children":2057},{"style":336},[2058],{"type":46,"value":339},{"type":40,"tag":290,"props":2060,"children":2061},{"style":342},[2062],{"type":46,"value":345},{"type":40,"tag":290,"props":2064,"children":2065},{"style":312},[2066],{"type":46,"value":350},{"type":40,"tag":290,"props":2068,"children":2069},{"class":292,"line":487},[2070,2075,2079,2083,2088,2092],{"type":40,"tag":290,"props":2071,"children":2072},{"style":342},[2073],{"type":46,"value":2074},"      Bucket",{"type":40,"tag":290,"props":2076,"children":2077},{"style":312},[2078],{"type":46,"value":364},{"type":40,"tag":290,"props":2080,"children":2081},{"style":312},[2082],{"type":46,"value":369},{"type":40,"tag":290,"props":2084,"children":2085},{"style":372},[2086],{"type":46,"value":2087},"event-store",{"type":40,"tag":290,"props":2089,"children":2090},{"style":312},[2091],{"type":46,"value":380},{"type":40,"tag":290,"props":2093,"children":2094},{"style":312},[2095],{"type":46,"value":385},{"type":40,"tag":290,"props":2097,"children":2098},{"class":292,"line":531},[2099,2104,2108,2112],{"type":40,"tag":290,"props":2100,"children":2101},{"style":342},[2102],{"type":46,"value":2103},"      Key",{"type":40,"tag":290,"props":2105,"children":2106},{"style":312},[2107],{"type":46,"value":364},{"type":40,"tag":290,"props":2109,"children":2110},{"style":326},[2111],{"type":46,"value":1107},{"type":40,"tag":290,"props":2113,"children":2114},{"style":312},[2115],{"type":46,"value":385},{"type":40,"tag":290,"props":2117,"children":2118},{"class":292,"line":566},[2119,2124,2128,2132,2136,2140,2144,2148,2153,2158,2162,2167,2171,2175,2180,2184,2188,2193,2197,2201,2206,2211,2215,2219],{"type":40,"tag":290,"props":2120,"children":2121},{"style":342},[2122],{"type":46,"value":2123},"      Body",{"type":40,"tag":290,"props":2125,"children":2126},{"style":312},[2127],{"type":46,"value":364},{"type":40,"tag":290,"props":2129,"children":2130},{"style":326},[2131],{"type":46,"value":502},{"type":40,"tag":290,"props":2133,"children":2134},{"style":312},[2135],{"type":46,"value":68},{"type":40,"tag":290,"props":2137,"children":2138},{"style":336},[2139],{"type":46,"value":511},{"type":40,"tag":290,"props":2141,"children":2142},{"style":342},[2143],{"type":46,"value":345},{"type":40,"tag":290,"props":2145,"children":2146},{"style":312},[2147],{"type":46,"value":1075},{"type":40,"tag":290,"props":2149,"children":2150},{"style":312},[2151],{"type":46,"value":2152}," ...",{"type":40,"tag":290,"props":2154,"children":2155},{"style":326},[2156],{"type":46,"value":2157},"event",{"type":40,"tag":290,"props":2159,"children":2160},{"style":312},[2161],{"type":46,"value":447},{"type":40,"tag":290,"props":2163,"children":2164},{"style":342},[2165],{"type":46,"value":2166}," version",{"type":40,"tag":290,"props":2168,"children":2169},{"style":312},[2170],{"type":46,"value":364},{"type":40,"tag":290,"props":2172,"children":2173},{"style":326},[2174],{"type":46,"value":1870},{"type":40,"tag":290,"props":2176,"children":2177},{"style":312},[2178],{"type":46,"value":2179}," +",{"type":40,"tag":290,"props":2181,"children":2182},{"style":439},[2183],{"type":46,"value":1970},{"type":40,"tag":290,"props":2185,"children":2186},{"style":312},[2187],{"type":46,"value":447},{"type":40,"tag":290,"props":2189,"children":2190},{"style":342},[2191],{"type":46,"value":2192}," timestamp",{"type":40,"tag":290,"props":2194,"children":2195},{"style":312},[2196],{"type":46,"value":364},{"type":40,"tag":290,"props":2198,"children":2199},{"style":312},[2200],{"type":46,"value":683},{"type":40,"tag":290,"props":2202,"children":2203},{"style":336},[2204],{"type":46,"value":2205}," Date",{"type":40,"tag":290,"props":2207,"children":2208},{"style":342},[2209],{"type":46,"value":2210},"() ",{"type":40,"tag":290,"props":2212,"children":2213},{"style":312},[2214],{"type":46,"value":470},{"type":40,"tag":290,"props":2216,"children":2217},{"style":342},[2218],{"type":46,"value":465},{"type":40,"tag":290,"props":2220,"children":2221},{"style":312},[2222],{"type":46,"value":385},{"type":40,"tag":290,"props":2224,"children":2225},{"class":292,"line":584},[2226,2231,2235,2239,2243,2247],{"type":40,"tag":290,"props":2227,"children":2228},{"style":342},[2229],{"type":46,"value":2230},"      IfNoneMatch",{"type":40,"tag":290,"props":2232,"children":2233},{"style":312},[2234],{"type":46,"value":364},{"type":40,"tag":290,"props":2236,"children":2237},{"style":312},[2238],{"type":46,"value":369},{"type":40,"tag":290,"props":2240,"children":2241},{"style":372},[2242],{"type":46,"value":550},{"type":40,"tag":290,"props":2244,"children":2245},{"style":312},[2246],{"type":46,"value":380},{"type":40,"tag":290,"props":2248,"children":2249},{"style":312},[2250],{"type":46,"value":385},{"type":40,"tag":290,"props":2252,"children":2253},{"class":292,"line":606},[2254,2258,2262],{"type":40,"tag":290,"props":2255,"children":2256},{"style":312},[2257],{"type":46,"value":1460},{"type":40,"tag":290,"props":2259,"children":2260},{"style":342},[2261],{"type":46,"value":465},{"type":40,"tag":290,"props":2263,"children":2264},{"style":312},[2265],{"type":46,"value":581},{"type":40,"tag":290,"props":2267,"children":2268},{"class":292,"line":663},[2269,2273,2277,2281,2285,2289],{"type":40,"tag":290,"props":2270,"children":2271},{"style":312},[2272],{"type":46,"value":572},{"type":40,"tag":290,"props":2274,"children":2275},{"style":306},[2276],{"type":46,"value":594},{"type":40,"tag":290,"props":2278,"children":2279},{"style":342},[2280],{"type":46,"value":617},{"type":40,"tag":290,"props":2282,"children":2283},{"style":326},[2284],{"type":46,"value":622},{"type":40,"tag":290,"props":2286,"children":2287},{"style":342},[2288],{"type":46,"value":656},{"type":40,"tag":290,"props":2290,"children":2291},{"style":312},[2292],{"type":46,"value":350},{"type":40,"tag":290,"props":2294,"children":2295},{"class":292,"line":672},[2296,2301,2305,2309,2313,2317,2321,2325,2329,2333,2337],{"type":40,"tag":290,"props":2297,"children":2298},{"style":306},[2299],{"type":46,"value":2300},"    if",{"type":40,"tag":290,"props":2302,"children":2303},{"style":342},[2304],{"type":46,"value":617},{"type":40,"tag":290,"props":2306,"children":2307},{"style":326},[2308],{"type":46,"value":622},{"type":40,"tag":290,"props":2310,"children":2311},{"style":312},[2312],{"type":46,"value":68},{"type":40,"tag":290,"props":2314,"children":2315},{"style":326},[2316],{"type":46,"value":631},{"type":40,"tag":290,"props":2318,"children":2319},{"style":312},[2320],{"type":46,"value":636},{"type":40,"tag":290,"props":2322,"children":2323},{"style":326},[2324],{"type":46,"value":641},{"type":40,"tag":290,"props":2326,"children":2327},{"style":312},[2328],{"type":46,"value":646},{"type":40,"tag":290,"props":2330,"children":2331},{"style":439},[2332],{"type":46,"value":651},{"type":40,"tag":290,"props":2334,"children":2335},{"style":342},[2336],{"type":46,"value":656},{"type":40,"tag":290,"props":2338,"children":2339},{"style":312},[2340],{"type":46,"value":350},{"type":40,"tag":290,"props":2342,"children":2343},{"class":292,"line":716},[2344,2348,2352,2357,2361,2365,2370,2374,2379,2383,2387,2391,2396,2400,2404],{"type":40,"tag":290,"props":2345,"children":2346},{"style":306},[2347],{"type":46,"value":1548},{"type":40,"tag":290,"props":2349,"children":2350},{"style":312},[2351],{"type":46,"value":683},{"type":40,"tag":290,"props":2353,"children":2354},{"style":336},[2355],{"type":46,"value":2356}," ConcurrencyError",{"type":40,"tag":290,"props":2358,"children":2359},{"style":342},[2360],{"type":46,"value":345},{"type":40,"tag":290,"props":2362,"children":2363},{"style":312},[2364],{"type":46,"value":480},{"type":40,"tag":290,"props":2366,"children":2367},{"style":372},[2368],{"type":46,"value":2369},"Version ",{"type":40,"tag":290,"props":2371,"children":2372},{"style":312},[2373],{"type":46,"value":413},{"type":40,"tag":290,"props":2375,"children":2376},{"style":326},[2377],{"type":46,"value":2378},"expectedVersion ",{"type":40,"tag":290,"props":2380,"children":2381},{"style":312},[2382],{"type":46,"value":1965},{"type":40,"tag":290,"props":2384,"children":2385},{"style":439},[2386],{"type":46,"value":1970},{"type":40,"tag":290,"props":2388,"children":2389},{"style":312},[2390],{"type":46,"value":470},{"type":40,"tag":290,"props":2392,"children":2393},{"style":372},[2394],{"type":46,"value":2395}," already exists",{"type":40,"tag":290,"props":2397,"children":2398},{"style":312},[2399],{"type":46,"value":480},{"type":40,"tag":290,"props":2401,"children":2402},{"style":342},[2403],{"type":46,"value":465},{"type":40,"tag":290,"props":2405,"children":2406},{"style":312},[2407],{"type":46,"value":581},{"type":40,"tag":290,"props":2409,"children":2410},{"class":292,"line":725},[2411],{"type":40,"tag":290,"props":2412,"children":2413},{"style":312},[2414],{"type":46,"value":1565},{"type":40,"tag":290,"props":2416,"children":2417},{"class":292,"line":743},[2418,2422,2426],{"type":40,"tag":290,"props":2419,"children":2420},{"style":306},[2421],{"type":46,"value":678},{"type":40,"tag":290,"props":2423,"children":2424},{"style":326},[2425],{"type":46,"value":736},{"type":40,"tag":290,"props":2427,"children":2428},{"style":312},[2429],{"type":46,"value":581},{"type":40,"tag":290,"props":2431,"children":2432},{"class":292,"line":1331},[2433],{"type":40,"tag":290,"props":2434,"children":2435},{"style":312},[2436],{"type":46,"value":722},{"type":40,"tag":290,"props":2438,"children":2439},{"class":292,"line":1352},[2440],{"type":40,"tag":290,"props":2441,"children":2442},{"style":312},[2443],{"type":46,"value":749},{"type":40,"tag":70,"props":2445,"children":2447},{"id":2446},"performance-and-cost-reality",[2448],{"type":46,"value":2449},"Performance and Cost Reality",{"type":40,"tag":77,"props":2451,"children":2452},{},[2453,2477],{"type":40,"tag":81,"props":2454,"children":2455},{},[2456],{"type":40,"tag":85,"props":2457,"children":2458},{},[2459,2462,2467,2472],{"type":40,"tag":89,"props":2460,"children":2461},{},[],{"type":40,"tag":89,"props":2463,"children":2464},{},[2465],{"type":46,"value":2466},"S3 Standard",{"type":40,"tag":89,"props":2468,"children":2469},{},[2470],{"type":46,"value":2471},"S3 Express One Zone",{"type":40,"tag":89,"props":2473,"children":2474},{},[2475],{"type":46,"value":2476},"PostgreSQL (RDS)",{"type":40,"tag":105,"props":2478,"children":2479},{},[2480,2503,2526,2549,2572,2594],{"type":40,"tag":85,"props":2481,"children":2482},{},[2483,2488,2493,2498],{"type":40,"tag":112,"props":2484,"children":2485},{},[2486],{"type":46,"value":2487},"CAS latency",{"type":40,"tag":112,"props":2489,"children":2490},{},[2491],{"type":46,"value":2492},"50-70ms",{"type":40,"tag":112,"props":2494,"children":2495},{},[2496],{"type":46,"value":2497},"14-26ms",{"type":40,"tag":112,"props":2499,"children":2500},{},[2501],{"type":46,"value":2502},"\u003C1ms",{"type":40,"tag":85,"props":2504,"children":2505},{},[2506,2511,2516,2521],{"type":40,"tag":112,"props":2507,"children":2508},{},[2509],{"type":46,"value":2510},"CAS throughput (per key)",{"type":40,"tag":112,"props":2512,"children":2513},{},[2514],{"type":46,"value":2515},"~15 op\u002Fs",{"type":40,"tag":112,"props":2517,"children":2518},{},[2519],{"type":46,"value":2520},"~75 op\u002Fs",{"type":40,"tag":112,"props":2522,"children":2523},{},[2524],{"type":46,"value":2525},"thousands op\u002Fs",{"type":40,"tag":85,"props":2527,"children":2528},{},[2529,2534,2539,2544],{"type":40,"tag":112,"props":2530,"children":2531},{},[2532],{"type":46,"value":2533},"Storage",{"type":40,"tag":112,"props":2535,"children":2536},{},[2537],{"type":46,"value":2538},"$0.023\u002FGB\u002Fmo",{"type":40,"tag":112,"props":2540,"children":2541},{},[2542],{"type":46,"value":2543},"$0.16\u002FGB\u002Fmo",{"type":40,"tag":112,"props":2545,"children":2546},{},[2547],{"type":46,"value":2548},"~$0.10\u002FGB\u002Fmo (EBS)",{"type":40,"tag":85,"props":2550,"children":2551},{},[2552,2557,2562,2567],{"type":40,"tag":112,"props":2553,"children":2554},{},[2555],{"type":46,"value":2556},"Durability",{"type":40,"tag":112,"props":2558,"children":2559},{},[2560],{"type":46,"value":2561},"11 nines, multi-AZ",{"type":40,"tag":112,"props":2563,"children":2564},{},[2565],{"type":46,"value":2566},"Single AZ",{"type":40,"tag":112,"props":2568,"children":2569},{},[2570],{"type":46,"value":2571},"Manual replication",{"type":40,"tag":85,"props":2573,"children":2574},{},[2575,2580,2585,2589],{"type":40,"tag":112,"props":2576,"children":2577},{},[2578],{"type":46,"value":2579},"Operational overhead",{"type":40,"tag":112,"props":2581,"children":2582},{},[2583],{"type":46,"value":2584},"Zero",{"type":40,"tag":112,"props":2586,"children":2587},{},[2588],{"type":46,"value":2584},{"type":40,"tag":112,"props":2590,"children":2591},{},[2592],{"type":46,"value":2593},"Backups, patching, failover",{"type":40,"tag":85,"props":2595,"children":2596},{},[2597,2602,2607,2611],{"type":40,"tag":112,"props":2598,"children":2599},{},[2600],{"type":46,"value":2601},"Capacity limit",{"type":40,"tag":112,"props":2603,"children":2604},{},[2605],{"type":46,"value":2606},"Unlimited",{"type":40,"tag":112,"props":2608,"children":2609},{},[2610],{"type":46,"value":2606},{"type":40,"tag":112,"props":2612,"children":2613},{},[2614],{"type":46,"value":2615},"Requires resharding",{"type":40,"tag":49,"props":2617,"children":2618},{},[2619,2624],{"type":40,"tag":55,"props":2620,"children":2621},{},[2622],{"type":46,"value":2623},"S3-as-database fits when:",{"type":46,"value":2625}," 20-200ms write latency is acceptable, data is large (TB+), reads are sequential scans (not point lookups), durability matters more than latency, or you want zero ops overhead.",{"type":40,"tag":49,"props":2627,"children":2628},{},[2629,2634],{"type":40,"tag":55,"props":2630,"children":2631},{},[2632],{"type":46,"value":2633},"Use a traditional database when:",{"type":46,"value":2635}," you need sub-ms latency, high-frequency point reads\u002Fwrites on one key, complex indexed queries, or CAS throughput above ~75 op\u002Fs per key.",{"type":40,"tag":70,"props":2637,"children":2639},{"id":2638},"anti-patterns",[2640],{"type":46,"value":2641},"Anti-Patterns",{"type":40,"tag":279,"props":2643,"children":2645},{"className":281,"code":2644,"language":283,"meta":284,"style":284},"\u002F\u002F Dangerous: read-modify-write WITHOUT IfMatch -- concurrent writers clobber each other\nconst data = await s3.getObject({ Bucket: \"state\", Key: \"config.json\" });\nconst config = JSON.parse(await data.Body.transformToString());\nconfig.setting = \"new-value\";\nawait s3.putObject({ Bucket: \"state\", Key: \"config.json\", Body: JSON.stringify(config) });\n\n\u002F\u002F Dangerous: log append WITHOUT IfNoneMatch -- two writers claim the same sequence number\nawait s3.putObject({ Bucket: \"log\", Key: `_log\u002F0000000005.json`, Body: JSON.stringify(entry) });\n\n\u002F\u002F Dangerous: conditional write WITHOUT retry -- throwing on 412 is not handling it; re-read and retry\ntry {\n  await s3.putObject({ Bucket: \"state\", Key: \"config.json\", Body: newConfig, IfMatch: etag });\n} catch (err) {\n  if (err.$metadata?.httpStatusCode === 412) throw err; \u002F\u002F wrong: must re-read and retry\n}\n",[2646],{"type":40,"tag":139,"props":2647,"children":2648},{"__ignoreMap":284},[2649,2657,2757,2823,2861,2974,2983,2991,3105,3112,3120,3131,3248,3267,3328],{"type":40,"tag":290,"props":2650,"children":2651},{"class":292,"line":27},[2652],{"type":40,"tag":290,"props":2653,"children":2654},{"style":296},[2655],{"type":46,"value":2656},"\u002F\u002F Dangerous: read-modify-write WITHOUT IfMatch -- concurrent writers clobber each other\n",{"type":40,"tag":290,"props":2658,"children":2659},{"class":292,"line":302},[2660,2665,2670,2675,2679,2683,2687,2691,2695,2699,2703,2707,2711,2716,2720,2724,2728,2732,2736,2741,2745,2749,2753],{"type":40,"tag":290,"props":2661,"children":2662},{"style":794},[2663],{"type":46,"value":2664},"const",{"type":40,"tag":290,"props":2666,"children":2667},{"style":326},[2668],{"type":46,"value":2669}," data ",{"type":40,"tag":290,"props":2671,"children":2672},{"style":312},[2673],{"type":46,"value":2674},"=",{"type":40,"tag":290,"props":2676,"children":2677},{"style":306},[2678],{"type":46,"value":1053},{"type":40,"tag":290,"props":2680,"children":2681},{"style":326},[2682],{"type":46,"value":329},{"type":40,"tag":290,"props":2684,"children":2685},{"style":312},[2686],{"type":46,"value":68},{"type":40,"tag":290,"props":2688,"children":2689},{"style":336},[2690],{"type":46,"value":1066},{"type":40,"tag":290,"props":2692,"children":2693},{"style":326},[2694],{"type":46,"value":345},{"type":40,"tag":290,"props":2696,"children":2697},{"style":312},[2698],{"type":46,"value":1075},{"type":40,"tag":290,"props":2700,"children":2701},{"style":342},[2702],{"type":46,"value":1080},{"type":40,"tag":290,"props":2704,"children":2705},{"style":312},[2706],{"type":46,"value":364},{"type":40,"tag":290,"props":2708,"children":2709},{"style":312},[2710],{"type":46,"value":369},{"type":40,"tag":290,"props":2712,"children":2713},{"style":372},[2714],{"type":46,"value":2715},"state",{"type":40,"tag":290,"props":2717,"children":2718},{"style":312},[2719],{"type":46,"value":380},{"type":40,"tag":290,"props":2721,"children":2722},{"style":312},[2723],{"type":46,"value":447},{"type":40,"tag":290,"props":2725,"children":2726},{"style":342},[2727],{"type":46,"value":1098},{"type":40,"tag":290,"props":2729,"children":2730},{"style":312},[2731],{"type":46,"value":364},{"type":40,"tag":290,"props":2733,"children":2734},{"style":312},[2735],{"type":46,"value":369},{"type":40,"tag":290,"props":2737,"children":2738},{"style":372},[2739],{"type":46,"value":2740},"config.json",{"type":40,"tag":290,"props":2742,"children":2743},{"style":312},[2744],{"type":46,"value":380},{"type":40,"tag":290,"props":2746,"children":2747},{"style":312},[2748],{"type":46,"value":1112},{"type":40,"tag":290,"props":2750,"children":2751},{"style":326},[2752],{"type":46,"value":465},{"type":40,"tag":290,"props":2754,"children":2755},{"style":312},[2756],{"type":46,"value":581},{"type":40,"tag":290,"props":2758,"children":2759},{"class":292,"line":23},[2760,2764,2769,2773,2777,2781,2785,2789,2793,2798,2802,2806,2810,2814,2819],{"type":40,"tag":290,"props":2761,"children":2762},{"style":794},[2763],{"type":46,"value":2664},{"type":40,"tag":290,"props":2765,"children":2766},{"style":326},[2767],{"type":46,"value":2768}," config ",{"type":40,"tag":290,"props":2770,"children":2771},{"style":312},[2772],{"type":46,"value":2674},{"type":40,"tag":290,"props":2774,"children":2775},{"style":326},[2776],{"type":46,"value":502},{"type":40,"tag":290,"props":2778,"children":2779},{"style":312},[2780],{"type":46,"value":68},{"type":40,"tag":290,"props":2782,"children":2783},{"style":336},[2784],{"type":46,"value":1182},{"type":40,"tag":290,"props":2786,"children":2787},{"style":326},[2788],{"type":46,"value":345},{"type":40,"tag":290,"props":2790,"children":2791},{"style":306},[2792],{"type":46,"value":1191},{"type":40,"tag":290,"props":2794,"children":2795},{"style":326},[2796],{"type":46,"value":2797}," data",{"type":40,"tag":290,"props":2799,"children":2800},{"style":312},[2801],{"type":46,"value":68},{"type":40,"tag":290,"props":2803,"children":2804},{"style":326},[2805],{"type":46,"value":1204},{"type":40,"tag":290,"props":2807,"children":2808},{"style":312},[2809],{"type":46,"value":68},{"type":40,"tag":290,"props":2811,"children":2812},{"style":336},[2813],{"type":46,"value":1213},{"type":40,"tag":290,"props":2815,"children":2816},{"style":326},[2817],{"type":46,"value":2818},"())",{"type":40,"tag":290,"props":2820,"children":2821},{"style":312},[2822],{"type":46,"value":581},{"type":40,"tag":290,"props":2824,"children":2825},{"class":292,"line":353},[2826,2831,2835,2840,2844,2848,2853,2857],{"type":40,"tag":290,"props":2827,"children":2828},{"style":326},[2829],{"type":46,"value":2830},"config",{"type":40,"tag":290,"props":2832,"children":2833},{"style":312},[2834],{"type":46,"value":68},{"type":40,"tag":290,"props":2836,"children":2837},{"style":326},[2838],{"type":46,"value":2839},"setting ",{"type":40,"tag":290,"props":2841,"children":2842},{"style":312},[2843],{"type":46,"value":2674},{"type":40,"tag":290,"props":2845,"children":2846},{"style":312},[2847],{"type":46,"value":369},{"type":40,"tag":290,"props":2849,"children":2850},{"style":372},[2851],{"type":46,"value":2852},"new-value",{"type":40,"tag":290,"props":2854,"children":2855},{"style":312},[2856],{"type":46,"value":380},{"type":40,"tag":290,"props":2858,"children":2859},{"style":312},[2860],{"type":46,"value":581},{"type":40,"tag":290,"props":2862,"children":2863},{"class":292,"line":388},[2864,2868,2872,2876,2880,2884,2888,2892,2896,2900,2904,2908,2912,2916,2920,2924,2928,2932,2936,2941,2945,2949,2953,2957,2962,2966,2970],{"type":40,"tag":290,"props":2865,"children":2866},{"style":306},[2867],{"type":46,"value":1191},{"type":40,"tag":290,"props":2869,"children":2870},{"style":326},[2871],{"type":46,"value":329},{"type":40,"tag":290,"props":2873,"children":2874},{"style":312},[2875],{"type":46,"value":68},{"type":40,"tag":290,"props":2877,"children":2878},{"style":336},[2879],{"type":46,"value":339},{"type":40,"tag":290,"props":2881,"children":2882},{"style":326},[2883],{"type":46,"value":345},{"type":40,"tag":290,"props":2885,"children":2886},{"style":312},[2887],{"type":46,"value":1075},{"type":40,"tag":290,"props":2889,"children":2890},{"style":342},[2891],{"type":46,"value":1080},{"type":40,"tag":290,"props":2893,"children":2894},{"style":312},[2895],{"type":46,"value":364},{"type":40,"tag":290,"props":2897,"children":2898},{"style":312},[2899],{"type":46,"value":369},{"type":40,"tag":290,"props":2901,"children":2902},{"style":372},[2903],{"type":46,"value":2715},{"type":40,"tag":290,"props":2905,"children":2906},{"style":312},[2907],{"type":46,"value":380},{"type":40,"tag":290,"props":2909,"children":2910},{"style":312},[2911],{"type":46,"value":447},{"type":40,"tag":290,"props":2913,"children":2914},{"style":342},[2915],{"type":46,"value":1098},{"type":40,"tag":290,"props":2917,"children":2918},{"style":312},[2919],{"type":46,"value":364},{"type":40,"tag":290,"props":2921,"children":2922},{"style":312},[2923],{"type":46,"value":369},{"type":40,"tag":290,"props":2925,"children":2926},{"style":372},[2927],{"type":46,"value":2740},{"type":40,"tag":290,"props":2929,"children":2930},{"style":312},[2931],{"type":46,"value":380},{"type":40,"tag":290,"props":2933,"children":2934},{"style":312},[2935],{"type":46,"value":447},{"type":40,"tag":290,"props":2937,"children":2938},{"style":342},[2939],{"type":46,"value":2940}," Body",{"type":40,"tag":290,"props":2942,"children":2943},{"style":312},[2944],{"type":46,"value":364},{"type":40,"tag":290,"props":2946,"children":2947},{"style":326},[2948],{"type":46,"value":502},{"type":40,"tag":290,"props":2950,"children":2951},{"style":312},[2952],{"type":46,"value":68},{"type":40,"tag":290,"props":2954,"children":2955},{"style":336},[2956],{"type":46,"value":511},{"type":40,"tag":290,"props":2958,"children":2959},{"style":326},[2960],{"type":46,"value":2961},"(config) ",{"type":40,"tag":290,"props":2963,"children":2964},{"style":312},[2965],{"type":46,"value":470},{"type":40,"tag":290,"props":2967,"children":2968},{"style":326},[2969],{"type":46,"value":465},{"type":40,"tag":290,"props":2971,"children":2972},{"style":312},[2973],{"type":46,"value":581},{"type":40,"tag":290,"props":2975,"children":2976},{"class":292,"line":487},[2977],{"type":40,"tag":290,"props":2978,"children":2980},{"emptyLinePlaceholder":2979},true,[2981],{"type":46,"value":2982},"\n",{"type":40,"tag":290,"props":2984,"children":2985},{"class":292,"line":531},[2986],{"type":40,"tag":290,"props":2987,"children":2988},{"style":296},[2989],{"type":46,"value":2990},"\u002F\u002F Dangerous: log append WITHOUT IfNoneMatch -- two writers claim the same sequence number\n",{"type":40,"tag":290,"props":2992,"children":2993},{"class":292,"line":566},[2994,2998,3002,3006,3010,3014,3018,3022,3026,3030,3035,3039,3043,3047,3051,3055,3060,3064,3068,3072,3076,3080,3084,3088,3093,3097,3101],{"type":40,"tag":290,"props":2995,"children":2996},{"style":306},[2997],{"type":46,"value":1191},{"type":40,"tag":290,"props":2999,"children":3000},{"style":326},[3001],{"type":46,"value":329},{"type":40,"tag":290,"props":3003,"children":3004},{"style":312},[3005],{"type":46,"value":68},{"type":40,"tag":290,"props":3007,"children":3008},{"style":336},[3009],{"type":46,"value":339},{"type":40,"tag":290,"props":3011,"children":3012},{"style":326},[3013],{"type":46,"value":345},{"type":40,"tag":290,"props":3015,"children":3016},{"style":312},[3017],{"type":46,"value":1075},{"type":40,"tag":290,"props":3019,"children":3020},{"style":342},[3021],{"type":46,"value":1080},{"type":40,"tag":290,"props":3023,"children":3024},{"style":312},[3025],{"type":46,"value":364},{"type":40,"tag":290,"props":3027,"children":3028},{"style":312},[3029],{"type":46,"value":369},{"type":40,"tag":290,"props":3031,"children":3032},{"style":372},[3033],{"type":46,"value":3034},"log",{"type":40,"tag":290,"props":3036,"children":3037},{"style":312},[3038],{"type":46,"value":380},{"type":40,"tag":290,"props":3040,"children":3041},{"style":312},[3042],{"type":46,"value":447},{"type":40,"tag":290,"props":3044,"children":3045},{"style":342},[3046],{"type":46,"value":1098},{"type":40,"tag":290,"props":3048,"children":3049},{"style":312},[3050],{"type":46,"value":364},{"type":40,"tag":290,"props":3052,"children":3053},{"style":312},[3054],{"type":46,"value":403},{"type":40,"tag":290,"props":3056,"children":3057},{"style":372},[3058],{"type":46,"value":3059},"_log\u002F0000000005.json",{"type":40,"tag":290,"props":3061,"children":3062},{"style":312},[3063],{"type":46,"value":480},{"type":40,"tag":290,"props":3065,"children":3066},{"style":312},[3067],{"type":46,"value":447},{"type":40,"tag":290,"props":3069,"children":3070},{"style":342},[3071],{"type":46,"value":2940},{"type":40,"tag":290,"props":3073,"children":3074},{"style":312},[3075],{"type":46,"value":364},{"type":40,"tag":290,"props":3077,"children":3078},{"style":326},[3079],{"type":46,"value":502},{"type":40,"tag":290,"props":3081,"children":3082},{"style":312},[3083],{"type":46,"value":68},{"type":40,"tag":290,"props":3085,"children":3086},{"style":336},[3087],{"type":46,"value":511},{"type":40,"tag":290,"props":3089,"children":3090},{"style":326},[3091],{"type":46,"value":3092},"(entry) ",{"type":40,"tag":290,"props":3094,"children":3095},{"style":312},[3096],{"type":46,"value":470},{"type":40,"tag":290,"props":3098,"children":3099},{"style":326},[3100],{"type":46,"value":465},{"type":40,"tag":290,"props":3102,"children":3103},{"style":312},[3104],{"type":46,"value":581},{"type":40,"tag":290,"props":3106,"children":3107},{"class":292,"line":584},[3108],{"type":40,"tag":290,"props":3109,"children":3110},{"emptyLinePlaceholder":2979},[3111],{"type":46,"value":2982},{"type":40,"tag":290,"props":3113,"children":3114},{"class":292,"line":606},[3115],{"type":40,"tag":290,"props":3116,"children":3117},{"style":296},[3118],{"type":46,"value":3119},"\u002F\u002F Dangerous: conditional write WITHOUT retry -- throwing on 412 is not handling it; re-read and retry\n",{"type":40,"tag":290,"props":3121,"children":3122},{"class":292,"line":663},[3123,3127],{"type":40,"tag":290,"props":3124,"children":3125},{"style":306},[3126],{"type":46,"value":309},{"type":40,"tag":290,"props":3128,"children":3129},{"style":312},[3130],{"type":46,"value":315},{"type":40,"tag":290,"props":3132,"children":3133},{"class":292,"line":672},[3134,3138,3142,3146,3150,3154,3158,3162,3166,3170,3174,3178,3182,3186,3190,3194,3198,3202,3206,3210,3214,3219,3223,3228,3232,3236,3240,3244],{"type":40,"tag":290,"props":3135,"children":3136},{"style":306},[3137],{"type":46,"value":323},{"type":40,"tag":290,"props":3139,"children":3140},{"style":326},[3141],{"type":46,"value":329},{"type":40,"tag":290,"props":3143,"children":3144},{"style":312},[3145],{"type":46,"value":68},{"type":40,"tag":290,"props":3147,"children":3148},{"style":336},[3149],{"type":46,"value":339},{"type":40,"tag":290,"props":3151,"children":3152},{"style":342},[3153],{"type":46,"value":345},{"type":40,"tag":290,"props":3155,"children":3156},{"style":312},[3157],{"type":46,"value":1075},{"type":40,"tag":290,"props":3159,"children":3160},{"style":342},[3161],{"type":46,"value":1080},{"type":40,"tag":290,"props":3163,"children":3164},{"style":312},[3165],{"type":46,"value":364},{"type":40,"tag":290,"props":3167,"children":3168},{"style":312},[3169],{"type":46,"value":369},{"type":40,"tag":290,"props":3171,"children":3172},{"style":372},[3173],{"type":46,"value":2715},{"type":40,"tag":290,"props":3175,"children":3176},{"style":312},[3177],{"type":46,"value":380},{"type":40,"tag":290,"props":3179,"children":3180},{"style":312},[3181],{"type":46,"value":447},{"type":40,"tag":290,"props":3183,"children":3184},{"style":342},[3185],{"type":46,"value":1098},{"type":40,"tag":290,"props":3187,"children":3188},{"style":312},[3189],{"type":46,"value":364},{"type":40,"tag":290,"props":3191,"children":3192},{"style":312},[3193],{"type":46,"value":369},{"type":40,"tag":290,"props":3195,"children":3196},{"style":372},[3197],{"type":46,"value":2740},{"type":40,"tag":290,"props":3199,"children":3200},{"style":312},[3201],{"type":46,"value":380},{"type":40,"tag":290,"props":3203,"children":3204},{"style":312},[3205],{"type":46,"value":447},{"type":40,"tag":290,"props":3207,"children":3208},{"style":342},[3209],{"type":46,"value":2940},{"type":40,"tag":290,"props":3211,"children":3212},{"style":312},[3213],{"type":46,"value":364},{"type":40,"tag":290,"props":3215,"children":3216},{"style":326},[3217],{"type":46,"value":3218}," newConfig",{"type":40,"tag":290,"props":3220,"children":3221},{"style":312},[3222],{"type":46,"value":447},{"type":40,"tag":290,"props":3224,"children":3225},{"style":342},[3226],{"type":46,"value":3227}," IfMatch",{"type":40,"tag":290,"props":3229,"children":3230},{"style":312},[3231],{"type":46,"value":364},{"type":40,"tag":290,"props":3233,"children":3234},{"style":326},[3235],{"type":46,"value":1132},{"type":40,"tag":290,"props":3237,"children":3238},{"style":312},[3239],{"type":46,"value":1112},{"type":40,"tag":290,"props":3241,"children":3242},{"style":342},[3243],{"type":46,"value":465},{"type":40,"tag":290,"props":3245,"children":3246},{"style":312},[3247],{"type":46,"value":581},{"type":40,"tag":290,"props":3249,"children":3250},{"class":292,"line":716},[3251,3255,3259,3263],{"type":40,"tag":290,"props":3252,"children":3253},{"style":312},[3254],{"type":46,"value":470},{"type":40,"tag":290,"props":3256,"children":3257},{"style":306},[3258],{"type":46,"value":594},{"type":40,"tag":290,"props":3260,"children":3261},{"style":326},[3262],{"type":46,"value":599},{"type":40,"tag":290,"props":3264,"children":3265},{"style":312},[3266],{"type":46,"value":350},{"type":40,"tag":290,"props":3268,"children":3269},{"class":292,"line":725},[3270,3274,3278,3282,3286,3290,3294,3298,3302,3306,3310,3315,3319,3323],{"type":40,"tag":290,"props":3271,"children":3272},{"style":306},[3273],{"type":46,"value":612},{"type":40,"tag":290,"props":3275,"children":3276},{"style":342},[3277],{"type":46,"value":617},{"type":40,"tag":290,"props":3279,"children":3280},{"style":326},[3281],{"type":46,"value":622},{"type":40,"tag":290,"props":3283,"children":3284},{"style":312},[3285],{"type":46,"value":68},{"type":40,"tag":290,"props":3287,"children":3288},{"style":326},[3289],{"type":46,"value":631},{"type":40,"tag":290,"props":3291,"children":3292},{"style":312},[3293],{"type":46,"value":636},{"type":40,"tag":290,"props":3295,"children":3296},{"style":326},[3297],{"type":46,"value":641},{"type":40,"tag":290,"props":3299,"children":3300},{"style":312},[3301],{"type":46,"value":646},{"type":40,"tag":290,"props":3303,"children":3304},{"style":439},[3305],{"type":46,"value":651},{"type":40,"tag":290,"props":3307,"children":3308},{"style":342},[3309],{"type":46,"value":656},{"type":40,"tag":290,"props":3311,"children":3312},{"style":306},[3313],{"type":46,"value":3314},"throw",{"type":40,"tag":290,"props":3316,"children":3317},{"style":326},[3318],{"type":46,"value":736},{"type":40,"tag":290,"props":3320,"children":3321},{"style":312},[3322],{"type":46,"value":996},{"type":40,"tag":290,"props":3324,"children":3325},{"style":296},[3326],{"type":46,"value":3327}," \u002F\u002F wrong: must re-read and retry\n",{"type":40,"tag":290,"props":3329,"children":3330},{"class":292,"line":743},[3331],{"type":40,"tag":290,"props":3332,"children":3333},{"style":312},[3334],{"type":46,"value":749},{"type":40,"tag":70,"props":3336,"children":3338},{"id":3337},"related-traps",[3339],{"type":46,"value":3340},"Related Traps",{"type":40,"tag":3342,"props":3343,"children":3344},"ul",{},[3345,3369,3386,3396],{"type":40,"tag":212,"props":3346,"children":3347},{},[3348,3353,3355,3360,3362,3367],{"type":40,"tag":55,"props":3349,"children":3350},{},[3351],{"type":46,"value":3352},"Race Conditions",{"type":46,"value":3354}," -- S3 without conditional writes is a race condition factory. With ",{"type":40,"tag":139,"props":3356,"children":3358},{"className":3357},[],[3359],{"type":46,"value":193},{"type":46,"value":3361}," and ",{"type":40,"tag":139,"props":3363,"children":3365},{"className":3364},[],[3366],{"type":46,"value":1687},{"type":46,"value":3368},", S3 provides the same optimistic concurrency as database version columns.",{"type":40,"tag":212,"props":3370,"children":3371},{},[3372,3377,3379,3384],{"type":40,"tag":55,"props":3373,"children":3374},{},[3375],{"type":46,"value":3376},"Idempotency",{"type":46,"value":3378}," -- ",{"type":40,"tag":139,"props":3380,"children":3382},{"className":3381},[],[3383],{"type":46,"value":144},{"type":46,"value":3385}," is a natural idempotency primitive. Writing an event with a deterministic key and put-if-absent guarantees exactly-once creation.",{"type":40,"tag":212,"props":3387,"children":3388},{},[3389,3394],{"type":40,"tag":55,"props":3390,"children":3391},{},[3392],{"type":46,"value":3393},"Consistency Models",{"type":46,"value":3395}," -- S3 is strongly consistent for reads-after-writes, but LIST can lag. To \"read your writes\" immediately after a PUT, use GET (strongly consistent), not LIST.",{"type":40,"tag":212,"props":3397,"children":3398},{},[3399,3404],{"type":40,"tag":55,"props":3400,"children":3401},{},[3402],{"type":46,"value":3403},"Cardinality",{"type":46,"value":3405}," -- S3 LIST is still O(n) on the prefix. For high-cardinality key spaces, maintain a metadata index rather than listing objects.",{"type":40,"tag":3407,"props":3408,"children":3409},"style",{},[3410],{"type":46,"value":3411},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3413,"total":1331},[3414,3425,3440,3450,3462,3473,3485],{"slug":3415,"name":3415,"fn":3416,"description":3417,"org":3418,"tags":3419,"stars":23,"repoUrl":24,"updatedAt":3424},"staff-engineering-skills-backpressure","implement backpressure in streaming pipelines","Prevent unbounded resource growth when producers outpace consumers. Use when writing producer-consumer code, queue processing, batch operations, fan-out patterns, streaming pipelines, or any code where work is generated faster than it can be processed. Activates on patterns like Promise.all on dynamic-sized arrays, unbounded in-memory queues, producer loops without depth checks, fire-and-forget async calls in loops, or any buffer between a producer and consumer without a size limit.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3420,3421],{"name":14,"slug":15,"type":16},{"name":3422,"slug":3423,"type":16},"Performance","performance","2026-06-17T08:40:42.723559",{"slug":3426,"name":3426,"fn":3427,"description":3428,"org":3429,"tags":3430,"stars":23,"repoUrl":24,"updatedAt":3439},"staff-engineering-skills-cache-invalidation","implement cache invalidation strategies","Prevent stale data bugs caused by missing or incomplete cache invalidation. Use when adding caching layers (Redis, in-memory Map, CDN, HTTP cache headers), optimizing read performance, or reviewing code that caches query results, API responses, or computed values. Activates on patterns like cache.set without cache.delete on write paths, unbounded Map\u002Fobject caches, TTL-only invalidation on security-sensitive data, Cache-Control headers on mutable content, or any caching where the write path doesn't invalidate the read cache.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3431,3432,3435,3438],{"name":14,"slug":15,"type":16},{"name":3433,"slug":3434,"type":16},"Caching","caching",{"name":3436,"slug":3437,"type":16},"Engineering","engineering",{"name":3422,"slug":3423,"type":16},"2026-06-17T08:40:45.194583",{"slug":3441,"name":3441,"fn":3442,"description":3443,"org":3444,"tags":3445,"stars":23,"repoUrl":24,"updatedAt":3449},"staff-engineering-skills-cardinality","prevent cardinality traps in systems code","Detect and prevent cardinality traps in systems code. Use when writing code that iterates over collections, stores items in memory, creates per-entity resources, or fans out operations across a set of items. Activates on patterns like loops over query results, in-memory Maps\u002FSets populated from databases, or \"one X per Y\" resource allocation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3446,3447,3448],{"name":14,"slug":15,"type":16},{"name":3436,"slug":3437,"type":16},{"name":3422,"slug":3423,"type":16},"2026-06-17T08:40:40.264608",{"slug":3451,"name":3451,"fn":3452,"description":3453,"org":3454,"tags":3455,"stars":23,"repoUrl":24,"updatedAt":3461},"staff-engineering-skills-clock-skew","prevent clock skew bugs in distributed systems","Prevent bugs caused by assuming clocks are synchronized or monotonic. Use when writing code that compares timestamps across machines, measures durations, sets lock expiry, orders distributed events, deduplicates by time window, or uses Date.now() for anything other than logging or display. Activates on patterns like Date.now() used for duration measurement, absolute timestamp expiry shared across machines, wall clock timestamps for event ordering, last-write-wins conflict resolution with timestamps, or timeout calculations using wall clock time.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3456,3457,3460],{"name":14,"slug":15,"type":16},{"name":3458,"slug":3459,"type":16},"Debugging","debugging",{"name":3436,"slug":3437,"type":16},"2026-06-17T08:40:37.803541",{"slug":3463,"name":3463,"fn":3464,"description":3465,"org":3466,"tags":3467,"stars":23,"repoUrl":24,"updatedAt":3472},"staff-engineering-skills-consistency-models","manage consistency models in distributed systems","Prevent stale read bugs caused by replica lag, cache staleness, and index delay. Use when writing code that reads data after writing it, uses read replicas, caches query results, reads from search indexes, or builds event-driven read models. Activates on patterns like create-then-redirect, update-then-read, cache-aside with TTL, search-after-create, or any write followed by a read that might hit a different data source.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3468,3469,3470,3471],{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"name":3436,"slug":3437,"type":16},{"name":3422,"slug":3423,"type":16},"2026-06-17T08:40:46.442182",{"slug":3474,"name":3474,"fn":3475,"description":3476,"org":3477,"tags":3478,"stars":23,"repoUrl":24,"updatedAt":3484},"staff-engineering-skills-denormalization","prevent data model denormalization traps","Detect and prevent denormalization traps when designing data models. Use when writing code that copies fields between tables, embeds related data in documents, caches composed objects, or adds redundant columns to avoid joins. Activates on patterns like storing derived\u002Fcopied data, syncing fields across tables, or embedding nested objects in document stores.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3479,3480,3483],{"name":14,"slug":15,"type":16},{"name":3481,"slug":3482,"type":16},"Data Modeling","data-modeling",{"name":21,"slug":22,"type":16},"2026-06-17T08:40:53.835868",{"slug":3486,"name":3486,"fn":3487,"description":3488,"org":3489,"tags":3490,"stars":23,"repoUrl":24,"updatedAt":3496},"staff-engineering-skills-distributed-system-fallacies","design resilient distributed systems","Prevent failures caused by treating network calls like function calls. Use when writing code that calls external services, splits a monolith into microservices, chains multiple API calls, orchestrates distributed workflows, or handles requests that depend on other services. Activates on patterns like sequential service calls without timeouts, fetch\u002Faxios calls without error handling, multi-service writes without compensation, hardcoded service URLs, or any code that assumes the network is reliable, fast, or free.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3491,3494,3495],{"name":3492,"slug":3493,"type":16},"API Development","api-development",{"name":14,"slug":15,"type":16},{"name":3436,"slug":3437,"type":16},"2026-06-17T08:40:47.666795",{"items":3498,"total":1576},[3499,3518,3531,3541,3558,3573,3587,3604,3617,3629,3640,3645],{"slug":3500,"name":3500,"fn":3501,"description":3502,"org":3503,"tags":3504,"stars":3515,"repoUrl":3516,"updatedAt":3517},"trigger-authoring-chat-agent","author durable AI chat agents with Trigger.dev","Author and run a durable AI chat agent with chat.agent from @trigger.dev\u002Fsdk\u002Fai: the per-turn run loop, why you MUST spread ...chat.toStreamTextOptions() first, returning a StreamTextResult vs calling chat.pipe(), the two server actions (chat.createStartSessionAction + auth.createPublicToken), and wiring useChat to useTriggerChatTransport. Load this when building, modifying, or debugging a chat backend (the agent task or its lifecycle hooks) or its React transport, when declaring typed tools or custom data parts, or when migrating a plain AI SDK streamText route to chat.agent.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3505,3508,3511,3512],{"name":3506,"slug":3507,"type":16},"Agents","agents",{"name":3509,"slug":3510,"type":16},"SDK","sdk",{"name":9,"slug":8,"type":16},{"name":3513,"slug":3514,"type":16},"Workflow Automation","workflow-automation",14401,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Ftrigger.dev","2026-07-02T17:12:52.307135",{"slug":3519,"name":3519,"fn":3520,"description":3521,"org":3522,"tags":3523,"stars":3515,"repoUrl":3516,"updatedAt":3530},"trigger-authoring-tasks","author backend Trigger.dev tasks","Covers writing backend Trigger.dev tasks with @trigger.dev\u002Fsdk: defining task() and schemaTask(), the run function and its ctx, retries, waits, queues and concurrency, idempotency keys, run metadata, logging, triggering other tasks (and the Result shape), scheduled\u002Fcron tasks, and the essentials of trigger.config.ts. Load this whenever you are authoring or editing code inside a \u002Ftrigger directory, defining a task, or writing backend code that triggers tasks. Realtime\u002FReact hooks and AI chat are covered by separate skills.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3524,3527,3528,3529],{"name":3525,"slug":3526,"type":16},"Backend","backend",{"name":3509,"slug":3510,"type":16},{"name":9,"slug":8,"type":16},{"name":3513,"slug":3514,"type":16},"2026-07-02T17:12:48.396964",{"slug":3532,"name":3532,"fn":3533,"description":3534,"org":3535,"tags":3536,"stars":3515,"repoUrl":3516,"updatedAt":3540},"trigger-chat-agent-advanced","manage Trigger.dev chat sessions and transports","Advanced and operational chat.agent capabilities for Trigger.dev, loaded on demand. Load this when working on the raw Sessions primitive (sessions \u002F SessionHandle), a custom chat transport or the realtime wire protocol, durable sub-agents (AgentChat, chat.stream.writer), human-in-the-loop, steering, actions, background injection (chat.defer \u002F chat.inject), fast starts (preload, Head Start via @trigger.dev\u002Fsdk\u002Fchat-server), context resilience (compaction, recovery boot, OOM, large payloads), chat.local run-scoped state, offline testing with mockChatAgent, or prerelease\u002Fversion upgrades. For the everyday chat.agent({...}) definition and the useTriggerChatTransport happy path, use the trigger-authoring-chat-agent skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3537,3538,3539],{"name":3506,"slug":3507,"type":16},{"name":9,"slug":8,"type":16},{"name":3513,"slug":3514,"type":16},"2026-07-02T17:12:51.03018",{"slug":3542,"name":3542,"fn":3543,"description":3544,"org":3545,"tags":3546,"stars":3515,"repoUrl":3516,"updatedAt":3557},"trigger-realtime-and-frontend","subscribe to Trigger.dev runs in realtime","Trigger.dev client\u002Ffrontend surface: subscribe to runs in realtime (runs.subscribeToRun and the @trigger.dev\u002Freact-hooks hook useRealtimeRun), consume metadata and AI\u002Ftext streams in React (useRealtimeStream), trigger tasks from the browser (useTaskTrigger, useRealtimeTaskTrigger), and mint scoped frontend credentials with auth.createPublicToken \u002F auth.createTriggerPublicToken. Load when wiring a frontend (React\u002FNext.js\u002FRemix) or backend-for-frontend to show live run progress, status badges, token streams, trigger buttons, or wait-token approval UIs. NOT for writing the backend task itself (streams.define \u002F metadata.set is trigger-authoring-tasks territory); this is the consumer side.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3547,3550,3553,3556],{"name":3548,"slug":3549,"type":16},"Frontend","frontend",{"name":3551,"slug":3552,"type":16},"React","react",{"name":3554,"slug":3555,"type":16},"Real-time","real-time",{"name":9,"slug":8,"type":16},"2026-07-02T17:12:49.717706",{"slug":3559,"name":3559,"fn":3560,"description":3561,"org":3562,"tags":3563,"stars":3570,"repoUrl":3571,"updatedAt":3572},"trigger-agents","orchestrate AI agents with Trigger.dev","AI agent patterns with Trigger.dev - orchestration, parallelization, routing, evaluator-optimizer, and human-in-the-loop. Use when building LLM-powered tasks that need parallel workers, approval gates, tool calling, or multi-step agent workflows.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3564,3565,3568,3569],{"name":3506,"slug":3507,"type":16},{"name":3566,"slug":3567,"type":16},"Multi-Agent","multi-agent",{"name":9,"slug":8,"type":16},{"name":3513,"slug":3514,"type":16},30,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fskills","2026-04-06T18:54:46.023553",{"slug":3574,"name":3574,"fn":3575,"description":3576,"org":3577,"tags":3578,"stars":3570,"repoUrl":3571,"updatedAt":3586},"trigger-config","configure Trigger.dev project settings","Configure Trigger.dev projects with trigger.config.ts. Use when setting up build extensions for Prisma, Playwright, FFmpeg, Python, or customizing deployment settings.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3579,3582,3585],{"name":3580,"slug":3581,"type":16},"Configuration","configuration",{"name":3583,"slug":3584,"type":16},"Deployment","deployment",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:44.764258",{"slug":3588,"name":3588,"fn":3589,"description":3590,"org":3591,"tags":3592,"stars":3570,"repoUrl":3571,"updatedAt":3603},"trigger-cost-savings","optimize Trigger.dev task costs","Analyze Trigger.dev tasks, schedules, and runs for cost optimization opportunities. Use when asked to reduce spend, optimize costs, audit usage, right-size machines, or review task efficiency. Requires Trigger.dev MCP tools for run analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3593,3596,3599,3602],{"name":3594,"slug":3595,"type":16},"Analytics","analytics",{"name":3597,"slug":3598,"type":16},"Cost Optimization","cost-optimization",{"name":3600,"slug":3601,"type":16},"Operations","operations",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:48.555552",{"slug":3605,"name":3605,"fn":3606,"description":3607,"org":3608,"tags":3609,"stars":3570,"repoUrl":3571,"updatedAt":3616},"trigger-realtime","monitor Trigger.dev tasks in real-time","Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI\u002FLLM responses, or React components that display task status.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3610,3611,3614,3615],{"name":3548,"slug":3549,"type":16},{"name":3612,"slug":3613,"type":16},"Observability","observability",{"name":3554,"slug":3555,"type":16},{"name":9,"slug":8,"type":16},"2026-04-06T18:54:47.293822",{"slug":3618,"name":3618,"fn":3619,"description":3620,"org":3621,"tags":3622,"stars":3570,"repoUrl":3571,"updatedAt":3628},"trigger-setup","set up Trigger.dev in projects","Set up Trigger.dev in your project. Use when adding Trigger.dev for the first time, creating trigger.config.ts, or initializing the trigger directory.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3623,3624,3627],{"name":3580,"slug":3581,"type":16},{"name":3625,"slug":3626,"type":16},"Local Development","local-development",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:42.280816",{"slug":3630,"name":3630,"fn":3631,"description":3632,"org":3633,"tags":3634,"stars":3570,"repoUrl":3571,"updatedAt":3639},"trigger-tasks","build durable background tasks with Trigger.dev","Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3635,3636,3637,3638],{"name":3506,"slug":3507,"type":16},{"name":3525,"slug":3526,"type":16},{"name":9,"slug":8,"type":16},{"name":3513,"slug":3514,"type":16},"2026-04-06T18:54:43.514369",{"slug":3415,"name":3415,"fn":3416,"description":3417,"org":3641,"tags":3642,"stars":23,"repoUrl":24,"updatedAt":3424},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3643,3644],{"name":14,"slug":15,"type":16},{"name":3422,"slug":3423,"type":16},{"slug":3426,"name":3426,"fn":3427,"description":3428,"org":3646,"tags":3647,"stars":23,"repoUrl":24,"updatedAt":3439},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3648,3649,3650,3651],{"name":14,"slug":15,"type":16},{"name":3433,"slug":3434,"type":16},{"name":3436,"slug":3437,"type":16},{"name":3422,"slug":3423,"type":16}]