@radicaltools/cli 0.1.0 → 0.3.0

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.
Files changed (29) hide show
  1. package/README.md +335 -25
  2. package/dist/hub-catalogue/concern/concern-api-evolution.radical +935 -0
  3. package/dist/hub-catalogue/concern/concern-architecture-style.radical +1112 -0
  4. package/dist/hub-catalogue/concern/concern-authentication.radical +685 -0
  5. package/dist/hub-catalogue/concern/concern-authorization.radical +1464 -0
  6. package/dist/hub-catalogue/concern/concern-availability.radical +804 -0
  7. package/dist/hub-catalogue/concern/concern-backend-stack.radical +1118 -0
  8. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1304 -0
  9. package/dist/hub-catalogue/concern/concern-capacity.radical +802 -0
  10. package/dist/hub-catalogue/concern/concern-communication-style.radical +1202 -0
  11. package/dist/hub-catalogue/concern/concern-data-consistency.radical +1081 -0
  12. package/dist/hub-catalogue/concern/concern-data-store.radical +960 -0
  13. package/dist/hub-catalogue/concern/concern-decomposition.radical +1143 -0
  14. package/dist/hub-catalogue/concern/concern-deployment.radical +952 -0
  15. package/dist/hub-catalogue/concern/concern-encryption.radical +1055 -0
  16. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1340 -0
  17. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1151 -0
  18. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1079 -0
  19. package/dist/hub-catalogue/concern/concern-messaging.radical +940 -0
  20. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +864 -0
  21. package/dist/hub-catalogue/concern/concern-observability.radical +1048 -0
  22. package/dist/hub-catalogue/concern/concern-personal-data.radical +1434 -0
  23. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1153 -0
  24. package/dist/hub-catalogue/concern/concern-secrets.radical +1026 -0
  25. package/dist/hub-catalogue/concern/concern-supply-chain.radical +1312 -0
  26. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1306 -0
  27. package/dist/hub-catalogue/concern/concern-test-strategy.radical +1193 -0
  28. package/dist/index.js +9643 -1332
  29. package/package.json +6 -3
@@ -0,0 +1,1081 @@
1
+ {
2
+ "hub": {
3
+ "id": "concern-data-consistency",
4
+ "category": "concern",
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.",
7
+ "tags": [
8
+ "consistency",
9
+ "transactions",
10
+ "isolation",
11
+ "outbox",
12
+ "saga",
13
+ "idempotency"
14
+ ],
15
+ "requiredMetamodel": "c4-ddd-governance-builtin",
16
+ "concern": {
17
+ "id": "data-consistency",
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
+ "applyTo": "source",
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": "data"
22
+ },
23
+ "sources": [
24
+ {
25
+ "title": "microservices.io: Pattern: Saga",
26
+ "url": "https://microservices.io/patterns/data/saga.html"
27
+ },
28
+ {
29
+ "title": "microservices.io: Pattern: Transactional outbox",
30
+ "url": "https://microservices.io/patterns/data/transactional-outbox.html"
31
+ },
32
+ {
33
+ "title": "PostgreSQL documentation: Transaction Isolation",
34
+ "url": "https://www.postgresql.org/docs/current/transaction-iso.html"
35
+ },
36
+ {
37
+ "title": "Jepsen: Consistency Models",
38
+ "url": "https://jepsen.io/consistency"
39
+ }
40
+ ],
41
+ "templateParams": [
42
+ {
43
+ "key": "MODEL",
44
+ "title": "Transactions",
45
+ "label": "How does an operation that changes several records stay all-or-nothing?",
46
+ "hint": "Decided by where the records live: one database can do it in one transaction; a database plus a queue needs an outbox; several services' databases need a saga.",
47
+ "defaultValue": "outbox",
48
+ "options": [
49
+ {
50
+ "value": "acid",
51
+ "label": "one ACID transaction",
52
+ "description": "Every record the operation changes is in one database this element owns, and nothing outside it must learn of the change atomically. Pick it for a monolith or a modular monolith on one database."
53
+ },
54
+ {
55
+ "value": "outbox",
56
+ "label": "a local transaction with a transactional outbox",
57
+ "description": "The change is in one database, and others learn of it through a queue: the event is written in the same transaction and published afterwards. Pick it when the element writes a database and publishes events, as an order service does."
58
+ },
59
+ {
60
+ "value": "saga",
61
+ "label": "a saga with compensating steps",
62
+ "description": "One business operation changes data owned by several services or an external system, each with its own transaction; a failed step undoes the earlier ones. Pick it when no single database holds everything the operation changes."
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "key": "ISOLATION",
68
+ "title": "Isolation",
69
+ "label": "At what isolation level do transactions run?",
70
+ "hint": "The level decides which anomalies concurrent transactions can produce: lost updates at Read Committed, write skew at snapshot isolation, none at Serializable, which in turn aborts transactions that must be retried.",
71
+ "defaultValue": "read-committed",
72
+ "options": [
73
+ {
74
+ "value": "read-committed",
75
+ "label": "Read Committed with version checks",
76
+ "description": "The default of PostgreSQL, SQL Server and Oracle; read-modify-write is protected by a version column or SELECT ... FOR UPDATE. Pick it when invariants are on single rows and contention is low or moderate."
77
+ },
78
+ {
79
+ "value": "snapshot",
80
+ "label": "Repeatable Read (snapshot isolation)",
81
+ "description": "Each transaction sees one snapshot; concurrent updates of the same row abort one of them, but write skew across rows remains. Pick it for reports and multi-row reads that must be consistent, with constraints for cross-row rules."
82
+ },
83
+ {
84
+ "value": "serializable",
85
+ "label": "Serializable",
86
+ "description": "The database guarantees the result of some serial order (PostgreSQL SSI, CockroachDB, Spanner); conflicting transactions abort and are retried. Pick it when invariants span rows (no double booking, balances never negative) and you can retry."
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ "key": "READS",
92
+ "title": "Reads",
93
+ "label": "Where are reads served from?",
94
+ "hint": "Replicas and caches take load off the primary, but lag behind it: a user may not see what they just saved, or two pages may disagree.",
95
+ "defaultValue": "primary",
96
+ "options": [
97
+ {
98
+ "value": "primary",
99
+ "label": "the primary only",
100
+ "description": "Every read sees every committed write. Pick it while the primary can carry the reads, which is longer than most expect."
101
+ },
102
+ {
103
+ "value": "ryw",
104
+ "label": "replicas, with read-your-writes",
105
+ "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
+ },
107
+ {
108
+ "value": "bounded",
109
+ "label": "replicas and caches, with bounded staleness",
110
+ "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
+ }
112
+ ]
113
+ },
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
+ {
134
+ "key": "PROPAGATION_SECONDS",
135
+ "label": "How many seconds may others see the old state after a commit?",
136
+ "defaultValue": "5",
137
+ "type": "number"
138
+ },
139
+ {
140
+ "key": "IDEMPOTENCY_HOURS",
141
+ "label": "For how many hours are processed message ids remembered?",
142
+ "defaultValue": "72",
143
+ "type": "number"
144
+ },
145
+ {
146
+ "key": "SAGA_MINUTES",
147
+ "label": "Within how many minutes must a saga complete or be compensated?",
148
+ "defaultValue": "15",
149
+ "type": "number"
150
+ }
151
+ ]
152
+ },
153
+ "nodes": [
154
+ {
155
+ "id": "need",
156
+ "type": "need",
157
+ "label": "Operations all-or-nothing",
158
+ "x": 0,
159
+ "y": 0,
160
+ "kind": "brief",
161
+ "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."
163
+ },
164
+ {
165
+ "id": "req-atomic",
166
+ "type": "requirement",
167
+ "label": "One transaction per operation",
168
+ "x": 260,
169
+ "y": 0,
170
+ "ears_type": "ubiquitous",
171
+ "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, Transactions; Jepsen consistency models).",
173
+ "hubWhen": {
174
+ "MODEL": [
175
+ "acid"
176
+ ]
177
+ }
178
+ },
179
+ {
180
+ "id": "req-outbox",
181
+ "type": "requirement",
182
+ "label": "Events published with the change",
183
+ "x": 260,
184
+ "y": 130,
185
+ "ears_type": "event-driven",
186
+ "trigger": "a transaction changes state that other elements must learn about",
187
+ "action": "write the event to an outbox table in the same transaction, publish it to the queue within {{PROPAGATION_SECONDS}} seconds of the commit, and publish no event whose transaction rolled back",
188
+ "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
+ "hubWhen": {
190
+ "MODEL": [
191
+ "outbox"
192
+ ]
193
+ }
194
+ },
195
+ {
196
+ "id": "req-saga",
197
+ "type": "requirement",
198
+ "label": "Failed sagas compensated",
199
+ "x": 260,
200
+ "y": 260,
201
+ "ears_type": "unwanted-behaviour",
202
+ "unwanted_condition": "a step of a saga fails for good, or the saga has not completed within {{SAGA_MINUTES}} minutes",
203
+ "action": "run the compensating step of every completed step in reverse order, record the saga's outcome, and alert the owner when a compensation itself fails",
204
+ "rationale": "A saga has no rollback: each step commits locally, so a failure is undone by compensating transactions (microservices.io, Saga; Garcia-Molina and Salem, Sagas, 1987).",
205
+ "hubWhen": {
206
+ "MODEL": [
207
+ "saga"
208
+ ]
209
+ }
210
+ },
211
+ {
212
+ "id": "req-saga-state",
213
+ "type": "requirement",
214
+ "label": "Saga state durable and visible",
215
+ "x": 260,
216
+ "y": 390,
217
+ "ears_type": "ubiquitous",
218
+ "action": "keep each saga's step and outcome in durable storage so that a restart resumes it, and mark the records it changes as pending until it completes, so that no other operation acts on a half-done state",
219
+ "rationale": "Sagas lack isolation: other transactions see intermediate states; a semantic lock (a pending state) is the usual countermeasure (microservices.io, Saga, countermeasures).",
220
+ "hubWhen": {
221
+ "MODEL": [
222
+ "saga"
223
+ ]
224
+ }
225
+ },
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
+ {
244
+ "id": "req-lost-update",
245
+ "type": "requirement",
246
+ "label": "No lost updates",
247
+ "x": 260,
248
+ "y": 650,
249
+ "ears_type": "unwanted-behaviour",
250
+ "unwanted_condition": "two transactions update the same record from the same version",
251
+ "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",
252
+ "rationale": "At Read Committed a read-modify-write cycle loses one of two concurrent updates (PostgreSQL docs, Transaction Isolation, Read Committed; Jepsen: lost update).",
253
+ "hubWhen": {
254
+ "ISOLATION": [
255
+ "read-committed"
256
+ ]
257
+ }
258
+ },
259
+ {
260
+ "id": "req-write-skew",
261
+ "type": "requirement",
262
+ "label": "No write skew",
263
+ "x": 260,
264
+ "y": 780,
265
+ "ears_type": "unwanted-behaviour",
266
+ "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
+ "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",
268
+ "rationale": "Snapshot isolation (PostgreSQL Repeatable Read) prevents lost updates but allows write skew across rows (PostgreSQL docs, Transaction Isolation; Jepsen: snapshot isolation, G2-item).",
269
+ "hubWhen": {
270
+ "ISOLATION": [
271
+ "snapshot"
272
+ ]
273
+ }
274
+ },
275
+ {
276
+ "id": "req-serializable",
277
+ "type": "requirement",
278
+ "label": "Serialization failures retried",
279
+ "x": 260,
280
+ "y": 910,
281
+ "ears_type": "unwanted-behaviour",
282
+ "unwanted_condition": "a transaction fails with a serialization failure (SQLSTATE 40001) or a deadlock (40P01)",
283
+ "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",
284
+ "rationale": "Serializable isolation guarantees the effect of some serial order by aborting conflicting transactions; applications must be prepared to retry them (PostgreSQL docs, Transaction Isolation, Serializable).",
285
+ "hubWhen": {
286
+ "ISOLATION": [
287
+ "serializable"
288
+ ]
289
+ }
290
+ },
291
+ {
292
+ "id": "req-read-primary",
293
+ "type": "requirement",
294
+ "label": "Reads see every commit",
295
+ "x": 260,
296
+ "y": 1040,
297
+ "ears_type": "ubiquitous",
298
+ "action": "serve every read from the primary, so that a read started after a commit returns that commit",
299
+ "rationale": "Reading from the primary gives linearizable reads for a single-leader database without further design (Jepsen: consistency models).",
300
+ "hubWhen": {
301
+ "READS": [
302
+ "primary"
303
+ ]
304
+ }
305
+ },
306
+ {
307
+ "id": "req-ryw",
308
+ "type": "requirement",
309
+ "label": "Users see their own writes",
310
+ "x": 260,
311
+ "y": 1170,
312
+ "ears_type": "event-driven",
313
+ "trigger": "a user who has written within the last {{PROPAGATION_SECONDS}} seconds reads",
314
+ "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)",
315
+ "rationale": "Read-your-writes is the session guarantee users notice when it is missing (Jepsen: read your writes; Terry et al., Session Guarantees, 1994).",
316
+ "hubWhen": {
317
+ "READS": [
318
+ "ryw"
319
+ ]
320
+ }
321
+ },
322
+ {
323
+ "id": "req-bounded",
324
+ "type": "requirement",
325
+ "label": "Staleness bounded",
326
+ "x": 260,
327
+ "y": 1300,
328
+ "ears_type": "state-driven",
329
+ "precondition": "while a read is served from a replica or a cache",
330
+ "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
+ "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
+ "hubWhen": {
333
+ "READS": [
334
+ "bounded"
335
+ ]
336
+ }
337
+ },
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
+ {
369
+ "id": "sc-atomic",
370
+ "type": "scenario",
371
+ "label": "Crash mid-operation",
372
+ "x": 520,
373
+ "y": 0,
374
+ "given": "an order that reserves stock and creates an invoice",
375
+ "when": "the process is killed after the reservation and before the invoice",
376
+ "then": "neither the reservation nor the invoice exists after restart",
377
+ "hubWhen": {
378
+ "MODEL": [
379
+ "acid"
380
+ ]
381
+ }
382
+ },
383
+ {
384
+ "id": "sc-outbox",
385
+ "type": "scenario",
386
+ "label": "Event follows commit",
387
+ "x": 520,
388
+ "y": 130,
389
+ "given": "an order placed while the broker is down",
390
+ "when": "the broker comes back, and another order's transaction rolls back",
391
+ "then": "the first order's event is published within {{PROPAGATION_SECONDS}} seconds of the broker's return; the second has no event",
392
+ "hubWhen": {
393
+ "MODEL": [
394
+ "outbox"
395
+ ]
396
+ }
397
+ },
398
+ {
399
+ "id": "sc-saga",
400
+ "type": "scenario",
401
+ "label": "Payment fails, stock released",
402
+ "x": 520,
403
+ "y": 260,
404
+ "given": "a saga that reserved stock and then fails to charge the card",
405
+ "when": "the payment step fails for good",
406
+ "then": "the stock is released, the order is marked failed, and nothing remains reserved after {{SAGA_MINUTES}} minutes",
407
+ "hubWhen": {
408
+ "MODEL": [
409
+ "saga"
410
+ ]
411
+ }
412
+ },
413
+ {
414
+ "id": "sc-saga-state",
415
+ "type": "scenario",
416
+ "label": "Saga resumes",
417
+ "x": 520,
418
+ "y": 390,
419
+ "given": "a saga stopped by a deployment after its second of four steps",
420
+ "when": "the service starts again",
421
+ "then": "the saga continues from its third step, and the order stays pending until it completes",
422
+ "hubWhen": {
423
+ "MODEL": [
424
+ "saga"
425
+ ]
426
+ }
427
+ },
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
+ {
445
+ "id": "sc-lost-update",
446
+ "type": "scenario",
447
+ "label": "Concurrent edits",
448
+ "x": 520,
449
+ "y": 650,
450
+ "given": "two users editing the same order at version 7",
451
+ "when": "both save",
452
+ "then": "one save succeeds and the other gets a conflict with the current version",
453
+ "hubWhen": {
454
+ "ISOLATION": [
455
+ "read-committed"
456
+ ]
457
+ }
458
+ },
459
+ {
460
+ "id": "sc-write-skew",
461
+ "type": "scenario",
462
+ "label": "Double booking prevented",
463
+ "x": 520,
464
+ "y": 780,
465
+ "given": "one free slot",
466
+ "when": "two customers book it at the same moment",
467
+ "then": "exactly one booking is stored",
468
+ "hubWhen": {
469
+ "ISOLATION": [
470
+ "snapshot"
471
+ ]
472
+ }
473
+ },
474
+ {
475
+ "id": "sc-serializable",
476
+ "type": "scenario",
477
+ "label": "Conflict retried",
478
+ "x": 520,
479
+ "y": 910,
480
+ "given": "two transfers from the same account running at once",
481
+ "when": "one is aborted with SQLSTATE 40001",
482
+ "then": "it is retried and succeeds, and the balance is never negative",
483
+ "hubWhen": {
484
+ "ISOLATION": [
485
+ "serializable"
486
+ ]
487
+ }
488
+ },
489
+ {
490
+ "id": "sc-read-primary",
491
+ "type": "scenario",
492
+ "label": "Saved and seen",
493
+ "x": 520,
494
+ "y": 1040,
495
+ "given": "a user who has just saved an address",
496
+ "when": "the next page loads",
497
+ "then": "it shows the new address",
498
+ "hubWhen": {
499
+ "READS": [
500
+ "primary"
501
+ ]
502
+ }
503
+ },
504
+ {
505
+ "id": "sc-ryw",
506
+ "type": "scenario",
507
+ "label": "Own change visible",
508
+ "x": 520,
509
+ "y": 1170,
510
+ "given": "replicas lagging 3 seconds behind",
511
+ "when": "a user saves an address and reloads at once",
512
+ "then": "the reload shows the new address",
513
+ "hubWhen": {
514
+ "READS": [
515
+ "ryw"
516
+ ]
517
+ }
518
+ },
519
+ {
520
+ "id": "sc-bounded",
521
+ "type": "scenario",
522
+ "label": "Lagging replica dropped",
523
+ "x": 520,
524
+ "y": 1300,
525
+ "given": "a replica whose lag grows past {{PROPAGATION_SECONDS}} seconds",
526
+ "when": "reads arrive",
527
+ "then": "they go to the primary or another replica until it catches up",
528
+ "hubWhen": {
529
+ "READS": [
530
+ "bounded"
531
+ ]
532
+ }
533
+ },
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
+ {
565
+ "id": "adr-acid",
566
+ "type": "adr",
567
+ "label": "One database transaction per operation",
568
+ "x": 780,
569
+ "y": 0,
570
+ "concern": "data-consistency",
571
+ "status": "accepted",
572
+ "date": "",
573
+ "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}}. Writers: {{OWNERSHIP}}. Rules that span rows are database constraints where SQL can state them.",
575
+ "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
+ "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
+ "hubWhen": {
578
+ "MODEL": [
579
+ "acid"
580
+ ]
581
+ }
582
+ },
583
+ {
584
+ "id": "adr-outbox",
585
+ "type": "adr",
586
+ "label": "Transactional outbox",
587
+ "x": 780,
588
+ "y": 130,
589
+ "concern": "data-consistency",
590
+ "status": "accepted",
591
+ "date": "",
592
+ "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. Consumers are idempotent: they remember message ids for {{IDEMPOTENCY_HOURS}} hours in the same transaction as their effect. Isolation: {{ISOLATION}}. Reads: {{READS}}. Writers: {{OWNERSHIP}}.",
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.",
595
+ "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
+ "hubWhen": {
597
+ "MODEL": [
598
+ "outbox"
599
+ ]
600
+ }
601
+ },
602
+ {
603
+ "id": "adr-saga",
604
+ "type": "adr",
605
+ "label": "Sagas with compensation",
606
+ "x": 780,
607
+ "y": 260,
608
+ "concern": "data-consistency",
609
+ "status": "accepted",
610
+ "date": "",
611
+ "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. Steps talk through the transactional outbox, and consumers remember message ids for {{IDEMPOTENCY_HOURS}} hours. Isolation of each local transaction: {{ISOLATION}}. Reads: {{READS}}. Writers: {{OWNERSHIP}}.",
613
+ "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
+ "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
+ "hubWhen": {
616
+ "MODEL": [
617
+ "saga"
618
+ ]
619
+ }
620
+ },
621
+ {
622
+ "id": "ff-concurrency",
623
+ "type": "fitness-fn",
624
+ "label": "Invariants hold under concurrency",
625
+ "x": 1040,
626
+ "y": 0,
627
+ "category": "structural",
628
+ "threshold": "0 lost updates or broken invariants in 1,000 concurrent attempts against a real database at the chosen isolation level",
629
+ "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\nTool: Vitest with Testcontainers (PostgreSQL)\n\n```ts\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```"
630
+ },
631
+ {
632
+ "id": "ff-atomic",
633
+ "type": "fitness-fn",
634
+ "label": "No half operations",
635
+ "x": 1040,
636
+ "y": 130,
637
+ "category": "structural",
638
+ "threshold": "0 records left behind when an operation fails at any of its steps",
639
+ "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\nTool: Vitest with Testcontainers (PostgreSQL)\n\n```ts\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
+ "hubWhen": {
641
+ "MODEL": [
642
+ "acid"
643
+ ]
644
+ }
645
+ },
646
+ {
647
+ "id": "ff-no-dual-write",
648
+ "type": "fitness-fn",
649
+ "label": "Only the relay publishes",
650
+ "x": 1040,
651
+ "y": 260,
652
+ "category": "structural",
653
+ "threshold": "0 modules outside the outbox relay that import a broker client",
654
+ "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\nTool: dependency-cruiser\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
+ "hubWhen": {
656
+ "MODEL": [
657
+ "outbox",
658
+ "saga"
659
+ ]
660
+ }
661
+ },
662
+ {
663
+ "id": "ff-outbox-lag",
664
+ "type": "fitness-fn",
665
+ "label": "Outbox drained in time",
666
+ "x": 1040,
667
+ "y": 390,
668
+ "category": "operational",
669
+ "threshold": "The oldest unpublished outbox row is never older than {{PROPAGATION_SECONDS}} seconds for more than 2 minutes",
670
+ "description": "The database exporter reports the age of the oldest unpublished outbox row; Prometheus pages when the relay falls behind, before consumers notice.\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```",
671
+ "hubWhen": {
672
+ "MODEL": [
673
+ "outbox"
674
+ ]
675
+ }
676
+ },
677
+ {
678
+ "id": "ff-idempotent",
679
+ "type": "fitness-fn",
680
+ "label": "Duplicates absorbed",
681
+ "x": 1040,
682
+ "y": 520,
683
+ "category": "structural",
684
+ "threshold": "Every consumer, given each message twice, produces exactly the effects of one delivery",
685
+ "description": "A test for each consumer delivers every message it handles twice, including a redelivery after a simulated crash before the acknowledgement, and compares the effects with a single delivery.\n\nTool: Vitest with Testcontainers (PostgreSQL and the broker)\n\n```ts\ndescribe.each(consumers)('%s', (consumer) => {\n it('has the same effect for a message delivered twice', async () => {\n const message = consumer.sampleMessage()\n await consumer.handle(message)\n const once = await snapshotEffects()\n await consumer.handle(message) // redelivery\n expect(await snapshotEffects()).toEqual(once)\n })\n})\n```",
686
+ "hubWhen": {
687
+ "MODEL": [
688
+ "outbox",
689
+ "saga"
690
+ ]
691
+ }
692
+ },
693
+ {
694
+ "id": "ff-saga",
695
+ "type": "fitness-fn",
696
+ "label": "Sagas compensate",
697
+ "x": 1040,
698
+ "y": 650,
699
+ "category": "structural",
700
+ "threshold": "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",
701
+ "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.\n\nTool: Temporal TypeScript SDK (@temporalio/testing)\n\n```ts\nimport { TestWorkflowEnvironment } from '@temporalio/testing'\nimport { Worker } from '@temporalio/worker'\nimport { placeOrder } from '../src/workflows'\n\nit('releases the stock when the payment fails', async () => {\n const env = await TestWorkflowEnvironment.createTimeSkipping()\n const done: string[] = []\n const worker = await Worker.create({\n connection: env.nativeConnection, taskQueue: 'test',\n workflowsPath: require.resolve('../src/workflows'),\n activities: {\n reserveStock: async () => { done.push('reserve') },\n releaseStock: async () => { done.push('release') },\n chargePayment: async () => { throw new Error('card declined') },\n },\n })\n await worker.runUntil(env.client.workflow.execute(placeOrder, { taskQueue: 'test', workflowId: 'order-1', args: [{ sku: 'A' }] }).catch(() => undefined))\n expect(done).toEqual(['reserve', 'release'])\n await env.teardown()\n})\n```",
702
+ "hubWhen": {
703
+ "MODEL": [
704
+ "saga"
705
+ ]
706
+ }
707
+ },
708
+ {
709
+ "id": "ff-stuck-sagas",
710
+ "type": "fitness-fn",
711
+ "label": "No stuck sagas",
712
+ "x": 1040,
713
+ "y": 780,
714
+ "category": "operational",
715
+ "threshold": "0 sagas open for more than {{SAGA_MINUTES}} minutes",
716
+ "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\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```",
717
+ "hubWhen": {
718
+ "MODEL": [
719
+ "saga"
720
+ ]
721
+ }
722
+ },
723
+ {
724
+ "id": "ff-ryw",
725
+ "type": "fitness-fn",
726
+ "label": "Own writes read back",
727
+ "x": 1040,
728
+ "y": 910,
729
+ "category": "structural",
730
+ "threshold": "0 of 100 write-then-read pairs return the old value while replicas lag",
731
+ "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\nTool: Vitest with Testcontainers (PostgreSQL primary and replica)\n\n```ts\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```",
732
+ "hubWhen": {
733
+ "READS": [
734
+ "ryw"
735
+ ]
736
+ }
737
+ },
738
+ {
739
+ "id": "ff-staleness",
740
+ "type": "fitness-fn",
741
+ "label": "Replica lag bounded",
742
+ "x": 1040,
743
+ "y": 1040,
744
+ "category": "operational",
745
+ "threshold": "Replica lag above {{PROPAGATION_SECONDS}} seconds for no more than 1 minute; a lagging replica receives no reads",
746
+ "description": "The PostgreSQL exporter reports each replica's lag; Prometheus alerts when it passes the bound, and the read router takes the replica out of rotation on the same signal.\n\nTool: Prometheus with postgres_exporter\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```",
747
+ "hubWhen": {
748
+ "READS": [
749
+ "ryw",
750
+ "bounded"
751
+ ]
752
+ }
753
+ },
754
+ {
755
+ "id": "ff-owner",
756
+ "type": "fitness-fn",
757
+ "label": "Only owners write",
758
+ "x": 1040,
759
+ "y": 1170,
760
+ "category": "structural",
761
+ "threshold": "0 roles other than the owner's with INSERT, UPDATE or DELETE on an entity's tables",
762
+ "description": "A database test run in CI after the migrations asserts the privileges of every role on each entity's tables: the owner writes, others at most read.\n\nTool: pgTAP (run with pg_prove)\n\n```sql\nBEGIN;\nSELECT plan(3);\nSELECT table_privs_are('public', 'orders', 'order_service', ARRAY['SELECT', 'INSERT', 'UPDATE', 'DELETE']);\nSELECT table_privs_are('public', 'orders', 'inventory_service', ARRAY['SELECT'], 'inventory reads orders, never writes');\nSELECT table_privs_are('public', 'orders', 'reporting', ARRAY['SELECT']);\nSELECT * FROM finish();\nROLLBACK;\n```",
763
+ "hubWhen": {
764
+ "OWNERSHIP": [
765
+ "owner"
766
+ ]
767
+ }
768
+ },
769
+ {
770
+ "id": "ff-constraints",
771
+ "type": "fitness-fn",
772
+ "label": "Shared rules in the database",
773
+ "x": 1040,
774
+ "y": 1300,
775
+ "category": "structural",
776
+ "threshold": "Every rule listed for a shared table is a constraint in the schema; 0 rules kept only in application code",
777
+ "description": "A database test run in CI after the migrations asserts that the keys, references and checks the shared tables rely on exist, so no writer can bypass them.\n\nTool: pgTAP (run with pg_prove)\n\n```sql\nBEGIN;\nSELECT plan(4);\nSELECT has_pk('public', 'order_lines', 'order lines have a key');\nSELECT fk_ok('public', 'order_lines', 'order_id', 'public', 'orders', 'id');\nSELECT col_is_unique('public', 'orders', ARRAY['customer_id', 'external_ref'], 'one order per external reference');\nSELECT has_check('public', 'stock', 'stock cannot go negative');\nSELECT * FROM finish();\nROLLBACK;\n```",
778
+ "hubWhen": {
779
+ "OWNERSHIP": [
780
+ "shared"
781
+ ]
782
+ }
783
+ }
784
+ ],
785
+ "relations": [
786
+ {
787
+ "id": "req-atomic--derives--need",
788
+ "sourceId": "req-atomic",
789
+ "targetId": "need",
790
+ "relationType": "derives"
791
+ },
792
+ {
793
+ "id": "req-outbox--derives--need",
794
+ "sourceId": "req-outbox",
795
+ "targetId": "need",
796
+ "relationType": "derives"
797
+ },
798
+ {
799
+ "id": "req-saga--derives--need",
800
+ "sourceId": "req-saga",
801
+ "targetId": "need",
802
+ "relationType": "derives"
803
+ },
804
+ {
805
+ "id": "req-saga-state--derives--need",
806
+ "sourceId": "req-saga-state",
807
+ "targetId": "need",
808
+ "relationType": "derives"
809
+ },
810
+ {
811
+ "id": "req-idempotent--derives--need",
812
+ "sourceId": "req-idempotent",
813
+ "targetId": "need",
814
+ "relationType": "derives"
815
+ },
816
+ {
817
+ "id": "req-lost-update--derives--need",
818
+ "sourceId": "req-lost-update",
819
+ "targetId": "need",
820
+ "relationType": "derives"
821
+ },
822
+ {
823
+ "id": "req-write-skew--derives--need",
824
+ "sourceId": "req-write-skew",
825
+ "targetId": "need",
826
+ "relationType": "derives"
827
+ },
828
+ {
829
+ "id": "req-serializable--derives--need",
830
+ "sourceId": "req-serializable",
831
+ "targetId": "need",
832
+ "relationType": "derives"
833
+ },
834
+ {
835
+ "id": "req-read-primary--derives--need",
836
+ "sourceId": "req-read-primary",
837
+ "targetId": "need",
838
+ "relationType": "derives"
839
+ },
840
+ {
841
+ "id": "req-ryw--derives--need",
842
+ "sourceId": "req-ryw",
843
+ "targetId": "need",
844
+ "relationType": "derives"
845
+ },
846
+ {
847
+ "id": "req-bounded--derives--need",
848
+ "sourceId": "req-bounded",
849
+ "targetId": "need",
850
+ "relationType": "derives"
851
+ },
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
+ {
865
+ "id": "sc-atomic--verifies--req-atomic",
866
+ "sourceId": "sc-atomic",
867
+ "targetId": "req-atomic",
868
+ "relationType": "verifies"
869
+ },
870
+ {
871
+ "id": "sc-outbox--verifies--req-outbox",
872
+ "sourceId": "sc-outbox",
873
+ "targetId": "req-outbox",
874
+ "relationType": "verifies"
875
+ },
876
+ {
877
+ "id": "sc-saga--verifies--req-saga",
878
+ "sourceId": "sc-saga",
879
+ "targetId": "req-saga",
880
+ "relationType": "verifies"
881
+ },
882
+ {
883
+ "id": "sc-saga-state--verifies--req-saga-state",
884
+ "sourceId": "sc-saga-state",
885
+ "targetId": "req-saga-state",
886
+ "relationType": "verifies"
887
+ },
888
+ {
889
+ "id": "sc-idempotent--verifies--req-idempotent",
890
+ "sourceId": "sc-idempotent",
891
+ "targetId": "req-idempotent",
892
+ "relationType": "verifies"
893
+ },
894
+ {
895
+ "id": "sc-lost-update--verifies--req-lost-update",
896
+ "sourceId": "sc-lost-update",
897
+ "targetId": "req-lost-update",
898
+ "relationType": "verifies"
899
+ },
900
+ {
901
+ "id": "sc-write-skew--verifies--req-write-skew",
902
+ "sourceId": "sc-write-skew",
903
+ "targetId": "req-write-skew",
904
+ "relationType": "verifies"
905
+ },
906
+ {
907
+ "id": "sc-serializable--verifies--req-serializable",
908
+ "sourceId": "sc-serializable",
909
+ "targetId": "req-serializable",
910
+ "relationType": "verifies"
911
+ },
912
+ {
913
+ "id": "sc-read-primary--verifies--req-read-primary",
914
+ "sourceId": "sc-read-primary",
915
+ "targetId": "req-read-primary",
916
+ "relationType": "verifies"
917
+ },
918
+ {
919
+ "id": "sc-ryw--verifies--req-ryw",
920
+ "sourceId": "sc-ryw",
921
+ "targetId": "req-ryw",
922
+ "relationType": "verifies"
923
+ },
924
+ {
925
+ "id": "sc-bounded--verifies--req-bounded",
926
+ "sourceId": "sc-bounded",
927
+ "targetId": "req-bounded",
928
+ "relationType": "verifies"
929
+ },
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
+ {
943
+ "id": "ff-concurrency--implements--adr-acid",
944
+ "sourceId": "ff-concurrency",
945
+ "targetId": "adr-acid",
946
+ "relationType": "implements"
947
+ },
948
+ {
949
+ "id": "ff-concurrency--implements--adr-outbox",
950
+ "sourceId": "ff-concurrency",
951
+ "targetId": "adr-outbox",
952
+ "relationType": "implements"
953
+ },
954
+ {
955
+ "id": "ff-concurrency--implements--adr-saga",
956
+ "sourceId": "ff-concurrency",
957
+ "targetId": "adr-saga",
958
+ "relationType": "implements"
959
+ },
960
+ {
961
+ "id": "ff-atomic--implements--adr-acid",
962
+ "sourceId": "ff-atomic",
963
+ "targetId": "adr-acid",
964
+ "relationType": "implements"
965
+ },
966
+ {
967
+ "id": "ff-no-dual-write--implements--adr-outbox",
968
+ "sourceId": "ff-no-dual-write",
969
+ "targetId": "adr-outbox",
970
+ "relationType": "implements"
971
+ },
972
+ {
973
+ "id": "ff-no-dual-write--implements--adr-saga",
974
+ "sourceId": "ff-no-dual-write",
975
+ "targetId": "adr-saga",
976
+ "relationType": "implements"
977
+ },
978
+ {
979
+ "id": "ff-outbox-lag--implements--adr-outbox",
980
+ "sourceId": "ff-outbox-lag",
981
+ "targetId": "adr-outbox",
982
+ "relationType": "implements"
983
+ },
984
+ {
985
+ "id": "ff-idempotent--implements--adr-outbox",
986
+ "sourceId": "ff-idempotent",
987
+ "targetId": "adr-outbox",
988
+ "relationType": "implements"
989
+ },
990
+ {
991
+ "id": "ff-idempotent--implements--adr-saga",
992
+ "sourceId": "ff-idempotent",
993
+ "targetId": "adr-saga",
994
+ "relationType": "implements"
995
+ },
996
+ {
997
+ "id": "ff-saga--implements--adr-saga",
998
+ "sourceId": "ff-saga",
999
+ "targetId": "adr-saga",
1000
+ "relationType": "implements"
1001
+ },
1002
+ {
1003
+ "id": "ff-stuck-sagas--implements--adr-saga",
1004
+ "sourceId": "ff-stuck-sagas",
1005
+ "targetId": "adr-saga",
1006
+ "relationType": "implements"
1007
+ },
1008
+ {
1009
+ "id": "ff-ryw--implements--adr-acid",
1010
+ "sourceId": "ff-ryw",
1011
+ "targetId": "adr-acid",
1012
+ "relationType": "implements"
1013
+ },
1014
+ {
1015
+ "id": "ff-ryw--implements--adr-outbox",
1016
+ "sourceId": "ff-ryw",
1017
+ "targetId": "adr-outbox",
1018
+ "relationType": "implements"
1019
+ },
1020
+ {
1021
+ "id": "ff-ryw--implements--adr-saga",
1022
+ "sourceId": "ff-ryw",
1023
+ "targetId": "adr-saga",
1024
+ "relationType": "implements"
1025
+ },
1026
+ {
1027
+ "id": "ff-staleness--implements--adr-acid",
1028
+ "sourceId": "ff-staleness",
1029
+ "targetId": "adr-acid",
1030
+ "relationType": "implements"
1031
+ },
1032
+ {
1033
+ "id": "ff-staleness--implements--adr-outbox",
1034
+ "sourceId": "ff-staleness",
1035
+ "targetId": "adr-outbox",
1036
+ "relationType": "implements"
1037
+ },
1038
+ {
1039
+ "id": "ff-staleness--implements--adr-saga",
1040
+ "sourceId": "ff-staleness",
1041
+ "targetId": "adr-saga",
1042
+ "relationType": "implements"
1043
+ },
1044
+ {
1045
+ "id": "ff-owner--implements--adr-acid",
1046
+ "sourceId": "ff-owner",
1047
+ "targetId": "adr-acid",
1048
+ "relationType": "implements"
1049
+ },
1050
+ {
1051
+ "id": "ff-owner--implements--adr-outbox",
1052
+ "sourceId": "ff-owner",
1053
+ "targetId": "adr-outbox",
1054
+ "relationType": "implements"
1055
+ },
1056
+ {
1057
+ "id": "ff-owner--implements--adr-saga",
1058
+ "sourceId": "ff-owner",
1059
+ "targetId": "adr-saga",
1060
+ "relationType": "implements"
1061
+ },
1062
+ {
1063
+ "id": "ff-constraints--implements--adr-acid",
1064
+ "sourceId": "ff-constraints",
1065
+ "targetId": "adr-acid",
1066
+ "relationType": "implements"
1067
+ },
1068
+ {
1069
+ "id": "ff-constraints--implements--adr-outbox",
1070
+ "sourceId": "ff-constraints",
1071
+ "targetId": "adr-outbox",
1072
+ "relationType": "implements"
1073
+ },
1074
+ {
1075
+ "id": "ff-constraints--implements--adr-saga",
1076
+ "sourceId": "ff-constraints",
1077
+ "targetId": "adr-saga",
1078
+ "relationType": "implements"
1079
+ }
1080
+ ]
1081
+ }