diff --git a/content/sync.md b/content/sync.md index 8b33b93..4103694 100644 --- a/content/sync.md +++ b/content/sync.md @@ -14,6 +14,14 @@ The default store is in memory and is lost on restart. Set `SYNC_S3_BUCKET` (and Sync does not run agents, merge pull requests, or execute jobs. Workers that claim a job are what run the payload. +## Compare-and-swap + +CAS is compare-and-swap. Sync keeps JSON documents, not rows in a SQL database. Each document has an ETag, a version stamp from the last write. + +An update sends that stamp as `If-Match`. The write succeeds only if the document is still the version you read. If another worker wrote first, Sync returns `412` and you read again. + +That is how two agents can share a session or claim a job without silently overwriting each other. + ## MCP companion MCP clients should not call that HTTP API themselves. [sync-mcp](https://github.com/aixgo-dev/sync-mcp) is a stdio MCP server that wraps Sync and exposes sessions, messages and jobs as tools. diff --git a/data/sync.yaml b/data/sync.yaml index 323a000..ff33d92 100644 --- a/data/sync.yaml +++ b/data/sync.yaml @@ -16,7 +16,7 @@ hero: stats: - value: "CAS" - label: "JSON objects with If-Match / ETag" + label: "Compare-and-swap: a write is rejected if the document changed since you read it" accent: true - value: "org/project" label: "Tenant path and API-key scope" @@ -51,7 +51,7 @@ cannot: roadmap: - version: "v0.1.0" state: "done" - item: "CAS store, tenant keys, HTTP sessions, messages and jobs" + item: "Compare-and-swap store, tenant keys, HTTP sessions, messages and jobs" - version: "next" state: "progress" item: "Desired-state GET/PUT, session attach, device register" diff --git a/layouts/_default/products.html b/layouts/_default/products.html index d67d46a..9e8270b 100644 --- a/layouts/_default/products.html +++ b/layouts/_default/products.html @@ -25,13 +25,13 @@

{{ .Title }}