@radicaltools/mcp 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/{chunk-Z7THA3L5.js → chunk-KEIZXREX.js} +68 -35
- package/dist/{elkLayout-TAUBPPVN.js → elkLayout-MFJXDTJG.js} +1 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
- package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
- package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
- package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
- package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
- package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
- package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
- package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
- package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
- package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
- package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
- package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
- package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +1893 -468
- package/package.json +1 -1
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"id": "concern-data-consistency",
|
|
4
4
|
"category": "concern",
|
|
5
5
|
"name": "Data consistency",
|
|
6
|
-
"description": "How one business operation stays all-or-nothing across records, stores and services: transactions, isolation, events, sagas, and what readers may see.",
|
|
6
|
+
"description": "How one business operation stays all-or-nothing across records, stores and services: transactions, isolation, events, sagas, and what readers may see. Which element writes each table is decided in the Decomposition pack; how consumers absorb duplicates in the Messaging pack.",
|
|
7
7
|
"tags": [
|
|
8
8
|
"consistency",
|
|
9
9
|
"transactions",
|
|
10
10
|
"isolation",
|
|
11
11
|
"outbox",
|
|
12
12
|
"saga",
|
|
13
|
-
"
|
|
13
|
+
"replicas"
|
|
14
14
|
],
|
|
15
15
|
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
16
16
|
"concern": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"trigger": "LIST RELATIONS WHERE (source.type = \"container\" OR source.type = \"component\" OR source.type = \"webapp\" OR source.type = \"system\") AND source.external != true AND (target.type = \"database\" OR target.type = \"queue\") AND target.external != true",
|
|
19
19
|
"applyTo": "source",
|
|
20
20
|
"why": "these elements write to stores or queues, so how an operation that changes several records stays consistent, and what readers may see meanwhile, has to be decided.",
|
|
21
|
-
"group": "
|
|
21
|
+
"group": "architecture"
|
|
22
22
|
},
|
|
23
23
|
"sources": [
|
|
24
24
|
{
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
{
|
|
37
37
|
"title": "Jepsen: Consistency Models",
|
|
38
38
|
"url": "https://jepsen.io/consistency"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"title": "Garcia-Molina and Salem, Sagas (SIGMOD 1987)",
|
|
42
|
+
"url": "https://dl.acm.org/doi/10.1145/38713.38742"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"title": "Terry et al., Session Guarantees for Weakly Consistent Replicated Data (1994)",
|
|
46
|
+
"url": "https://ieeexplore.ieee.org/document/331722"
|
|
39
47
|
}
|
|
40
48
|
],
|
|
41
49
|
"templateParams": [
|
|
@@ -91,7 +99,7 @@
|
|
|
91
99
|
"key": "READS",
|
|
92
100
|
"title": "Reads",
|
|
93
101
|
"label": "Where are reads served from?",
|
|
94
|
-
"hint": "Replicas
|
|
102
|
+
"hint": "Replicas take load off the primary, but lag behind it: a user may not see what they just saved, or two pages may disagree. A cache in front of the store is decided in the Caching pack.",
|
|
95
103
|
"defaultValue": "primary",
|
|
96
104
|
"options": [
|
|
97
105
|
{
|
|
@@ -101,50 +109,25 @@
|
|
|
101
109
|
},
|
|
102
110
|
{
|
|
103
111
|
"value": "ryw",
|
|
104
|
-
"label": "replicas
|
|
112
|
+
"label": "replicas with read-your-writes",
|
|
105
113
|
"description": "Reads go to replicas, but a user who has just written reads from the primary or from a replica that has caught up with their write. Pick it when reads must scale and users must see their own changes at once."
|
|
106
114
|
},
|
|
107
115
|
{
|
|
108
116
|
"value": "bounded",
|
|
109
|
-
"label": "replicas
|
|
117
|
+
"label": "replicas with bounded staleness",
|
|
110
118
|
"description": "Reads may be a few seconds old, never more than a stated bound, and decisions that write are taken on the primary. Pick it for catalogues, dashboards and feeds where a few seconds do not matter."
|
|
111
119
|
}
|
|
112
120
|
]
|
|
113
121
|
},
|
|
114
|
-
{
|
|
115
|
-
"key": "OWNERSHIP",
|
|
116
|
-
"title": "Source of truth",
|
|
117
|
-
"label": "Who may write each entity?",
|
|
118
|
-
"hint": "When several elements write the same tables, every invariant has to hold in all of them, and a change of schema is a change to all of them.",
|
|
119
|
-
"defaultValue": "owner",
|
|
120
|
-
"options": [
|
|
121
|
-
{
|
|
122
|
-
"value": "owner",
|
|
123
|
-
"label": "one owning element per entity",
|
|
124
|
-
"description": "Each entity has one element that writes it; others ask its API or keep read-only copies fed by its events. Pick it for services with their own databases, and for modules of a monolith that should be separable."
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"value": "shared",
|
|
128
|
-
"label": "a database shared by several elements",
|
|
129
|
-
"description": "Several elements write the same tables. Pick it only for an existing system where splitting is not yet possible; invariants then have to live in the database itself."
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
},
|
|
133
122
|
{
|
|
134
123
|
"key": "PROPAGATION_SECONDS",
|
|
135
|
-
"label": "How many seconds may others see the old state after a commit?",
|
|
124
|
+
"label": "How many seconds may others see the old state after a commit? (the outbox relay's lag and a replica's staleness alike)",
|
|
136
125
|
"defaultValue": "5",
|
|
137
126
|
"type": "number"
|
|
138
127
|
},
|
|
139
|
-
{
|
|
140
|
-
"key": "IDEMPOTENCY_HOURS",
|
|
141
|
-
"label": "For how many hours are processed message ids remembered?",
|
|
142
|
-
"defaultValue": "72",
|
|
143
|
-
"type": "number"
|
|
144
|
-
},
|
|
145
128
|
{
|
|
146
129
|
"key": "SAGA_MINUTES",
|
|
147
|
-
"label": "Within how many minutes must a saga complete or be compensated?",
|
|
130
|
+
"label": "Within how many minutes must a saga complete or be compensated? (sagas only)",
|
|
148
131
|
"defaultValue": "15",
|
|
149
132
|
"type": "number"
|
|
150
133
|
}
|
|
@@ -159,7 +142,7 @@
|
|
|
159
142
|
"y": 0,
|
|
160
143
|
"kind": "brief",
|
|
161
144
|
"source": "Hub concern pack: Data consistency",
|
|
162
|
-
"description": "A business operation (placing an order, booking a slot, moving money) changes several records, often in more than one store or service. Whatever fails, and however many requests run at once, it must happen entirely or not at all, the rules that span records must hold, nothing may be told to others that did not happen (or be left untold), and people must see what they have just done."
|
|
145
|
+
"description": "A business operation (placing an order, booking a slot, moving money) changes several records, often in more than one store or service. Whatever fails, and however many requests run at once, it must happen entirely or not at all, the rules that span records must hold, nothing may be told to others that did not happen (or be left untold), and people must see what they have just done. The snippets assume the application under src/ (src/orders the operations, src/db the transaction helper and data sources, src/outbox the relay, src/workflows the sagas) and the tests under tests/ with their fixtures beside them."
|
|
163
146
|
},
|
|
164
147
|
{
|
|
165
148
|
"id": "req-atomic",
|
|
@@ -169,7 +152,7 @@
|
|
|
169
152
|
"y": 0,
|
|
170
153
|
"ears_type": "ubiquitous",
|
|
171
154
|
"action": "change every record of one business operation in a single database transaction, so that after a crash at any point either all of its changes are visible or none",
|
|
172
|
-
"rationale": "Atomicity of a single transaction is the simplest guarantee there is; it holds only while every record is in one database (PostgreSQL docs,
|
|
155
|
+
"rationale": "Atomicity of a single transaction is the simplest guarantee there is; it holds only while every record is in one database (PostgreSQL docs, Transaction Isolation; Jepsen consistency models).",
|
|
173
156
|
"hubWhen": {
|
|
174
157
|
"MODEL": [
|
|
175
158
|
"acid"
|
|
@@ -188,7 +171,8 @@
|
|
|
188
171
|
"rationale": "A dual write to a database and a broker loses or invents events when either fails; the transactional outbox makes the event part of the commit (microservices.io, Transactional outbox).",
|
|
189
172
|
"hubWhen": {
|
|
190
173
|
"MODEL": [
|
|
191
|
-
"outbox"
|
|
174
|
+
"outbox",
|
|
175
|
+
"saga"
|
|
192
176
|
]
|
|
193
177
|
}
|
|
194
178
|
},
|
|
@@ -223,29 +207,12 @@
|
|
|
223
207
|
]
|
|
224
208
|
}
|
|
225
209
|
},
|
|
226
|
-
{
|
|
227
|
-
"id": "req-idempotent",
|
|
228
|
-
"type": "requirement",
|
|
229
|
-
"label": "Duplicates have no effect",
|
|
230
|
-
"x": 260,
|
|
231
|
-
"y": 520,
|
|
232
|
-
"ears_type": "unwanted-behaviour",
|
|
233
|
-
"unwanted_condition": "a consumer receives a message it has already processed",
|
|
234
|
-
"action": "acknowledge it without a second effect, recognising it by its message id, which is remembered for at least {{IDEMPOTENCY_HOURS}} hours in the same transaction as the effect",
|
|
235
|
-
"rationale": "Brokers and outbox relays deliver at least once, so duplicates are normal; an idempotent consumer makes them harmless (microservices.io, Idempotent consumer).",
|
|
236
|
-
"hubWhen": {
|
|
237
|
-
"MODEL": [
|
|
238
|
-
"outbox",
|
|
239
|
-
"saga"
|
|
240
|
-
]
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
210
|
{
|
|
244
211
|
"id": "req-lost-update",
|
|
245
212
|
"type": "requirement",
|
|
246
213
|
"label": "No lost updates",
|
|
247
214
|
"x": 260,
|
|
248
|
-
"y":
|
|
215
|
+
"y": 520,
|
|
249
216
|
"ears_type": "unwanted-behaviour",
|
|
250
217
|
"unwanted_condition": "two transactions update the same record from the same version",
|
|
251
218
|
"action": "commit the first and reject the second with a conflict, by checking a version column in the UPDATE's WHERE clause or locking the row with SELECT ... FOR UPDATE",
|
|
@@ -261,7 +228,7 @@
|
|
|
261
228
|
"type": "requirement",
|
|
262
229
|
"label": "No write skew",
|
|
263
230
|
"x": 260,
|
|
264
|
-
"y":
|
|
231
|
+
"y": 650,
|
|
265
232
|
"ears_type": "unwanted-behaviour",
|
|
266
233
|
"unwanted_condition": "two concurrent transactions each read a set of rows and then write different rows of it, breaking a rule over the set",
|
|
267
234
|
"action": "enforce that rule with a database constraint (unique, exclusion or check) or by locking the rows read with SELECT ... FOR UPDATE, and retry a transaction aborted by a serialization failure up to 3 times",
|
|
@@ -277,7 +244,7 @@
|
|
|
277
244
|
"type": "requirement",
|
|
278
245
|
"label": "Serialization failures retried",
|
|
279
246
|
"x": 260,
|
|
280
|
-
"y":
|
|
247
|
+
"y": 780,
|
|
281
248
|
"ears_type": "unwanted-behaviour",
|
|
282
249
|
"unwanted_condition": "a transaction fails with a serialization failure (SQLSTATE 40001) or a deadlock (40P01)",
|
|
283
250
|
"action": "retry it from the start up to 3 times with jittered backoff, and report a conflict to the caller only after the last attempt fails",
|
|
@@ -293,7 +260,7 @@
|
|
|
293
260
|
"type": "requirement",
|
|
294
261
|
"label": "Reads see every commit",
|
|
295
262
|
"x": 260,
|
|
296
|
-
"y":
|
|
263
|
+
"y": 910,
|
|
297
264
|
"ears_type": "ubiquitous",
|
|
298
265
|
"action": "serve every read from the primary, so that a read started after a commit returns that commit",
|
|
299
266
|
"rationale": "Reading from the primary gives linearizable reads for a single-leader database without further design (Jepsen: consistency models).",
|
|
@@ -308,7 +275,7 @@
|
|
|
308
275
|
"type": "requirement",
|
|
309
276
|
"label": "Users see their own writes",
|
|
310
277
|
"x": 260,
|
|
311
|
-
"y":
|
|
278
|
+
"y": 1040,
|
|
312
279
|
"ears_type": "event-driven",
|
|
313
280
|
"trigger": "a user who has written within the last {{PROPAGATION_SECONDS}} seconds reads",
|
|
314
281
|
"action": "serve the read from the primary, or from a replica that has replayed at least the position of the user's last commit (LSN or GTID)",
|
|
@@ -324,9 +291,9 @@
|
|
|
324
291
|
"type": "requirement",
|
|
325
292
|
"label": "Staleness bounded",
|
|
326
293
|
"x": 260,
|
|
327
|
-
"y":
|
|
294
|
+
"y": 1170,
|
|
328
295
|
"ears_type": "state-driven",
|
|
329
|
-
"precondition": "
|
|
296
|
+
"precondition": "a read is served from a replica or a cache",
|
|
330
297
|
"action": "return data no older than {{PROPAGATION_SECONDS}} seconds, stop routing reads to a replica that lags more, and take every decision that writes on the primary",
|
|
331
298
|
"rationale": "Bounded staleness keeps the gain of replicas while capping how wrong a reader can be (Jepsen: consistency models); decisions on stale data cause lost updates.",
|
|
332
299
|
"hubWhen": {
|
|
@@ -335,36 +302,6 @@
|
|
|
335
302
|
]
|
|
336
303
|
}
|
|
337
304
|
},
|
|
338
|
-
{
|
|
339
|
-
"id": "req-owner",
|
|
340
|
-
"type": "requirement",
|
|
341
|
-
"label": "One writer per entity",
|
|
342
|
-
"x": 260,
|
|
343
|
-
"y": 1430,
|
|
344
|
-
"ears_type": "ubiquitous",
|
|
345
|
-
"action": "let only the owning element write each entity's records, enforced by database roles, and let other elements read it through the owner's API or keep read-only copies fed by its events",
|
|
346
|
-
"rationale": "A single source of truth per entity keeps every invariant in one place (microservices.io, Database per service).",
|
|
347
|
-
"hubWhen": {
|
|
348
|
-
"OWNERSHIP": [
|
|
349
|
-
"owner"
|
|
350
|
-
]
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"id": "req-shared",
|
|
355
|
-
"type": "requirement",
|
|
356
|
-
"label": "Shared tables guarded",
|
|
357
|
-
"x": 260,
|
|
358
|
-
"y": 1560,
|
|
359
|
-
"ears_type": "ubiquitous",
|
|
360
|
-
"action": "enforce every invariant of a table that several elements write with database constraints (primary and foreign keys, unique, check, exclusion), and list for each such table the elements that write it",
|
|
361
|
-
"rationale": "Application code in several elements cannot keep a rule consistently; the database is the only place all writers pass (PostgreSQL docs, Constraints).",
|
|
362
|
-
"hubWhen": {
|
|
363
|
-
"OWNERSHIP": [
|
|
364
|
-
"shared"
|
|
365
|
-
]
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
305
|
{
|
|
369
306
|
"id": "sc-atomic",
|
|
370
307
|
"type": "scenario",
|
|
@@ -391,7 +328,8 @@
|
|
|
391
328
|
"then": "the first order's event is published within {{PROPAGATION_SECONDS}} seconds of the broker's return; the second has no event",
|
|
392
329
|
"hubWhen": {
|
|
393
330
|
"MODEL": [
|
|
394
|
-
"outbox"
|
|
331
|
+
"outbox",
|
|
332
|
+
"saga"
|
|
395
333
|
]
|
|
396
334
|
}
|
|
397
335
|
},
|
|
@@ -425,28 +363,12 @@
|
|
|
425
363
|
]
|
|
426
364
|
}
|
|
427
365
|
},
|
|
428
|
-
{
|
|
429
|
-
"id": "sc-idempotent",
|
|
430
|
-
"type": "scenario",
|
|
431
|
-
"label": "Message delivered twice",
|
|
432
|
-
"x": 520,
|
|
433
|
-
"y": 520,
|
|
434
|
-
"given": "an OrderPlaced message already processed",
|
|
435
|
-
"when": "it is delivered again an hour later",
|
|
436
|
-
"then": "it is acknowledged and nothing is charged, reserved or sent a second time",
|
|
437
|
-
"hubWhen": {
|
|
438
|
-
"MODEL": [
|
|
439
|
-
"outbox",
|
|
440
|
-
"saga"
|
|
441
|
-
]
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
366
|
{
|
|
445
367
|
"id": "sc-lost-update",
|
|
446
368
|
"type": "scenario",
|
|
447
369
|
"label": "Concurrent edits",
|
|
448
370
|
"x": 520,
|
|
449
|
-
"y":
|
|
371
|
+
"y": 520,
|
|
450
372
|
"given": "two users editing the same order at version 7",
|
|
451
373
|
"when": "both save",
|
|
452
374
|
"then": "one save succeeds and the other gets a conflict with the current version",
|
|
@@ -461,7 +383,7 @@
|
|
|
461
383
|
"type": "scenario",
|
|
462
384
|
"label": "Double booking prevented",
|
|
463
385
|
"x": 520,
|
|
464
|
-
"y":
|
|
386
|
+
"y": 650,
|
|
465
387
|
"given": "one free slot",
|
|
466
388
|
"when": "two customers book it at the same moment",
|
|
467
389
|
"then": "exactly one booking is stored",
|
|
@@ -476,7 +398,7 @@
|
|
|
476
398
|
"type": "scenario",
|
|
477
399
|
"label": "Conflict retried",
|
|
478
400
|
"x": 520,
|
|
479
|
-
"y":
|
|
401
|
+
"y": 780,
|
|
480
402
|
"given": "two transfers from the same account running at once",
|
|
481
403
|
"when": "one is aborted with SQLSTATE 40001",
|
|
482
404
|
"then": "it is retried and succeeds, and the balance is never negative",
|
|
@@ -491,7 +413,7 @@
|
|
|
491
413
|
"type": "scenario",
|
|
492
414
|
"label": "Saved and seen",
|
|
493
415
|
"x": 520,
|
|
494
|
-
"y":
|
|
416
|
+
"y": 910,
|
|
495
417
|
"given": "a user who has just saved an address",
|
|
496
418
|
"when": "the next page loads",
|
|
497
419
|
"then": "it shows the new address",
|
|
@@ -506,7 +428,7 @@
|
|
|
506
428
|
"type": "scenario",
|
|
507
429
|
"label": "Own change visible",
|
|
508
430
|
"x": 520,
|
|
509
|
-
"y":
|
|
431
|
+
"y": 1040,
|
|
510
432
|
"given": "replicas lagging 3 seconds behind",
|
|
511
433
|
"when": "a user saves an address and reloads at once",
|
|
512
434
|
"then": "the reload shows the new address",
|
|
@@ -521,7 +443,7 @@
|
|
|
521
443
|
"type": "scenario",
|
|
522
444
|
"label": "Lagging replica dropped",
|
|
523
445
|
"x": 520,
|
|
524
|
-
"y":
|
|
446
|
+
"y": 1170,
|
|
525
447
|
"given": "a replica whose lag grows past {{PROPAGATION_SECONDS}} seconds",
|
|
526
448
|
"when": "reads arrive",
|
|
527
449
|
"then": "they go to the primary or another replica until it catches up",
|
|
@@ -531,36 +453,6 @@
|
|
|
531
453
|
]
|
|
532
454
|
}
|
|
533
455
|
},
|
|
534
|
-
{
|
|
535
|
-
"id": "sc-owner",
|
|
536
|
-
"type": "scenario",
|
|
537
|
-
"label": "Other writer refused",
|
|
538
|
-
"x": 520,
|
|
539
|
-
"y": 1430,
|
|
540
|
-
"given": "the orders table owned by the order service",
|
|
541
|
-
"when": "the inventory service tries to update an order",
|
|
542
|
-
"then": "the database refuses the write",
|
|
543
|
-
"hubWhen": {
|
|
544
|
-
"OWNERSHIP": [
|
|
545
|
-
"owner"
|
|
546
|
-
]
|
|
547
|
-
}
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
"id": "sc-shared",
|
|
551
|
-
"type": "scenario",
|
|
552
|
-
"label": "Constraint holds",
|
|
553
|
-
"x": 520,
|
|
554
|
-
"y": 1560,
|
|
555
|
-
"given": "two services writing order lines",
|
|
556
|
-
"when": "one inserts a line for an order that does not exist",
|
|
557
|
-
"then": "the database refuses it",
|
|
558
|
-
"hubWhen": {
|
|
559
|
-
"OWNERSHIP": [
|
|
560
|
-
"shared"
|
|
561
|
-
]
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
456
|
{
|
|
565
457
|
"id": "adr-acid",
|
|
566
458
|
"type": "adr",
|
|
@@ -571,7 +463,7 @@
|
|
|
571
463
|
"status": "accepted",
|
|
572
464
|
"date": "",
|
|
573
465
|
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
574
|
-
"decision": "Each business operation runs in one database transaction (PostgreSQL, MySQL InnoDB or SQL Server), opened and committed by one unit of work at the application's edge: Spring @Transactional, EF Core SaveChanges, Prisma $transaction or a hand-written withTransaction. No call to another service or broker happens inside it. Isolation: {{ISOLATION}}. Reads: {{READS}}.
|
|
466
|
+
"decision": "Each business operation runs in one database transaction (PostgreSQL, MySQL InnoDB or SQL Server), opened and committed by one unit of work at the application's edge: Spring @Transactional, EF Core SaveChanges, Prisma $transaction or a hand-written withTransaction. No call to another service or broker happens inside it. Isolation: {{ISOLATION}}. Reads: {{READS}}. Which element writes each table is decided in the Decomposition pack. Rules that span rows are database constraints where SQL can state them.",
|
|
575
467
|
"consequences": "• All-or-nothing comes from the database, with no extra machinery.\n• Every record the operation changes must stay in that database: splitting it into services later means revisiting this decision.\n• Long transactions hold locks: work that is slow or calls out happens before or after, not inside.\n• Nothing outside the database learns of the change atomically; once events are needed, an outbox is.",
|
|
576
468
|
"alternatives": "1. A transactional outbox: the same transaction plus reliable events for others.\n2. A saga: when the data is spread over services.\n3. Distributed transactions (XA, two-phase commit): atomic across stores, but blocking, rarely supported by brokers and cloud services.",
|
|
577
469
|
"hubWhen": {
|
|
@@ -590,8 +482,8 @@
|
|
|
590
482
|
"status": "accepted",
|
|
591
483
|
"date": "",
|
|
592
484
|
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
593
|
-
"decision": "State changes and the events that announce them are written in one local transaction: the event goes to an outbox table, and a relay publishes it to the broker within {{PROPAGATION_SECONDS}} seconds, then marks it sent. The relay is change data capture with Debezium (its outbox event router) when Kafka Connect is already run, otherwise a polling publisher, or the framework's outbox (Spring Modulith event publication registry, MassTransit or NServiceBus outbox). Nothing publishes to the broker directly.
|
|
594
|
-
"consequences": "• No lost or invented events: an event exists if and only if its change committed.\n• Delivery is at least once, so every consumer must be idempotent.\n• Others see the change up to {{PROPAGATION_SECONDS}} seconds later; the relay's lag must be watched.\n• The outbox table needs cleaning up, and event order holds only per aggregate key.",
|
|
485
|
+
"decision": "State changes and the events that announce them are written in one local transaction: the event goes to an outbox table, and a relay publishes it to the broker within {{PROPAGATION_SECONDS}} seconds, then marks it sent. The relay is change data capture with Debezium (its outbox event router) when Kafka Connect is already run, otherwise a polling publisher, or the framework's outbox (Spring Modulith event publication registry, MassTransit or NServiceBus outbox). Nothing publishes to the broker directly. Delivery is at least once; consumers absorb duplicates as decided in the Messaging pack. Isolation: {{ISOLATION}}. Reads: {{READS}}. Which element writes each table is decided in the Decomposition pack.",
|
|
486
|
+
"consequences": "• No lost or invented events: an event exists if and only if its change committed.\n• Delivery is at least once, so every consumer must be idempotent (the Messaging pack decides how).\n• Others see the change up to {{PROPAGATION_SECONDS}} seconds later; the relay's lag must be watched.\n• The outbox table needs cleaning up, and event order holds only per aggregate key.",
|
|
595
487
|
"alternatives": "1. Publish after commit (dual write): simpler, but a crash between commit and publish loses the event.\n2. Event sourcing: the events are the state, which removes the dual write but changes the whole persistence model.\n3. Two-phase commit between database and broker: blocking and seldom supported.",
|
|
596
488
|
"hubWhen": {
|
|
597
489
|
"MODEL": [
|
|
@@ -609,7 +501,7 @@
|
|
|
609
501
|
"status": "accepted",
|
|
610
502
|
"date": "",
|
|
611
503
|
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
612
|
-
"decision": "An operation that changes data in several services runs as an orchestrated saga: each step a local transaction in its own service, each with a compensating step, the saga's state durable so it resumes after a restart. The orchestrator is Temporal, AWS Step Functions, Camunda 8 or MassTransit state machines: Temporal when the team writes workflows in code and runs it itself or on Temporal Cloud, Step Functions on AWS for few steps and managed operation, Camunda when business owners read and change BPMN. Choreography by events only for two or three steps. Records the saga changes stay pending until it completes; a saga not done within {{SAGA_MINUTES}} minutes is compensated.
|
|
504
|
+
"decision": "An operation that changes data in several services runs as an orchestrated saga: each step a local transaction in its own service, each with a compensating step, the saga's state durable so it resumes after a restart. The orchestrator is Temporal, AWS Step Functions, Camunda 8 or MassTransit state machines: Temporal when the team writes workflows in code and runs it itself or on Temporal Cloud, Step Functions on AWS for few steps and managed operation, Camunda when business owners read and change BPMN. Choreography by events only for two or three steps. Records the saga changes stay pending until it completes; a saga not done within {{SAGA_MINUTES}} minutes is compensated. The orchestrator calls each step over its own durable queue; each step's own state change and the events it emits go through that service's transactional outbox, and consumers absorb duplicates as decided in the Messaging pack. Isolation of each local transaction: {{ISOLATION}}. Reads: {{READS}}. Which element writes each table is decided in the Decomposition pack.",
|
|
613
505
|
"consequences": "• Each service keeps its own database and its own transactions.\n• No isolation between sagas: others see pending states, and the design has to say what they may do with them.\n• Every step needs a compensating step that cannot fail for good, which is real design work (refunds, releases, cancellation notices).\n• An orchestrator is one more system to run and to keep available.",
|
|
614
506
|
"alternatives": "1. Put the data in one database and use one transaction: simpler, if the service boundaries allow.\n2. Distributed transactions (XA, two-phase commit): atomic but blocking, and rarely available across services and SaaS APIs.\n3. Choreography without an orchestrator: no central component, but the flow is hard to see and to change past three steps.",
|
|
615
507
|
"hubWhen": {
|
|
@@ -618,25 +510,181 @@
|
|
|
618
510
|
]
|
|
619
511
|
}
|
|
620
512
|
},
|
|
513
|
+
{
|
|
514
|
+
"id": "adr-read-committed",
|
|
515
|
+
"type": "adr",
|
|
516
|
+
"label": "Read Committed with version checks",
|
|
517
|
+
"x": 780,
|
|
518
|
+
"y": 390,
|
|
519
|
+
"concern": "data-consistency",
|
|
520
|
+
"status": "accepted",
|
|
521
|
+
"date": "",
|
|
522
|
+
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
523
|
+
"decision": "Transactions run at Read Committed, the database's default. Every read-modify-write carries a version column checked in the UPDATE's WHERE clause (optimistic locking: JPA @Version, EF Core concurrency tokens, Prisma or a hand-written version = $expected), or locks the row with SELECT ... FOR UPDATE where the write always follows the read; a conflict is reported to the caller with the current version. Rules over several rows are database constraints.",
|
|
524
|
+
"consequences": "• The cheapest level: no serialization aborts, no retry loop in every transaction.\n• Every read-modify-write must remember its version or lock: one forgotten is a lost update.\n• Rules that span rows cannot be enforced by the level and need a constraint or an explicit lock.",
|
|
525
|
+
"alternatives": "1. Repeatable Read (snapshot isolation): consistent multi-row reads, write skew remains.\n2. Serializable: no anomalies, at the cost of aborts and retries.",
|
|
526
|
+
"hubWhen": {
|
|
527
|
+
"ISOLATION": [
|
|
528
|
+
"read-committed"
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"id": "adr-snapshot",
|
|
534
|
+
"type": "adr",
|
|
535
|
+
"label": "Repeatable Read (snapshot isolation)",
|
|
536
|
+
"x": 780,
|
|
537
|
+
"y": 520,
|
|
538
|
+
"concern": "data-consistency",
|
|
539
|
+
"status": "accepted",
|
|
540
|
+
"date": "",
|
|
541
|
+
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
542
|
+
"decision": "Transactions run at Repeatable Read (PostgreSQL snapshot isolation, SQL Server SNAPSHOT), so each sees one consistent snapshot and a concurrent update of the same row aborts one of them, which is retried up to 3 times. Rules over a set of rows (one booking per slot, a balance never negative) are enforced with a unique, exclusion or check constraint, or by locking the rows read with SELECT ... FOR UPDATE, because snapshot isolation allows write skew.",
|
|
543
|
+
"consequences": "• Reports and multi-row reads are consistent without locks.\n• Every cross-row rule needs a constraint or a lock: the level does not protect it.\n• Concurrent updates of the same row abort: a retry loop is needed where that is common.\n• Long snapshots hold back vacuum in PostgreSQL: keep transactions short.",
|
|
544
|
+
"alternatives": "1. Read Committed with version checks: cheaper, no consistent multi-row reads.\n2. Serializable: write skew is caught by the database, with more aborts.",
|
|
545
|
+
"hubWhen": {
|
|
546
|
+
"ISOLATION": [
|
|
547
|
+
"snapshot"
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"id": "adr-serializable",
|
|
553
|
+
"type": "adr",
|
|
554
|
+
"label": "Serializable",
|
|
555
|
+
"x": 780,
|
|
556
|
+
"y": 650,
|
|
557
|
+
"concern": "data-consistency",
|
|
558
|
+
"status": "accepted",
|
|
559
|
+
"date": "",
|
|
560
|
+
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
561
|
+
"decision": "Transactions run at Serializable (PostgreSQL SSI, CockroachDB, Spanner), so the database guarantees the effect of some serial order and aborts a transaction that would break it. Every transaction is wrapped in one retry helper that retries a serialization failure (SQLSTATE 40001) or deadlock (40P01) up to 3 times with jittered backoff and reports a conflict only after the last attempt; the helper is the only way to open a transaction. Transactions stay short and touch few rows, so aborts stay rare.",
|
|
562
|
+
"consequences": "• Invariants that span rows hold without a constraint or lock for each.\n• A retry rate to watch: above a few percent, p99 latency rises and the hot rows need redesign.\n• Every transaction must be safe to run again from the start: no side effects before the commit.\n• PostgreSQL SSI costs memory for predicate locks on large scans.",
|
|
563
|
+
"alternatives": "1. Repeatable Read with constraints: fewer aborts, every cross-row rule stated by hand.\n2. Read Committed with version checks: cheapest, protects single rows only.",
|
|
564
|
+
"hubWhen": {
|
|
565
|
+
"ISOLATION": [
|
|
566
|
+
"serializable"
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"id": "adr-reads-primary",
|
|
572
|
+
"type": "adr",
|
|
573
|
+
"label": "Reads from the primary only",
|
|
574
|
+
"x": 780,
|
|
575
|
+
"y": 780,
|
|
576
|
+
"concern": "data-consistency",
|
|
577
|
+
"status": "accepted",
|
|
578
|
+
"date": "",
|
|
579
|
+
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
580
|
+
"decision": "Every read is served from the primary; no read replica stands between the application and committed data; a cache in front of the store is decided in the Caching pack and, with this decision, removes an entry when its data changes (deletion by the writer or by change events). The application configures one connection pool and no read-only data source. Replicas, if any exist, serve backups and analytics only. Revisit when the primary's read load passes 60% of its capacity for a week.",
|
|
581
|
+
"consequences": "• A read after a commit always returns it: no session guarantees to build.\n• The primary carries every read: vertical scaling and query tuning are the levers.\n• No replica routing to get wrong.",
|
|
582
|
+
"alternatives": "1. Replicas with read-your-writes: reads scale, users still see their own changes.\n2. Replicas with bounded staleness: the most scale, a stated staleness for everyone.",
|
|
583
|
+
"hubWhen": {
|
|
584
|
+
"READS": [
|
|
585
|
+
"primary"
|
|
586
|
+
]
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"id": "adr-ryw",
|
|
591
|
+
"type": "adr",
|
|
592
|
+
"label": "Replicas with read-your-writes",
|
|
593
|
+
"x": 780,
|
|
594
|
+
"y": 910,
|
|
595
|
+
"concern": "data-consistency",
|
|
596
|
+
"status": "accepted",
|
|
597
|
+
"date": "",
|
|
598
|
+
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
599
|
+
"decision": "Reads go to replicas through a router (the framework's read/write splitting, pgpool, ProxySQL or application code) that keeps, per user session, the position of their last commit (PostgreSQL LSN, MySQL GTID); a read within {{PROPAGATION_SECONDS}} seconds of that commit goes to the primary, or to a replica that has replayed past the position. A replica lagging more than {{PROPAGATION_SECONDS}} seconds is taken out of rotation.",
|
|
600
|
+
"consequences": "• Reads scale with replicas and users see what they just saved.\n• The router is on every request and has to carry the session's position (a cookie or token claim).\n• Other users still see changes late, up to the replica lag.\n• A replica's lag is an alert and a routing signal at once.",
|
|
601
|
+
"alternatives": "1. The primary only: no router, no lag, less scale.\n2. Bounded staleness for everyone: simpler router, and a user may miss their own write for a few seconds.",
|
|
602
|
+
"hubWhen": {
|
|
603
|
+
"READS": [
|
|
604
|
+
"ryw"
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"id": "adr-bounded",
|
|
610
|
+
"type": "adr",
|
|
611
|
+
"label": "Replicas with bounded staleness",
|
|
612
|
+
"x": 780,
|
|
613
|
+
"y": 1040,
|
|
614
|
+
"concern": "data-consistency",
|
|
615
|
+
"status": "accepted",
|
|
616
|
+
"date": "",
|
|
617
|
+
"context": "This element writes to stores and queues, and one business operation often changes several records, sometimes in several stores or services. The forces: a crash between two writes leaves half an operation behind; writing to a database and then to a broker (a dual write) loses or invents events when either fails; concurrent transactions at the default isolation level lose updates and break invariants that span rows; brokers deliver at least once, so every message may come twice; replicas and caches lag, so a user may not see what they just saved; and when several elements write the same data, nobody knows which copy is the truth.",
|
|
618
|
+
"decision": "Reads are served from replicas and caches and may be up to {{PROPAGATION_SECONDS}} seconds old; the router takes a replica out of rotation when its lag passes that bound, and cache entries are removed or expire within it, as the Caching pack decides. Every decision that writes (a stock check before a reservation, a balance before a transfer) is taken on the primary inside the writing transaction, never on a replica or cache read.",
|
|
619
|
+
"consequences": "• The most read scale, with a staleness the product can state.\n• A user may not see their own change for a few seconds: the interface has to cope (optimistic updates, a \"saving\" state).\n• Any write that trusts a replica read is a lost update waiting to happen: the primary-only rule for decisions needs a review check.\n• A cache entry is wrong until it is removed or expires; which of the two bounds it is the Caching pack's decision, and its expiry must fit within the same bound.",
|
|
620
|
+
"alternatives": "1. Replicas with read-your-writes: users see their own changes, at the cost of a session-aware router.\n2. The primary only: no staleness, no scale from replicas.",
|
|
621
|
+
"hubWhen": {
|
|
622
|
+
"READS": [
|
|
623
|
+
"bounded"
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
},
|
|
621
627
|
{
|
|
622
628
|
"id": "ff-concurrency",
|
|
623
629
|
"type": "fitness-fn",
|
|
624
630
|
"label": "Invariants hold under concurrency",
|
|
625
631
|
"x": 1040,
|
|
626
632
|
"y": 0,
|
|
627
|
-
"
|
|
628
|
-
"
|
|
629
|
-
"
|
|
633
|
+
"characteristic": "functional-suitability",
|
|
634
|
+
"scope": "atomic",
|
|
635
|
+
"cadence": "triggered",
|
|
636
|
+
"trigger": "pull-request",
|
|
637
|
+
"invocation": "automated",
|
|
638
|
+
"description": "An integration test runs many concurrent operations that compete for the same records against the real database engine (not an in-memory fake), at the isolation level and with the retries of the decision, and checks the invariant afterwards.\n\nThreshold: 0 lost updates or broken invariants in 1,000 concurrent attempts against a real database at the chosen isolation level\n\nTool: Vitest with Testcontainers (PostgreSQL)\n\n```ts\nimport { db } from './db'\nimport { placeOrder } from '../src/orders/placeOrder'\n\nit('never sells more than is in stock', async () => {\n await db.query(\"update stock set available = 10 where sku = 'A'\")\n const attempts = Array.from({ length: 1000 }, () => placeOrder({ sku: 'A', quantity: 1 }).then(() => 1, () => 0))\n const sold = (await Promise.all(attempts)).reduce((a, b) => a + b, 0)\n const { rows } = await db.query(\"select available from stock where sku = 'A'\")\n expect(sold).toBe(10)\n expect(rows[0].available).toBe(0)\n})\n```"
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"id": "ff-lost-update",
|
|
642
|
+
"type": "fitness-fn",
|
|
643
|
+
"label": "Second writer gets a conflict",
|
|
644
|
+
"x": 1040,
|
|
645
|
+
"y": 130,
|
|
646
|
+
"characteristic": "functional-suitability",
|
|
647
|
+
"scope": "atomic",
|
|
648
|
+
"cadence": "triggered",
|
|
649
|
+
"trigger": "pull-request",
|
|
650
|
+
"invocation": "automated",
|
|
651
|
+
"description": "An integration test reads one order at version 7 in two sessions, saves from both, and expects one success and one conflict that carries the current version; it runs against the real database.\n\nThreshold: Of two updates from the same version, exactly 1 commits and 1 is refused with a conflict naming the current version\n\nTool: Vitest with Testcontainers (PostgreSQL)\n\n```ts\nimport { orders } from '../src/orders/repository'\nimport { seedOrder } from './db'\n\nit('refuses the second update from the same version', async () => {\n const id = await seedOrder({ version: 7 })\n const [first, second] = await Promise.allSettled([\n orders.update(id, { note: 'first' }, { expectedVersion: 7 }),\n orders.update(id, { note: 'second' }, { expectedVersion: 7 }),\n ])\n const outcomes = [first, second].map((r) => r.status).sort()\n expect(outcomes).toEqual(['fulfilled', 'rejected'])\n const rejected = [first, second].find((r) => r.status === 'rejected') as PromiseRejectedResult\n expect(rejected.reason).toMatchObject({ name: 'ConflictError', currentVersion: 8 })\n})\n```",
|
|
652
|
+
"hubWhen": {
|
|
653
|
+
"ISOLATION": [
|
|
654
|
+
"read-committed"
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"id": "ff-serialization-retry",
|
|
660
|
+
"type": "fitness-fn",
|
|
661
|
+
"label": "Serialization failures retried",
|
|
662
|
+
"x": 1040,
|
|
663
|
+
"y": 260,
|
|
664
|
+
"characteristic": "reliability",
|
|
665
|
+
"scope": "atomic",
|
|
666
|
+
"cadence": "triggered",
|
|
667
|
+
"trigger": "pull-request",
|
|
668
|
+
"invocation": "automated",
|
|
669
|
+
"description": "A unit test gives the retry helper a transaction body that fails with 40001 twice and then succeeds, expects 3 attempts, then one that always fails and expects a conflict after 4 attempts. The helper is the only way to open a transaction, which code review keeps.\n\nThreshold: The transaction helper retries SQLSTATE 40001 and 40P01 up to 3 times and reports a conflict after the 4th failure\n\nTool: Vitest\n\n```ts\nimport { withSerializableRetry } from '../src/db/transaction'\n\nconst serializationFailure = () => Object.assign(new Error('could not serialize access'), { code: '40001' })\n\nit('retries a serialization failure and gives up after the third retry', async () => {\n let attempts = 0\n const flaky = async () => { attempts++; if (attempts < 3) throw serializationFailure(); return 'ok' }\n await expect(withSerializableRetry(flaky)).resolves.toBe('ok')\n expect(attempts).toBe(3)\n\n attempts = 0\n const hopeless = async () => { attempts++; throw serializationFailure() }\n await expect(withSerializableRetry(hopeless)).rejects.toMatchObject({ name: 'ConflictError' })\n expect(attempts).toBe(4)\n})\n```",
|
|
670
|
+
"hubWhen": {
|
|
671
|
+
"ISOLATION": [
|
|
672
|
+
"serializable"
|
|
673
|
+
]
|
|
674
|
+
}
|
|
630
675
|
},
|
|
631
676
|
{
|
|
632
677
|
"id": "ff-atomic",
|
|
633
678
|
"type": "fitness-fn",
|
|
634
679
|
"label": "No half operations",
|
|
635
680
|
"x": 1040,
|
|
636
|
-
"y":
|
|
637
|
-
"
|
|
638
|
-
"
|
|
639
|
-
"
|
|
681
|
+
"y": 390,
|
|
682
|
+
"characteristic": "functional-suitability",
|
|
683
|
+
"scope": "atomic",
|
|
684
|
+
"cadence": "triggered",
|
|
685
|
+
"trigger": "pull-request",
|
|
686
|
+
"invocation": "automated",
|
|
687
|
+
"description": "An integration test makes the operation fail after each of its writes in turn and checks that none of its records exist afterwards.\n\nThreshold: 0 records left behind when an operation fails at any of its steps\n\nTool: Vitest with Testcontainers (PostgreSQL)\n\n```ts\nimport { placeOrder } from '../src/orders/placeOrder'\nimport { count } from './db'\n\nit.each(['afterReservation', 'afterInvoice', 'beforeCommit'])('leaves nothing when it fails %s', async (step) => {\n const failAt = { [step]: () => { throw new Error('injected') } }\n await expect(placeOrder({ sku: 'A', quantity: 1 }, { hooks: failAt })).rejects.toThrow('injected')\n expect(await count('reservations')).toBe(0)\n expect(await count('invoices')).toBe(0)\n})\n```",
|
|
640
688
|
"hubWhen": {
|
|
641
689
|
"MODEL": [
|
|
642
690
|
"acid"
|
|
@@ -648,10 +696,13 @@
|
|
|
648
696
|
"type": "fitness-fn",
|
|
649
697
|
"label": "Only the relay publishes",
|
|
650
698
|
"x": 1040,
|
|
651
|
-
"y":
|
|
652
|
-
"
|
|
653
|
-
"
|
|
654
|
-
"
|
|
699
|
+
"y": 520,
|
|
700
|
+
"characteristic": "reliability",
|
|
701
|
+
"scope": "atomic",
|
|
702
|
+
"cadence": "triggered",
|
|
703
|
+
"trigger": "pull-request",
|
|
704
|
+
"invocation": "automated",
|
|
705
|
+
"description": "A dependency rule fails the build when code outside the relay imports a broker client, which would be a dual write that can lose or invent events.\n\nThreshold: 0 modules outside the outbox relay that import a broker client\n\nTool: dependency-cruiser (or the equivalent for your stack: ArchUnit, NetArchTest)\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n forbidden: [{\n name: 'publish-through-outbox',\n comment: 'ADR Transactional outbox: write to the outbox table; only the relay talks to the broker',\n severity: 'error',\n from: { pathNot: '^src/outbox/relay' },\n to: { path: 'node_modules/(kafkajs|amqplib|@aws-sdk/client-sqs|@aws-sdk/client-sns|@azure/service-bus|@google-cloud/pubsub)' },\n }],\n}\n```",
|
|
655
706
|
"hubWhen": {
|
|
656
707
|
"MODEL": [
|
|
657
708
|
"outbox",
|
|
@@ -660,29 +711,35 @@
|
|
|
660
711
|
}
|
|
661
712
|
},
|
|
662
713
|
{
|
|
663
|
-
"id": "ff-outbox-
|
|
714
|
+
"id": "ff-outbox-test",
|
|
664
715
|
"type": "fitness-fn",
|
|
665
|
-
"label": "
|
|
716
|
+
"label": "Events follow commits only",
|
|
666
717
|
"x": 1040,
|
|
667
|
-
"y":
|
|
668
|
-
"
|
|
669
|
-
"
|
|
670
|
-
"
|
|
718
|
+
"y": 650,
|
|
719
|
+
"characteristic": "reliability",
|
|
720
|
+
"scope": "atomic",
|
|
721
|
+
"cadence": "triggered",
|
|
722
|
+
"trigger": "pull-request",
|
|
723
|
+
"invocation": "automated",
|
|
724
|
+
"description": "An integration test stops the broker, places an order (committed) and makes a second one roll back, restarts the broker and reads the topic: the first order's event arrives within the bound, the second never.\n\nThreshold: A committed change has its event on the broker within {{PROPAGATION_SECONDS}} seconds of the broker's return; a rolled-back change has 0 events\n\nTool: Vitest with Testcontainers (PostgreSQL and the broker)\n\n```ts\nimport { placeOrder } from '../src/orders/placeOrder'\nimport { broker, topic } from './broker' // the broker container and a consumer of the events topic\n\nit('publishes committed changes only, once the broker is back', async () => {\n await broker.stop()\n const committed = await placeOrder({ sku: 'A', quantity: 1 })\n await expect(placeOrder({ sku: 'A', quantity: 1 }, { hooks: { beforeCommit: () => { throw new Error('injected') } } })).rejects.toThrow()\n await broker.start()\n const events = await topic.collect({ seconds: {{PROPAGATION_SECONDS}} })\n expect(events.map((e) => e.orderId)).toEqual([committed.id])\n})\n```",
|
|
671
725
|
"hubWhen": {
|
|
672
726
|
"MODEL": [
|
|
673
|
-
"outbox"
|
|
727
|
+
"outbox",
|
|
728
|
+
"saga"
|
|
674
729
|
]
|
|
675
730
|
}
|
|
676
731
|
},
|
|
677
732
|
{
|
|
678
|
-
"id": "ff-
|
|
733
|
+
"id": "ff-outbox-lag",
|
|
679
734
|
"type": "fitness-fn",
|
|
680
|
-
"label": "
|
|
735
|
+
"label": "Outbox drained in time",
|
|
681
736
|
"x": 1040,
|
|
682
|
-
"y":
|
|
683
|
-
"
|
|
684
|
-
"
|
|
685
|
-
"
|
|
737
|
+
"y": 780,
|
|
738
|
+
"characteristic": "reliability",
|
|
739
|
+
"scope": "atomic",
|
|
740
|
+
"cadence": "continual",
|
|
741
|
+
"invocation": "automated",
|
|
742
|
+
"description": "The database exporter reports the age of the oldest unpublished outbox row; Prometheus pages when the relay falls behind, before consumers notice.\n\nThreshold: The oldest unpublished outbox row is never older than {{PROPAGATION_SECONDS}} seconds for more than 2 minutes\n\nTool: Prometheus with sql_exporter\n\n```yaml\n# sql_exporter collector\ncollector_name: outbox\nmetrics:\n - metric_name: outbox_oldest_unpublished_seconds\n type: gauge\n help: 'Age of the oldest event not yet published'\n values: [age]\n query: |\n SELECT coalesce(extract(epoch FROM now() - min(created_at)), 0) AS age FROM outbox WHERE published_at IS NULL\n---\n# Prometheus alerting rule\ngroups:\n - name: data-consistency\n rules:\n - alert: OutboxBehind\n expr: outbox_oldest_unpublished_seconds > {{PROPAGATION_SECONDS}}\n for: 2m\n labels: { severity: page }\n```",
|
|
686
743
|
"hubWhen": {
|
|
687
744
|
"MODEL": [
|
|
688
745
|
"outbox",
|
|
@@ -695,10 +752,13 @@
|
|
|
695
752
|
"type": "fitness-fn",
|
|
696
753
|
"label": "Sagas compensate",
|
|
697
754
|
"x": 1040,
|
|
698
|
-
"y":
|
|
699
|
-
"
|
|
700
|
-
"
|
|
701
|
-
"
|
|
755
|
+
"y": 910,
|
|
756
|
+
"characteristic": "reliability",
|
|
757
|
+
"scope": "atomic",
|
|
758
|
+
"cadence": "triggered",
|
|
759
|
+
"trigger": "pull-request",
|
|
760
|
+
"invocation": "automated",
|
|
761
|
+
"description": "A workflow test makes each step fail in turn on a time-skipping test server and checks that the completed steps were compensated in reverse order. The Temporal form is below; the same test is written with Step Functions Local, Camunda zeebe-process-test or the MassTransit test harness.\n\nThreshold: For every step of every saga, a failure there runs the compensations of all earlier steps in reverse order, and 0 steps without a compensation test\n\nTool: Temporal TypeScript SDK (@temporalio/testing); for Step Functions: Step Functions Local with mocked service integrations; for Camunda 8: zeebe-process-test; for MassTransit: the in-memory test harness\n\n```ts\nimport { fileURLToPath } from 'node:url'\nimport { TestWorkflowEnvironment } from '@temporalio/testing'\nimport { Worker } from '@temporalio/worker'\nimport { placeOrder } from '../src/workflows'\n\nconst steps = [\n { name: 'reserveStock', compensations: [] },\n { name: 'chargePayment', compensations: ['releaseStock'] },\n { name: 'shipOrder', compensations: ['refundPayment', 'releaseStock'] },\n]\n\nit.each(steps)('compensates everything before $name in reverse order', async (failing) => {\n const env = await TestWorkflowEnvironment.createTimeSkipping()\n const done: string[] = []\n const record = (name: string) => async () => { if (name === failing.name) throw new Error('fails for good'); done.push(name) }\n const worker = await Worker.create({\n connection: env.nativeConnection, taskQueue: 'test',\n workflowsPath: fileURLToPath(new URL('../src/workflows', import.meta.url)),\n activities: Object.fromEntries(['reserveStock', 'chargePayment', 'shipOrder', 'releaseStock', 'refundPayment'].map((n) => [n, record(n)])),\n })\n await worker.runUntil(env.client.workflow.execute(placeOrder, { taskQueue: 'test', workflowId: `order-${failing.name}`, args: [{ sku: 'A' }] }).catch(() => undefined))\n expect(done.filter((n) => failing.compensations.includes(n))).toEqual(failing.compensations)\n await env.teardown()\n})\n```",
|
|
702
762
|
"hubWhen": {
|
|
703
763
|
"MODEL": [
|
|
704
764
|
"saga"
|
|
@@ -706,14 +766,17 @@
|
|
|
706
766
|
}
|
|
707
767
|
},
|
|
708
768
|
{
|
|
709
|
-
"id": "ff-
|
|
769
|
+
"id": "ff-saga-resume",
|
|
710
770
|
"type": "fitness-fn",
|
|
711
|
-
"label": "
|
|
771
|
+
"label": "Sagas resume after a restart",
|
|
712
772
|
"x": 1040,
|
|
713
|
-
"y":
|
|
714
|
-
"
|
|
715
|
-
"
|
|
716
|
-
"
|
|
773
|
+
"y": 1040,
|
|
774
|
+
"characteristic": "reliability",
|
|
775
|
+
"scope": "atomic",
|
|
776
|
+
"cadence": "triggered",
|
|
777
|
+
"trigger": "pull-request",
|
|
778
|
+
"invocation": "automated",
|
|
779
|
+
"description": "A workflow test stops the worker once the second activity has completed, starts a new worker, and checks that the saga finishes with each step run exactly once and that the order's status was pending until the end.\n\nThreshold: A saga stopped after its second step continues from the third on a new worker, with 0 steps repeated, and the order stays pending until the saga completes\n\nTool: Temporal TypeScript SDK (@temporalio/testing); for other orchestrators, the equivalent restart of the engine or harness mid-flow\n\n```ts\nimport { fileURLToPath } from 'node:url'\nimport { TestWorkflowEnvironment } from '@temporalio/testing'\nimport { Worker } from '@temporalio/worker'\nimport { placeOrder } from '../src/workflows'\nimport { orders } from '../src/orders/repository'\n\nit('continues from the third step on a new worker', async () => {\n const env = await TestWorkflowEnvironment.createTimeSkipping()\n const done: string[] = []\n let secondDone!: () => void\n const afterSecond = new Promise<void>((r) => { secondDone = r })\n const activities = {\n reserveStock: async () => { done.push('reserve') },\n chargePayment: async () => { done.push('charge'); secondDone() },\n shipOrder: async () => { done.push('ship'); expect((await orders.get('order-1')).status).toBe('pending') },\n notify: async () => { done.push('notify') },\n }\n const options = { connection: env.nativeConnection, taskQueue: 'test', workflowsPath: fileURLToPath(new URL('../src/workflows', import.meta.url)), activities }\n const first = await Worker.create(options)\n const handle = await env.client.workflow.start(placeOrder, { taskQueue: 'test', workflowId: 'order-1', args: [{ sku: 'A' }] })\n const run = first.run()\n await afterSecond\n first.shutdown()\n await run\n const second = await Worker.create(options)\n await second.runUntil(handle.result())\n expect(done).toEqual(['reserve', 'charge', 'ship', 'notify'])\n expect((await orders.get('order-1')).status).toBe('completed')\n await env.teardown()\n})\n```",
|
|
717
780
|
"hubWhen": {
|
|
718
781
|
"MODEL": [
|
|
719
782
|
"saga"
|
|
@@ -721,63 +784,73 @@
|
|
|
721
784
|
}
|
|
722
785
|
},
|
|
723
786
|
{
|
|
724
|
-
"id": "ff-
|
|
787
|
+
"id": "ff-stuck-sagas",
|
|
725
788
|
"type": "fitness-fn",
|
|
726
|
-
"label": "
|
|
789
|
+
"label": "No stuck sagas",
|
|
727
790
|
"x": 1040,
|
|
728
|
-
"y":
|
|
729
|
-
"
|
|
730
|
-
"
|
|
731
|
-
"
|
|
791
|
+
"y": 1170,
|
|
792
|
+
"characteristic": "reliability",
|
|
793
|
+
"scope": "atomic",
|
|
794
|
+
"cadence": "continual",
|
|
795
|
+
"invocation": "automated",
|
|
796
|
+
"description": "The database exporter counts sagas neither completed nor compensated after the limit; Prometheus pages when there is one, since the records it holds stay pending.\n\nThreshold: 0 sagas open for more than {{SAGA_MINUTES}} minutes\n\nTool: Prometheus with sql_exporter\n\n```yaml\n# sql_exporter collector\ncollector_name: sagas\nmetrics:\n - metric_name: sagas_overdue\n type: gauge\n help: 'Sagas open longer than allowed'\n values: [n]\n query: |\n SELECT count(*) AS n FROM saga_instance\n WHERE status NOT IN ('completed', 'compensated') AND started_at < now() - interval '{{SAGA_MINUTES}} minutes'\n---\ngroups:\n - name: data-consistency\n rules:\n - alert: SagaStuck\n expr: sagas_overdue > 0\n for: 5m\n labels: { severity: page }\n```",
|
|
732
797
|
"hubWhen": {
|
|
733
|
-
"
|
|
734
|
-
"
|
|
798
|
+
"MODEL": [
|
|
799
|
+
"saga"
|
|
735
800
|
]
|
|
736
801
|
}
|
|
737
802
|
},
|
|
738
803
|
{
|
|
739
|
-
"id": "ff-
|
|
804
|
+
"id": "ff-reads-primary",
|
|
740
805
|
"type": "fitness-fn",
|
|
741
|
-
"label": "
|
|
806
|
+
"label": "Reads hit the primary",
|
|
742
807
|
"x": 1040,
|
|
743
|
-
"y":
|
|
744
|
-
"
|
|
745
|
-
"
|
|
746
|
-
"
|
|
808
|
+
"y": 1300,
|
|
809
|
+
"characteristic": "functional-suitability",
|
|
810
|
+
"scope": "atomic",
|
|
811
|
+
"cadence": "triggered",
|
|
812
|
+
"trigger": "pull-request",
|
|
813
|
+
"invocation": "automated",
|
|
814
|
+
"description": "A test starts the application's data access with its production configuration shape, asks every pool it opened whether it is on a replica, and checks that no read-only data source is configured.\n\nThreshold: Every connection pool the application opens reports pg_is_in_recovery() = false; 0 read-only data sources configured\n\nTool: Vitest with Testcontainers (PostgreSQL primary and a replica, to make the check meaningful)\n\n```ts\nimport { dataSources } from '../src/db/dataSources' // every pool the application opens, by name\n\nit('serves every read from the primary', async () => {\n expect(Object.keys(dataSources.readOnly ?? {})).toEqual([])\n for (const [name, pool] of Object.entries(dataSources.all())) {\n const { rows } = await pool.query('select pg_is_in_recovery() as replica')\n expect(rows[0].replica, `pool ${name} points at a replica`).toBe(false)\n }\n})\n```",
|
|
747
815
|
"hubWhen": {
|
|
748
816
|
"READS": [
|
|
749
|
-
"
|
|
750
|
-
"bounded"
|
|
817
|
+
"primary"
|
|
751
818
|
]
|
|
752
819
|
}
|
|
753
820
|
},
|
|
754
821
|
{
|
|
755
|
-
"id": "ff-
|
|
822
|
+
"id": "ff-ryw",
|
|
756
823
|
"type": "fitness-fn",
|
|
757
|
-
"label": "
|
|
824
|
+
"label": "Own writes read back",
|
|
758
825
|
"x": 1040,
|
|
759
|
-
"y":
|
|
760
|
-
"
|
|
761
|
-
"
|
|
762
|
-
"
|
|
826
|
+
"y": 1430,
|
|
827
|
+
"characteristic": "functional-suitability",
|
|
828
|
+
"scope": "atomic",
|
|
829
|
+
"cadence": "triggered",
|
|
830
|
+
"trigger": "pull-request",
|
|
831
|
+
"invocation": "automated",
|
|
832
|
+
"description": "An integration test delays replication on purpose (a paused WAL replay on the replica) and checks that a user's read straight after their write still returns it.\n\nThreshold: 0 of 100 write-then-read pairs return the old value while replicas lag\n\nTool: Vitest with Testcontainers (PostgreSQL primary and replica)\n\n```ts\nimport { api, replica, user } from './replicas'\n\nit('shows a user their own write while the replica lags', async () => {\n await replica.query('select pg_wal_replay_pause()')\n for (let i = 0; i < 100; i++) {\n await api.as(user).put('/me/address', { street: `Street ${i}` })\n const { body } = await api.as(user).get('/me/address')\n expect(body.street).toBe(`Street ${i}`)\n }\n await replica.query('select pg_wal_replay_resume()')\n})\n```",
|
|
763
833
|
"hubWhen": {
|
|
764
|
-
"
|
|
765
|
-
"
|
|
834
|
+
"READS": [
|
|
835
|
+
"ryw"
|
|
766
836
|
]
|
|
767
837
|
}
|
|
768
838
|
},
|
|
769
839
|
{
|
|
770
|
-
"id": "ff-
|
|
840
|
+
"id": "ff-staleness",
|
|
771
841
|
"type": "fitness-fn",
|
|
772
|
-
"label": "
|
|
842
|
+
"label": "Replica lag bounded and routed",
|
|
773
843
|
"x": 1040,
|
|
774
|
-
"y":
|
|
775
|
-
"
|
|
776
|
-
"
|
|
777
|
-
"
|
|
844
|
+
"y": 1560,
|
|
845
|
+
"characteristic": "functional-suitability",
|
|
846
|
+
"scope": "atomic",
|
|
847
|
+
"cadence": "continual",
|
|
848
|
+
"invocation": "automated",
|
|
849
|
+
"description": "The PostgreSQL exporter reports each replica's lag, and the read router exports replica_in_rotation (1 while it sends reads to the replica); Prometheus alerts when the lag passes the bound, and pages when a lagging replica is still in rotation.\n\nThreshold: Replica lag above {{PROPAGATION_SECONDS}} seconds for no more than 1 minute; a replica lagging more than that receives no reads for more than 1 minute\n\nTool: Prometheus with postgres_exporter (pg_replication_lag_seconds) and the router's own replica_in_rotation gauge\n\n```yaml\ngroups:\n - name: data-consistency\n rules:\n - alert: ReplicaTooStale\n expr: pg_replication_lag_seconds > {{PROPAGATION_SECONDS}}\n for: 1m\n labels: { severity: ticket }\n annotations:\n summary: 'Replica {{ $labels.instance }} is more than {{PROPAGATION_SECONDS}} s behind'\n - alert: StaleReplicaStillServingReads\n expr: (pg_replication_lag_seconds > {{PROPAGATION_SECONDS}}) and on (instance) (replica_in_rotation == 1)\n for: 1m\n labels: { severity: page }\n annotations:\n summary: 'Replica {{ $labels.instance }} lags past the bound and still receives reads'\n```",
|
|
778
850
|
"hubWhen": {
|
|
779
|
-
"
|
|
780
|
-
"
|
|
851
|
+
"READS": [
|
|
852
|
+
"ryw",
|
|
853
|
+
"bounded"
|
|
781
854
|
]
|
|
782
855
|
}
|
|
783
856
|
}
|
|
@@ -807,12 +880,6 @@
|
|
|
807
880
|
"targetId": "need",
|
|
808
881
|
"relationType": "derives"
|
|
809
882
|
},
|
|
810
|
-
{
|
|
811
|
-
"id": "req-idempotent--derives--need",
|
|
812
|
-
"sourceId": "req-idempotent",
|
|
813
|
-
"targetId": "need",
|
|
814
|
-
"relationType": "derives"
|
|
815
|
-
},
|
|
816
883
|
{
|
|
817
884
|
"id": "req-lost-update--derives--need",
|
|
818
885
|
"sourceId": "req-lost-update",
|
|
@@ -849,18 +916,6 @@
|
|
|
849
916
|
"targetId": "need",
|
|
850
917
|
"relationType": "derives"
|
|
851
918
|
},
|
|
852
|
-
{
|
|
853
|
-
"id": "req-owner--derives--need",
|
|
854
|
-
"sourceId": "req-owner",
|
|
855
|
-
"targetId": "need",
|
|
856
|
-
"relationType": "derives"
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
"id": "req-shared--derives--need",
|
|
860
|
-
"sourceId": "req-shared",
|
|
861
|
-
"targetId": "need",
|
|
862
|
-
"relationType": "derives"
|
|
863
|
-
},
|
|
864
919
|
{
|
|
865
920
|
"id": "sc-atomic--verifies--req-atomic",
|
|
866
921
|
"sourceId": "sc-atomic",
|
|
@@ -885,12 +940,6 @@
|
|
|
885
940
|
"targetId": "req-saga-state",
|
|
886
941
|
"relationType": "verifies"
|
|
887
942
|
},
|
|
888
|
-
{
|
|
889
|
-
"id": "sc-idempotent--verifies--req-idempotent",
|
|
890
|
-
"sourceId": "sc-idempotent",
|
|
891
|
-
"targetId": "req-idempotent",
|
|
892
|
-
"relationType": "verifies"
|
|
893
|
-
},
|
|
894
943
|
{
|
|
895
944
|
"id": "sc-lost-update--verifies--req-lost-update",
|
|
896
945
|
"sourceId": "sc-lost-update",
|
|
@@ -927,18 +976,6 @@
|
|
|
927
976
|
"targetId": "req-bounded",
|
|
928
977
|
"relationType": "verifies"
|
|
929
978
|
},
|
|
930
|
-
{
|
|
931
|
-
"id": "sc-owner--verifies--req-owner",
|
|
932
|
-
"sourceId": "sc-owner",
|
|
933
|
-
"targetId": "req-owner",
|
|
934
|
-
"relationType": "verifies"
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
"id": "sc-shared--verifies--req-shared",
|
|
938
|
-
"sourceId": "sc-shared",
|
|
939
|
-
"targetId": "req-shared",
|
|
940
|
-
"relationType": "verifies"
|
|
941
|
-
},
|
|
942
979
|
{
|
|
943
980
|
"id": "ff-concurrency--implements--adr-acid",
|
|
944
981
|
"sourceId": "ff-concurrency",
|
|
@@ -958,123 +995,117 @@
|
|
|
958
995
|
"relationType": "implements"
|
|
959
996
|
},
|
|
960
997
|
{
|
|
961
|
-
"id": "ff-
|
|
962
|
-
"sourceId": "ff-
|
|
963
|
-
"targetId": "adr-
|
|
998
|
+
"id": "ff-concurrency--implements--adr-read-committed",
|
|
999
|
+
"sourceId": "ff-concurrency",
|
|
1000
|
+
"targetId": "adr-read-committed",
|
|
964
1001
|
"relationType": "implements"
|
|
965
1002
|
},
|
|
966
1003
|
{
|
|
967
|
-
"id": "ff-
|
|
968
|
-
"sourceId": "ff-
|
|
969
|
-
"targetId": "adr-
|
|
1004
|
+
"id": "ff-concurrency--implements--adr-snapshot",
|
|
1005
|
+
"sourceId": "ff-concurrency",
|
|
1006
|
+
"targetId": "adr-snapshot",
|
|
970
1007
|
"relationType": "implements"
|
|
971
1008
|
},
|
|
972
1009
|
{
|
|
973
|
-
"id": "ff-
|
|
974
|
-
"sourceId": "ff-
|
|
975
|
-
"targetId": "adr-
|
|
1010
|
+
"id": "ff-concurrency--implements--adr-serializable",
|
|
1011
|
+
"sourceId": "ff-concurrency",
|
|
1012
|
+
"targetId": "adr-serializable",
|
|
976
1013
|
"relationType": "implements"
|
|
977
1014
|
},
|
|
978
1015
|
{
|
|
979
|
-
"id": "ff-
|
|
980
|
-
"sourceId": "ff-
|
|
981
|
-
"targetId": "adr-
|
|
1016
|
+
"id": "ff-lost-update--implements--adr-read-committed",
|
|
1017
|
+
"sourceId": "ff-lost-update",
|
|
1018
|
+
"targetId": "adr-read-committed",
|
|
982
1019
|
"relationType": "implements"
|
|
983
1020
|
},
|
|
984
1021
|
{
|
|
985
|
-
"id": "ff-
|
|
986
|
-
"sourceId": "ff-
|
|
987
|
-
"targetId": "adr-
|
|
1022
|
+
"id": "ff-serialization-retry--implements--adr-serializable",
|
|
1023
|
+
"sourceId": "ff-serialization-retry",
|
|
1024
|
+
"targetId": "adr-serializable",
|
|
988
1025
|
"relationType": "implements"
|
|
989
1026
|
},
|
|
990
1027
|
{
|
|
991
|
-
"id": "ff-
|
|
992
|
-
"sourceId": "ff-
|
|
993
|
-
"targetId": "adr-
|
|
1028
|
+
"id": "ff-atomic--implements--adr-acid",
|
|
1029
|
+
"sourceId": "ff-atomic",
|
|
1030
|
+
"targetId": "adr-acid",
|
|
994
1031
|
"relationType": "implements"
|
|
995
1032
|
},
|
|
996
1033
|
{
|
|
997
|
-
"id": "ff-
|
|
998
|
-
"sourceId": "ff-
|
|
999
|
-
"targetId": "adr-
|
|
1034
|
+
"id": "ff-no-dual-write--implements--adr-outbox",
|
|
1035
|
+
"sourceId": "ff-no-dual-write",
|
|
1036
|
+
"targetId": "adr-outbox",
|
|
1000
1037
|
"relationType": "implements"
|
|
1001
1038
|
},
|
|
1002
1039
|
{
|
|
1003
|
-
"id": "ff-
|
|
1004
|
-
"sourceId": "ff-
|
|
1040
|
+
"id": "ff-no-dual-write--implements--adr-saga",
|
|
1041
|
+
"sourceId": "ff-no-dual-write",
|
|
1005
1042
|
"targetId": "adr-saga",
|
|
1006
1043
|
"relationType": "implements"
|
|
1007
1044
|
},
|
|
1008
1045
|
{
|
|
1009
|
-
"id": "ff-
|
|
1010
|
-
"sourceId": "ff-
|
|
1011
|
-
"targetId": "adr-acid",
|
|
1012
|
-
"relationType": "implements"
|
|
1013
|
-
},
|
|
1014
|
-
{
|
|
1015
|
-
"id": "ff-ryw--implements--adr-outbox",
|
|
1016
|
-
"sourceId": "ff-ryw",
|
|
1046
|
+
"id": "ff-outbox-test--implements--adr-outbox",
|
|
1047
|
+
"sourceId": "ff-outbox-test",
|
|
1017
1048
|
"targetId": "adr-outbox",
|
|
1018
1049
|
"relationType": "implements"
|
|
1019
1050
|
},
|
|
1020
1051
|
{
|
|
1021
|
-
"id": "ff-
|
|
1022
|
-
"sourceId": "ff-
|
|
1052
|
+
"id": "ff-outbox-test--implements--adr-saga",
|
|
1053
|
+
"sourceId": "ff-outbox-test",
|
|
1023
1054
|
"targetId": "adr-saga",
|
|
1024
1055
|
"relationType": "implements"
|
|
1025
1056
|
},
|
|
1026
1057
|
{
|
|
1027
|
-
"id": "ff-
|
|
1028
|
-
"sourceId": "ff-
|
|
1029
|
-
"targetId": "adr-
|
|
1058
|
+
"id": "ff-outbox-lag--implements--adr-outbox",
|
|
1059
|
+
"sourceId": "ff-outbox-lag",
|
|
1060
|
+
"targetId": "adr-outbox",
|
|
1030
1061
|
"relationType": "implements"
|
|
1031
1062
|
},
|
|
1032
1063
|
{
|
|
1033
|
-
"id": "ff-
|
|
1034
|
-
"sourceId": "ff-
|
|
1035
|
-
"targetId": "adr-
|
|
1064
|
+
"id": "ff-outbox-lag--implements--adr-saga",
|
|
1065
|
+
"sourceId": "ff-outbox-lag",
|
|
1066
|
+
"targetId": "adr-saga",
|
|
1036
1067
|
"relationType": "implements"
|
|
1037
1068
|
},
|
|
1038
1069
|
{
|
|
1039
|
-
"id": "ff-
|
|
1040
|
-
"sourceId": "ff-
|
|
1070
|
+
"id": "ff-saga--implements--adr-saga",
|
|
1071
|
+
"sourceId": "ff-saga",
|
|
1041
1072
|
"targetId": "adr-saga",
|
|
1042
1073
|
"relationType": "implements"
|
|
1043
1074
|
},
|
|
1044
1075
|
{
|
|
1045
|
-
"id": "ff-
|
|
1046
|
-
"sourceId": "ff-
|
|
1047
|
-
"targetId": "adr-
|
|
1076
|
+
"id": "ff-saga-resume--implements--adr-saga",
|
|
1077
|
+
"sourceId": "ff-saga-resume",
|
|
1078
|
+
"targetId": "adr-saga",
|
|
1048
1079
|
"relationType": "implements"
|
|
1049
1080
|
},
|
|
1050
1081
|
{
|
|
1051
|
-
"id": "ff-
|
|
1052
|
-
"sourceId": "ff-
|
|
1053
|
-
"targetId": "adr-
|
|
1082
|
+
"id": "ff-stuck-sagas--implements--adr-saga",
|
|
1083
|
+
"sourceId": "ff-stuck-sagas",
|
|
1084
|
+
"targetId": "adr-saga",
|
|
1054
1085
|
"relationType": "implements"
|
|
1055
1086
|
},
|
|
1056
1087
|
{
|
|
1057
|
-
"id": "ff-
|
|
1058
|
-
"sourceId": "ff-
|
|
1059
|
-
"targetId": "adr-
|
|
1088
|
+
"id": "ff-reads-primary--implements--adr-reads-primary",
|
|
1089
|
+
"sourceId": "ff-reads-primary",
|
|
1090
|
+
"targetId": "adr-reads-primary",
|
|
1060
1091
|
"relationType": "implements"
|
|
1061
1092
|
},
|
|
1062
1093
|
{
|
|
1063
|
-
"id": "ff-
|
|
1064
|
-
"sourceId": "ff-
|
|
1065
|
-
"targetId": "adr-
|
|
1094
|
+
"id": "ff-ryw--implements--adr-ryw",
|
|
1095
|
+
"sourceId": "ff-ryw",
|
|
1096
|
+
"targetId": "adr-ryw",
|
|
1066
1097
|
"relationType": "implements"
|
|
1067
1098
|
},
|
|
1068
1099
|
{
|
|
1069
|
-
"id": "ff-
|
|
1070
|
-
"sourceId": "ff-
|
|
1071
|
-
"targetId": "adr-
|
|
1100
|
+
"id": "ff-staleness--implements--adr-ryw",
|
|
1101
|
+
"sourceId": "ff-staleness",
|
|
1102
|
+
"targetId": "adr-ryw",
|
|
1072
1103
|
"relationType": "implements"
|
|
1073
1104
|
},
|
|
1074
1105
|
{
|
|
1075
|
-
"id": "ff-
|
|
1076
|
-
"sourceId": "ff-
|
|
1077
|
-
"targetId": "adr-
|
|
1106
|
+
"id": "ff-staleness--implements--adr-bounded",
|
|
1107
|
+
"sourceId": "ff-staleness",
|
|
1108
|
+
"targetId": "adr-bounded",
|
|
1078
1109
|
"relationType": "implements"
|
|
1079
1110
|
}
|
|
1080
1111
|
]
|