@radicaltools/mcp 0.0.0-stage → 0.1.1

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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +140 -2
  3. package/dist/chunk-KI4NVSTU.js +1763 -0
  4. package/dist/elkLayout-WC6AXWOG.js +185 -0
  5. package/dist/hub-catalogue/adr/adr-api-versioning.radical +53 -0
  6. package/dist/hub-catalogue/adr/adr-auth-strategy.radical +53 -0
  7. package/dist/hub-catalogue/adr/adr-caching-strategy.radical +59 -0
  8. package/dist/hub-catalogue/adr/adr-data-consistency-model.radical +40 -0
  9. package/dist/hub-catalogue/adr/adr-data-store.radical +47 -0
  10. package/dist/hub-catalogue/adr/adr-deployment-strategy.radical +53 -0
  11. package/dist/hub-catalogue/adr/adr-event-schema-evolution.radical +53 -0
  12. package/dist/hub-catalogue/adr/adr-integration-style.radical +50 -0
  13. package/dist/hub-catalogue/adr/adr-ledger-reconciliation-strategy.radical +38 -0
  14. package/dist/hub-catalogue/adr/adr-llm-provider-strategy.radical +40 -0
  15. package/dist/hub-catalogue/adr/adr-marketplace-payments-model.radical +39 -0
  16. package/dist/hub-catalogue/adr/adr-multi-region.radical +60 -0
  17. package/dist/hub-catalogue/adr/adr-multi-tenancy-strategy.radical +41 -0
  18. package/dist/hub-catalogue/adr/adr-observability.radical +59 -0
  19. package/dist/hub-catalogue/adr/adr-realtime-transport.radical +38 -0
  20. package/dist/hub-catalogue/adr/adr-tech-stack.radical +45 -0
  21. package/dist/hub-catalogue/adr/adr-zero-trust-network.radical +40 -0
  22. package/dist/hub-catalogue/blueprint/bp-ai-assistant-platform.radical +1641 -0
  23. package/dist/hub-catalogue/blueprint/bp-analytical-data-platform.radical +1428 -0
  24. package/dist/hub-catalogue/blueprint/bp-ecommerce-platform.radical +1989 -0
  25. package/dist/hub-catalogue/blueprint/bp-fintech-ledger-platform.radical +1701 -0
  26. package/dist/hub-catalogue/blueprint/bp-marketplace-platform.radical +1792 -0
  27. package/dist/hub-catalogue/blueprint/bp-realtime-collaboration.radical +1421 -0
  28. package/dist/hub-catalogue/blueprint/bp-saas-b2b-platform.radical +1713 -0
  29. package/dist/hub-catalogue/fitness-function/ff-accessibility-scan.radical +34 -0
  30. package/dist/hub-catalogue/fitness-function/ff-ai-eval-gate.radical +52 -0
  31. package/dist/hub-catalogue/fitness-function/ff-api-contract.radical +36 -0
  32. package/dist/hub-catalogue/fitness-function/ff-capacity-load-test.radical +67 -0
  33. package/dist/hub-catalogue/fitness-function/ff-carbon-footprint-guard.radical +62 -0
  34. package/dist/hub-catalogue/fitness-function/ff-change-failure-rate.radical +45 -0
  35. package/dist/hub-catalogue/fitness-function/ff-chaos-resilience-test.radical +53 -0
  36. package/dist/hub-catalogue/fitness-function/ff-cost-efficiency-guard.radical +64 -0
  37. package/dist/hub-catalogue/fitness-function/ff-coupling-guard.radical +45 -0
  38. package/dist/hub-catalogue/fitness-function/ff-data-integrity-check.radical +51 -0
  39. package/dist/hub-catalogue/fitness-function/ff-data-residency.radical +43 -0
  40. package/dist/hub-catalogue/fitness-function/ff-dependency-rules.radical +37 -0
  41. package/dist/hub-catalogue/fitness-function/ff-deploy-frequency.radical +46 -0
  42. package/dist/hub-catalogue/fitness-function/ff-dr-drill-success.radical +52 -0
  43. package/dist/hub-catalogue/fitness-function/ff-duplication-guard.radical +53 -0
  44. package/dist/hub-catalogue/fitness-function/ff-error-budget.radical +59 -0
  45. package/dist/hub-catalogue/fitness-function/ff-fail-safe-verification.radical +34 -0
  46. package/dist/hub-catalogue/fitness-function/ff-infra-drift.radical +34 -0
  47. package/dist/hub-catalogue/fitness-function/ff-latency-slo.radical +59 -0
  48. package/dist/hub-catalogue/fitness-function/ff-lead-time.radical +44 -0
  49. package/dist/hub-catalogue/fitness-function/ff-ledger-balance-integrity.radical +45 -0
  50. package/dist/hub-catalogue/fitness-function/ff-license-compliance.radical +43 -0
  51. package/dist/hub-catalogue/fitness-function/ff-mttr.radical +45 -0
  52. package/dist/hub-catalogue/fitness-function/ff-noisy-neighbor-guard.radical +66 -0
  53. package/dist/hub-catalogue/fitness-function/ff-sast-scan.radical +35 -0
  54. package/dist/hub-catalogue/fitness-function/ff-scale-out-verification.radical +66 -0
  55. package/dist/hub-catalogue/fitness-function/ff-security-scan.radical +45 -0
  56. package/dist/hub-catalogue/fitness-function/ff-startup-shutdown-check.radical +66 -0
  57. package/dist/hub-catalogue/fitness-function/ff-sync-convergence-test.radical +45 -0
  58. package/dist/hub-catalogue/fitness-function/ff-test-coverage.radical +43 -0
  59. package/dist/hub-catalogue/fitness-function/ff-web-vitals.radical +57 -0
  60. package/dist/hub-catalogue/pattern/pattern-anti-corruption-layer.radical +88 -0
  61. package/dist/hub-catalogue/pattern/pattern-api-gateway.radical +168 -0
  62. package/dist/hub-catalogue/pattern/pattern-bff.radical +179 -0
  63. package/dist/hub-catalogue/pattern/pattern-bulkhead.radical +114 -0
  64. package/dist/hub-catalogue/pattern/pattern-circuit-breaker.radical +219 -0
  65. package/dist/hub-catalogue/pattern/pattern-cqrs.radical +195 -0
  66. package/dist/hub-catalogue/pattern/pattern-crdt-sync.radical +200 -0
  67. package/dist/hub-catalogue/pattern/pattern-event-driven.radical +210 -0
  68. package/dist/hub-catalogue/pattern/pattern-event-sourced-ledger.radical +211 -0
  69. package/dist/hub-catalogue/pattern/pattern-hexagonal.radical +196 -0
  70. package/dist/hub-catalogue/pattern/pattern-microservices.radical +262 -0
  71. package/dist/hub-catalogue/pattern/pattern-rag-pipeline.radical +213 -0
  72. package/dist/hub-catalogue/pattern/pattern-rate-limiter.radical +114 -0
  73. package/dist/hub-catalogue/pattern/pattern-saga.radical +208 -0
  74. package/dist/hub-catalogue/pattern/pattern-sidecar.radical +123 -0
  75. package/dist/hub-catalogue/pattern/pattern-strangler-fig.radical +227 -0
  76. package/dist/hub-catalogue/pattern/pattern-transactional-outbox.radical +209 -0
  77. package/dist/hub-catalogue/requirement/req-accessibility.radical +48 -0
  78. package/dist/hub-catalogue/requirement/req-ai-autonomous-resolution.radical +51 -0
  79. package/dist/hub-catalogue/requirement/req-ai-groundedness.radical +45 -0
  80. package/dist/hub-catalogue/requirement/req-ai-human-handoff.radical +46 -0
  81. package/dist/hub-catalogue/requirement/req-alerting.radical +52 -0
  82. package/dist/hub-catalogue/requirement/req-api-response-time.radical +51 -0
  83. package/dist/hub-catalogue/requirement/req-api-standard.radical +45 -0
  84. package/dist/hub-catalogue/requirement/req-audit-logging.radical +43 -0
  85. package/dist/hub-catalogue/requirement/req-auth-response-time.radical +45 -0
  86. package/dist/hub-catalogue/requirement/req-auth.radical +43 -0
  87. package/dist/hub-catalogue/requirement/req-autoscaling.radical +62 -0
  88. package/dist/hub-catalogue/requirement/req-availability.radical +50 -0
  89. package/dist/hub-catalogue/requirement/req-backward-compatibility.radical +46 -0
  90. package/dist/hub-catalogue/requirement/req-batch-job-completion.radical +50 -0
  91. package/dist/hub-catalogue/requirement/req-carbon-efficiency.radical +64 -0
  92. package/dist/hub-catalogue/requirement/req-centralised-logging.radical +45 -0
  93. package/dist/hub-catalogue/requirement/req-ci-pipeline-time.radical +43 -0
  94. package/dist/hub-catalogue/requirement/req-code-complexity.radical +43 -0
  95. package/dist/hub-catalogue/requirement/req-config-propagation.radical +45 -0
  96. package/dist/hub-catalogue/requirement/req-data-integrity.radical +35 -0
  97. package/dist/hub-catalogue/requirement/req-data-retention.radical +44 -0
  98. package/dist/hub-catalogue/requirement/req-db-query-response.radical +44 -0
  99. package/dist/hub-catalogue/requirement/req-disaster-recovery.radical +59 -0
  100. package/dist/hub-catalogue/requirement/req-distributed-tracing.radical +45 -0
  101. package/dist/hub-catalogue/requirement/req-encryption.radical +49 -0
  102. package/dist/hub-catalogue/requirement/req-error-rate.radical +45 -0
  103. package/dist/hub-catalogue/requirement/req-error-recovery.radical +34 -0
  104. package/dist/hub-catalogue/requirement/req-event-schema-compatibility.radical +37 -0
  105. package/dist/hub-catalogue/requirement/req-fail-safe-default.radical +55 -0
  106. package/dist/hub-catalogue/requirement/req-fast-startup-graceful-shutdown.radical +69 -0
  107. package/dist/hub-catalogue/requirement/req-gdpr-erasure.radical +44 -0
  108. package/dist/hub-catalogue/requirement/req-graceful-degradation.radical +39 -0
  109. package/dist/hub-catalogue/requirement/req-health-checks.radical +43 -0
  110. package/dist/hub-catalogue/requirement/req-iac.radical +36 -0
  111. package/dist/hub-catalogue/requirement/req-idempotency.radical +47 -0
  112. package/dist/hub-catalogue/requirement/req-input-validation.radical +37 -0
  113. package/dist/hub-catalogue/requirement/req-least-privilege.radical +47 -0
  114. package/dist/hub-catalogue/requirement/req-ledger-immutability.radical +38 -0
  115. package/dist/hub-catalogue/requirement/req-mfa.radical +36 -0
  116. package/dist/hub-catalogue/requirement/req-ml-extraction-accuracy.radical +42 -0
  117. package/dist/hub-catalogue/requirement/req-onboarding-time.radical +42 -0
  118. package/dist/hub-catalogue/requirement/req-page-load-time.radical +59 -0
  119. package/dist/hub-catalogue/requirement/req-payout-latency.radical +46 -0
  120. package/dist/hub-catalogue/requirement/req-presence-latency.radical +46 -0
  121. package/dist/hub-catalogue/requirement/req-rate-limiting.radical +45 -0
  122. package/dist/hub-catalogue/requirement/req-report-generation.radical +44 -0
  123. package/dist/hub-catalogue/requirement/req-resource-efficiency.radical +64 -0
  124. package/dist/hub-catalogue/requirement/req-resource-headroom.radical +53 -0
  125. package/dist/hub-catalogue/requirement/req-resource-isolation.radical +37 -0
  126. package/dist/hub-catalogue/requirement/req-search-response-time.radical +44 -0
  127. package/dist/hub-catalogue/requirement/req-secrets-management.radical +45 -0
  128. package/dist/hub-catalogue/requirement/req-task-success-rate.radical +42 -0
  129. package/dist/hub-catalogue/requirement/req-test-coverage.radical +42 -0
  130. package/dist/hub-catalogue/requirement/req-throughput.radical +55 -0
  131. package/dist/hub-catalogue/requirement/req-vulnerability-scanning.radical +52 -0
  132. package/dist/hub-catalogue/requirement/req-zero-downtime-deploy.radical +39 -0
  133. package/dist/index.js +8382 -0
  134. package/package.json +48 -4
@@ -0,0 +1,195 @@
1
+ {
2
+ "hub": {
3
+ "id": "pattern-cqrs",
4
+ "category": "pattern",
5
+ "name": "CQRS with Event Sourcing",
6
+ "description": "Commands are validated by the write model and stored as an append-only stream of events; projections turn those events into read models shaped for each query. Writes and reads scale and evolve independently.",
7
+ "tags": [
8
+ "cqrs",
9
+ "event-sourcing",
10
+ "ddd",
11
+ "read-model"
12
+ ],
13
+ "requiredMetamodel": "c4-ddd-governance-builtin",
14
+ "hubRefs": [
15
+ "pattern-event-driven",
16
+ "req-idempotency",
17
+ "adr-data-store",
18
+ "pattern-saga",
19
+ "adr-data-consistency-model"
20
+ ]
21
+ },
22
+ "nodes": [
23
+ {
24
+ "id": "user",
25
+ "type": "person",
26
+ "label": "User",
27
+ "description": "Issues commands and views results.",
28
+ "x": 0,
29
+ "y": 0,
30
+ "width": 150,
31
+ "height": 170,
32
+ "collapsed": false
33
+ },
34
+ {
35
+ "id": "platform",
36
+ "type": "system",
37
+ "label": "Order Management",
38
+ "description": "Separate write and read paths.",
39
+ "x": 0,
40
+ "y": 270,
41
+ "width": 930,
42
+ "height": 580,
43
+ "collapsed": false
44
+ },
45
+ {
46
+ "id": "command-api",
47
+ "type": "container",
48
+ "label": "Command API",
49
+ "description": "Loads the aggregate from its event stream, validates the command against invariants, appends new events.",
50
+ "technology": "C# / .NET",
51
+ "parentId": "platform",
52
+ "x": 30,
53
+ "y": 110,
54
+ "width": 300,
55
+ "height": 200,
56
+ "collapsed": false
57
+ },
58
+ {
59
+ "id": "event-store",
60
+ "type": "database",
61
+ "label": "Event Store",
62
+ "description": "Append-only streams per aggregate; the system of record. Supports catch-up subscriptions and replay.",
63
+ "technology": "EventStoreDB",
64
+ "parentId": "platform",
65
+ "x": 370,
66
+ "y": 110,
67
+ "width": 190,
68
+ "height": 130,
69
+ "collapsed": false
70
+ },
71
+ {
72
+ "id": "projector",
73
+ "type": "container",
74
+ "label": "Projector",
75
+ "description": "Subscribes to the event streams and updates read models. Can be reset and replayed from the beginning.",
76
+ "technology": "C# / .NET worker",
77
+ "parentId": "platform",
78
+ "x": 600,
79
+ "y": 110,
80
+ "width": 300,
81
+ "height": 200,
82
+ "collapsed": false
83
+ },
84
+ {
85
+ "id": "query-api",
86
+ "type": "container",
87
+ "label": "Query API",
88
+ "description": "Serves reads straight from the read models. No business rules.",
89
+ "technology": "C# / .NET",
90
+ "parentId": "platform",
91
+ "x": 30,
92
+ "y": 350,
93
+ "width": 300,
94
+ "height": 200,
95
+ "collapsed": false
96
+ },
97
+ {
98
+ "id": "read-store",
99
+ "type": "database",
100
+ "label": "Read Store",
101
+ "description": "Denormalised views: order summaries, customer history, dashboards.",
102
+ "technology": "PostgreSQL / Elasticsearch",
103
+ "parentId": "platform",
104
+ "x": 370,
105
+ "y": 350,
106
+ "width": 190,
107
+ "height": 130,
108
+ "collapsed": false
109
+ }
110
+ ],
111
+ "relations": [
112
+ {
113
+ "id": "user--command-api",
114
+ "sourceId": "user",
115
+ "targetId": "command-api",
116
+ "label": "Sends commands (PlaceOrder, CancelOrder)",
117
+ "technology": "HTTPS / JSON"
118
+ },
119
+ {
120
+ "id": "command-api--event-store",
121
+ "sourceId": "command-api",
122
+ "targetId": "event-store",
123
+ "label": "Reads stream, appends events",
124
+ "technology": "gRPC"
125
+ },
126
+ {
127
+ "id": "projector--event-store",
128
+ "sourceId": "projector",
129
+ "targetId": "event-store",
130
+ "label": "Catch-up subscription",
131
+ "technology": "gRPC"
132
+ },
133
+ {
134
+ "id": "projector--read-store",
135
+ "sourceId": "projector",
136
+ "targetId": "read-store",
137
+ "label": "Upserts read models",
138
+ "technology": "SQL / HTTP"
139
+ },
140
+ {
141
+ "id": "user--query-api",
142
+ "sourceId": "user",
143
+ "targetId": "query-api",
144
+ "label": "Queries order views",
145
+ "technology": "HTTPS / JSON"
146
+ },
147
+ {
148
+ "id": "query-api--read-store",
149
+ "sourceId": "query-api",
150
+ "targetId": "read-store",
151
+ "label": "Reads",
152
+ "technology": "SQL / HTTP"
153
+ }
154
+ ],
155
+ "sequences": [
156
+ {
157
+ "id": "pattern-cqrs-seq",
158
+ "name": "Place order and read it back",
159
+ "relationIds": [
160
+ "user--command-api",
161
+ "command-api--event-store",
162
+ "projector--event-store",
163
+ "projector--read-store",
164
+ "user--query-api",
165
+ "query-api--read-store"
166
+ ],
167
+ "stepDescriptions": [
168
+ "PlaceOrder command arrives.",
169
+ "Aggregate is rehydrated; OrderPlaced is appended.",
170
+ "Projector receives OrderPlaced from its subscription.",
171
+ "Order summary view is updated.",
172
+ "User requests the order summary.",
173
+ "View is returned; may lag the write by milliseconds."
174
+ ]
175
+ }
176
+ ],
177
+ "views": [
178
+ {
179
+ "id": "pattern-cqrs-flow",
180
+ "name": "Place order and read it back",
181
+ "kind": "dynamic",
182
+ "sequenceId": "pattern-cqrs-seq",
183
+ "nodeIds": [
184
+ "user",
185
+ "platform",
186
+ "command-api",
187
+ "event-store",
188
+ "projector",
189
+ "query-api",
190
+ "read-store"
191
+ ],
192
+ "positions": {}
193
+ }
194
+ ]
195
+ }
@@ -0,0 +1,200 @@
1
+ {
2
+ "hub": {
3
+ "id": "pattern-crdt-sync",
4
+ "category": "pattern",
5
+ "name": "CRDT Local-First Sync",
6
+ "description": "Each client keeps a CRDT replica of the document and applies its own edits instantly, online or offline; a sync server relays operations between replicas and persists snapshots, so any number of concurrent editors converge on the same state without locking or a central conflict resolver.",
7
+ "tags": [
8
+ "real-time",
9
+ "crdt",
10
+ "local-first",
11
+ "offline",
12
+ "collaboration"
13
+ ],
14
+ "requiredMetamodel": "c4-ddd-governance-builtin",
15
+ "hubRefs": [
16
+ "adr-realtime-transport",
17
+ "req-presence-latency",
18
+ "ff-sync-convergence-test",
19
+ "pattern-event-driven"
20
+ ]
21
+ },
22
+ "nodes": [
23
+ {
24
+ "id": "collaborator",
25
+ "type": "person",
26
+ "label": "Collaborator",
27
+ "description": "Any of the users concurrently editing the same document; edits apply to their local replica instantly, online or offline.",
28
+ "width": 150,
29
+ "height": 170,
30
+ "collapsed": false,
31
+ "x": 0,
32
+ "y": 0
33
+ },
34
+ {
35
+ "id": "platform",
36
+ "type": "system",
37
+ "label": "Collaboration Service",
38
+ "description": "Relays and durably stores operations so every replica of a document converges.",
39
+ "width": 700,
40
+ "height": 750,
41
+ "collapsed": false,
42
+ "x": 0,
43
+ "y": 290
44
+ },
45
+ {
46
+ "id": "sync-gateway",
47
+ "type": "container",
48
+ "label": "Sync Gateway",
49
+ "description": "Authenticates the client, admits it to the document's room, and relays its operations to every other connected replica.",
50
+ "technology": "Node.js / WebSocket",
51
+ "parentId": "platform",
52
+ "width": 300,
53
+ "height": 200,
54
+ "collapsed": false,
55
+ "x": 30,
56
+ "y": 110
57
+ },
58
+ {
59
+ "id": "op-broadcast-bus",
60
+ "type": "queue",
61
+ "label": "Op Broadcast Bus",
62
+ "description": "Fans accepted operations out to every gateway instance, so a client converges regardless of which instance the other editors are connected to.",
63
+ "technology": "Redis Pub/Sub",
64
+ "parentId": "platform",
65
+ "width": 220,
66
+ "height": 95,
67
+ "collapsed": false,
68
+ "x": 370,
69
+ "y": 110
70
+ },
71
+ {
72
+ "id": "snapshot-worker",
73
+ "type": "container",
74
+ "label": "Snapshot Worker",
75
+ "description": "Periodically compacts each document's operation log into a snapshot, so a reconnecting client doesn't have to replay its full history.",
76
+ "technology": "Node.js",
77
+ "parentId": "platform",
78
+ "width": 300,
79
+ "height": 200,
80
+ "collapsed": false,
81
+ "x": 30,
82
+ "y": 350
83
+ },
84
+ {
85
+ "id": "op-log-store",
86
+ "type": "database",
87
+ "label": "Op Log Store",
88
+ "description": "Durable, append-only log of every accepted operation per document — the system of record a snapshot can always be rebuilt from.",
89
+ "technology": "PostgreSQL",
90
+ "parentId": "platform",
91
+ "width": 190,
92
+ "height": 130,
93
+ "collapsed": false,
94
+ "x": 370,
95
+ "y": 350
96
+ },
97
+ {
98
+ "id": "snapshot-store",
99
+ "type": "database",
100
+ "label": "Snapshot Store",
101
+ "description": "Latest compacted state per document, loaded on client join so it doesn't need the full op log.",
102
+ "technology": "S3",
103
+ "parentId": "platform",
104
+ "width": 190,
105
+ "height": 130,
106
+ "collapsed": false,
107
+ "x": 30,
108
+ "y": 590
109
+ }
110
+ ],
111
+ "relations": [
112
+ {
113
+ "id": "collaborator--sync-gateway",
114
+ "sourceId": "collaborator",
115
+ "targetId": "sync-gateway",
116
+ "label": "Sends & receives operations",
117
+ "technology": "WebSocket"
118
+ },
119
+ {
120
+ "id": "sync-gateway--op-broadcast-bus",
121
+ "sourceId": "sync-gateway",
122
+ "targetId": "op-broadcast-bus",
123
+ "label": "Publishes accepted operation",
124
+ "technology": "pub/sub"
125
+ },
126
+ {
127
+ "id": "op-broadcast-bus--sync-gateway",
128
+ "sourceId": "op-broadcast-bus",
129
+ "targetId": "sync-gateway",
130
+ "label": "Delivers operations accepted by other instances",
131
+ "technology": "pub/sub"
132
+ },
133
+ {
134
+ "id": "sync-gateway--op-log-store",
135
+ "sourceId": "sync-gateway",
136
+ "targetId": "op-log-store",
137
+ "label": "Appends accepted operation",
138
+ "technology": "SQL"
139
+ },
140
+ {
141
+ "id": "snapshot-worker--op-log-store",
142
+ "sourceId": "snapshot-worker",
143
+ "targetId": "op-log-store",
144
+ "label": "Reads operations since the last snapshot",
145
+ "technology": "SQL"
146
+ },
147
+ {
148
+ "id": "snapshot-worker--snapshot-store",
149
+ "sourceId": "snapshot-worker",
150
+ "targetId": "snapshot-store",
151
+ "label": "Writes compacted snapshot",
152
+ "technology": "S3 API"
153
+ },
154
+ {
155
+ "id": "sync-gateway--snapshot-store",
156
+ "sourceId": "sync-gateway",
157
+ "targetId": "snapshot-store",
158
+ "label": "Loads snapshot when a client (re)joins",
159
+ "technology": "S3 API"
160
+ }
161
+ ],
162
+ "sequences": [
163
+ {
164
+ "id": "pattern-crdt-sync-seq",
165
+ "name": "Two replicas edit and converge",
166
+ "relationIds": [
167
+ "collaborator--sync-gateway",
168
+ "sync-gateway--op-broadcast-bus",
169
+ "op-broadcast-bus--sync-gateway",
170
+ "sync-gateway--op-log-store",
171
+ "sync-gateway--snapshot-store"
172
+ ],
173
+ "stepDescriptions": [
174
+ "Collaborator's local CRDT applies the edit instantly and sends the resulting operation to the gateway it's connected to.",
175
+ "That gateway publishes the accepted operation onto the broadcast bus.",
176
+ "Every other gateway instance receives it and relays it to its own connected replicas, which merge it into their local CRDT — merge order doesn't matter, so this can happen in any order relative to other concurrent edits.",
177
+ "The originating gateway durably appends the operation to the op log.",
178
+ "A newly joining or reconnecting replica loads the latest snapshot instead of the full history, then catches up on whatever operations landed after it."
179
+ ]
180
+ }
181
+ ],
182
+ "views": [
183
+ {
184
+ "id": "pattern-crdt-sync-flow",
185
+ "name": "Two replicas edit and converge",
186
+ "kind": "dynamic",
187
+ "sequenceId": "pattern-crdt-sync-seq",
188
+ "nodeIds": [
189
+ "collaborator",
190
+ "platform",
191
+ "sync-gateway",
192
+ "op-broadcast-bus",
193
+ "snapshot-worker",
194
+ "op-log-store",
195
+ "snapshot-store"
196
+ ],
197
+ "positions": {}
198
+ }
199
+ ]
200
+ }
@@ -0,0 +1,210 @@
1
+ {
2
+ "hub": {
3
+ "id": "pattern-event-driven",
4
+ "category": "pattern",
5
+ "name": "Event-Driven Architecture",
6
+ "description": "Producers publish immutable domain events to a durable event bus; any number of consumers react independently. Decouples teams and services in time, availability and deployment.",
7
+ "tags": [
8
+ "event-driven",
9
+ "messaging",
10
+ "asynchronous",
11
+ "decoupling",
12
+ "kafka"
13
+ ],
14
+ "requiredMetamodel": "c4-ddd-governance-builtin",
15
+ "hubRefs": [
16
+ "adr-integration-style",
17
+ "adr-event-schema-evolution",
18
+ "req-event-schema-compatibility",
19
+ "req-idempotency",
20
+ "pattern-transactional-outbox",
21
+ "adr-data-consistency-model"
22
+ ]
23
+ },
24
+ "nodes": [
25
+ {
26
+ "id": "customer",
27
+ "type": "person",
28
+ "label": "Customer",
29
+ "description": "Places orders.",
30
+ "x": 0,
31
+ "y": 0,
32
+ "width": 150,
33
+ "height": 170,
34
+ "collapsed": false
35
+ },
36
+ {
37
+ "id": "platform",
38
+ "type": "system",
39
+ "label": "Order Platform",
40
+ "description": "Producer, event backbone and independent consumers.",
41
+ "x": 0,
42
+ "y": 270,
43
+ "width": 1040,
44
+ "height": 750,
45
+ "collapsed": false
46
+ },
47
+ {
48
+ "id": "orders",
49
+ "type": "container",
50
+ "label": "Order Service",
51
+ "description": "Owns orders. Publishes OrderPlaced, OrderCancelled as facts about what happened.",
52
+ "technology": "Java / Spring Boot",
53
+ "parentId": "platform",
54
+ "x": 30,
55
+ "y": 110,
56
+ "width": 300,
57
+ "height": 200,
58
+ "collapsed": false
59
+ },
60
+ {
61
+ "id": "bus",
62
+ "type": "queue",
63
+ "label": "Event Bus",
64
+ "description": "Durable, partitioned, replayable log. Topics per aggregate; retention allows new consumers to rebuild state.",
65
+ "technology": "Apache Kafka",
66
+ "parentId": "platform",
67
+ "x": 370,
68
+ "y": 110,
69
+ "width": 220,
70
+ "height": 95,
71
+ "collapsed": false
72
+ },
73
+ {
74
+ "id": "registry",
75
+ "type": "container",
76
+ "label": "Schema Registry",
77
+ "description": "Holds Avro schemas per topic and rejects incompatible versions.",
78
+ "technology": "Confluent Schema Registry",
79
+ "parentId": "platform",
80
+ "x": 710,
81
+ "y": 110,
82
+ "width": 300,
83
+ "height": 200,
84
+ "collapsed": false
85
+ },
86
+ {
87
+ "id": "inventory",
88
+ "type": "container",
89
+ "label": "Inventory Service",
90
+ "description": "Reserves stock on OrderPlaced. Idempotent by event id.",
91
+ "technology": "Go",
92
+ "parentId": "platform",
93
+ "x": 30,
94
+ "y": 350,
95
+ "width": 300,
96
+ "height": 200,
97
+ "collapsed": false
98
+ },
99
+ {
100
+ "id": "notifications",
101
+ "type": "container",
102
+ "label": "Notification Service",
103
+ "description": "Sends confirmation e-mails and push messages.",
104
+ "technology": "Node.js",
105
+ "parentId": "platform",
106
+ "x": 370,
107
+ "y": 350,
108
+ "width": 300,
109
+ "height": 200,
110
+ "collapsed": false
111
+ },
112
+ {
113
+ "id": "indexer",
114
+ "type": "container",
115
+ "label": "Search Indexer",
116
+ "description": "Maintains the order search projection.",
117
+ "technology": "Python",
118
+ "parentId": "platform",
119
+ "x": 710,
120
+ "y": 350,
121
+ "width": 300,
122
+ "height": 200,
123
+ "collapsed": false
124
+ },
125
+ {
126
+ "id": "orders-db",
127
+ "type": "database",
128
+ "label": "Orders DB",
129
+ "description": "Order aggregate state.",
130
+ "technology": "PostgreSQL",
131
+ "parentId": "platform",
132
+ "x": 30,
133
+ "y": 590,
134
+ "width": 190,
135
+ "height": 130,
136
+ "collapsed": false
137
+ },
138
+ {
139
+ "id": "search",
140
+ "type": "database",
141
+ "label": "Search Index",
142
+ "description": "Denormalised, query-optimised orders.",
143
+ "technology": "OpenSearch",
144
+ "parentId": "platform",
145
+ "x": 370,
146
+ "y": 590,
147
+ "width": 190,
148
+ "height": 130,
149
+ "collapsed": false
150
+ }
151
+ ],
152
+ "relations": [
153
+ {
154
+ "id": "customer--orders",
155
+ "sourceId": "customer",
156
+ "targetId": "orders",
157
+ "label": "Places order",
158
+ "technology": "HTTPS / JSON"
159
+ },
160
+ {
161
+ "id": "orders--orders-db",
162
+ "sourceId": "orders",
163
+ "targetId": "orders-db",
164
+ "label": "Persists aggregate",
165
+ "technology": "SQL"
166
+ },
167
+ {
168
+ "id": "orders--registry",
169
+ "sourceId": "orders",
170
+ "targetId": "registry",
171
+ "label": "Validates and registers event schema",
172
+ "technology": "HTTP"
173
+ },
174
+ {
175
+ "id": "orders--bus",
176
+ "sourceId": "orders",
177
+ "targetId": "bus",
178
+ "label": "Publishes OrderPlaced",
179
+ "technology": "Avro, key = orderId"
180
+ },
181
+ {
182
+ "id": "bus--inventory",
183
+ "sourceId": "bus",
184
+ "targetId": "inventory",
185
+ "label": "Delivers OrderPlaced",
186
+ "technology": "Consumer group: inventory"
187
+ },
188
+ {
189
+ "id": "bus--notifications",
190
+ "sourceId": "bus",
191
+ "targetId": "notifications",
192
+ "label": "Delivers OrderPlaced",
193
+ "technology": "Consumer group: notifications"
194
+ },
195
+ {
196
+ "id": "bus--indexer",
197
+ "sourceId": "bus",
198
+ "targetId": "indexer",
199
+ "label": "Delivers order events",
200
+ "technology": "Consumer group: search"
201
+ },
202
+ {
203
+ "id": "indexer--search",
204
+ "sourceId": "indexer",
205
+ "targetId": "search",
206
+ "label": "Upserts documents",
207
+ "technology": "HTTP bulk API"
208
+ }
209
+ ]
210
+ }