|
2 | 2 |
|
3 | 3 | ## Decision |
4 | 4 |
|
5 | | -A generated resource ID is the canonical decimal string for a positive value returned by a durable counter scoped to `(queue, resource type)` within an application's storage. |
| 5 | +A generated resource ID is the canonical decimal string for a positive value returned by a durable counter scoped to `(queue, domain)` within an application's storage. |
6 | 6 |
|
7 | | -SubmitQueue and Stovepipe use separate storage backends. Resource type is `request` or `batch`; there is no additional application-domain key or schema change. |
| 7 | +The counter domain names the sequence (`request` or `batch`), not the application. SubmitQueue and Stovepipe use separate storage backends; there is no additional application-domain key or schema change. |
8 | 8 |
|
9 | 9 | | Resource | Current ID | Proposed ID | Identity within the application | |
10 | 10 | |---|---:|---:|---| |
11 | 11 | | SubmitQueue request | `demo-queue/42` | `"42"` | `(demo-queue, request, "42")` | |
12 | 12 | | SubmitQueue batch | `demo-queue/batch/7` | `"7"` | `(demo-queue, batch, "7")` | |
13 | 13 | | Stovepipe request | `request/monorepo/main/42` | `"42"` | `(monorepo/main, request, "42")` | |
14 | 14 |
|
15 | | -The decimal ID is unique only within its scope. The same value may appear in another queue, resource type, or application. APIs and messages therefore carry the queue separately; their typed field or message type supplies the resource type. |
| 15 | +The decimal ID is unique only within its scope. The same value may appear in another queue, counter domain, or application. APIs and messages therefore carry the queue separately; their typed field or message type supplies the counter domain. |
16 | 16 |
|
17 | 17 | Do not embed scope into the ID. Forms such as `demo-queue/42`, `demo-queue/batch/7`, `request.42`, and ARN-like resource names are not stored or accepted as IDs. |
18 | 18 |
|
19 | 19 | ## Counter |
20 | 20 |
|
21 | | -The counter backend persists one high-water mark per `(queue, resource type)`. MySQL keeps its existing `(queue, domain)` primary key; `domain` stores the resource type. For example: |
| 21 | +The counter backend persists one high-water mark per `(queue, domain)`. MySQL keeps its existing schema and primary key. For example: |
22 | 22 |
|
23 | 23 | ```text |
24 | 24 | (demo-queue, request) -> 42 |
@@ -61,7 +61,7 @@ Both columns use the same queue prefix for comparison. The before batch/change r |
61 | 61 |
|
62 | 62 | ## Rejected alternatives |
63 | 63 |
|
64 | | -- **Queue or resource-type prefixes:** duplicate explicit context, lengthen keys, require parsing, and introduce URL separators. |
| 64 | +- **Queue or domain prefixes:** duplicate explicit context, lengthen keys, require parsing, and introduce URL separators. |
65 | 65 | - **ARN-like names:** solve global lookup, which current APIs neither provide nor require. |
66 | 66 | - **UUIDs or a global counter:** provide global uniqueness at the cost of unnecessary encoding or coordination. |
67 | 67 | - **Integer resource fields:** couple the persisted and wire contracts to the current counter representation without adding identity semantics. |
|
0 commit comments